PDA

View Full Version : Kill streak stops at Double kill +REP


Youssef221
24/01/2015, 08:53 AM
Why when I keep killing, it says normal kill, then after i kill once more, it keeps saying example: [RO]Youssef1000 Is On Double Kill, keeps saying this on every kill, thats the problem, please help me and i will REP.

http://pastebin.com/NuzmbTKB
I made this link because the code is large.

Youssef221
24/01/2015, 09:16 AM
Sorry for double post but here is the result when i kill more than twice without dieing

zaibaslr2
24/01/2015, 09:19 AM
I don't see any other messages like tripple kill on your script.

Youssef221
24/01/2015, 09:23 AM
don't you see:

new killer_name[MAX_PLAYER_NAME], Kill[128];
GetPlayerName(killerid, killer_name, MAX_PLAYER_NAME);
if(killerid != INVALID_PLAYER_ID) return format(Kill, sizeof(Kill), "%s (%d) Is On Killing Spree!", killer_name,killerid), SendClientMessageToAll(0x00FBFFFF, Kill);
} if you didn't, recheck the code

zaibaslr2
24/01/2015, 09:26 AM
You should really align your code so we can understand it

Youssef221
24/01/2015, 09:42 AM
What do you mean?

zaibaslr2
24/01/2015, 09:44 AM
Just make it cleaner, like:
WRONG:

if(i != playerid)
{
if(IsPlayerInVehicle(i, playervehicle[playerid]) && GetPlayerVehicleSeat(i) > 0)
{
RemovePlayerFromVehicle(i);
SendClientMessage(i, 0xFF0000AA, "Anti-Cheat (AC): You Have Been Removed From This Vehicle | Reason: Driver Died.");
GameTextForPlayer(i, "~r~Removed From Vehicle", 3000, 3);
cardriver[playervehicle[playerid]]=0;
playervehicle[playerid] = -1;
}
}

GOOD:

if(i != playerid)
{
if(IsPlayerInVehicle(i, playervehicle[playerid]) && GetPlayerVehicleSeat(i) > 0)
{
RemovePlayerFromVehicle(i);
SendClientMessage(i, 0xFF0000AA, "Anti-Cheat (AC): You Have Been Removed From This Vehicle | Reason: Driver Died.");
GameTextForPlayer(i, "~r~Removed From Vehicle", 3000, 3);
cardriver[playervehicle[playerid]]=0;
playervehicle[playerid] = -1;
}
}

Youssef221
24/01/2015, 10:04 AM
well its pastebin.com problem, its clearly fine to me

Threshold
24/01/2015, 10:44 AM
Why the hell is this script 1000 lines long? I did a bit of re-working on this script because I simply cannot explain everything you did wrong with words...

I was able to shorten this script from 1000 lines, to 172 lines... that's 828 useless lines of code that you've produced or copied from somewhere...

Here is your new OnPlayerDeath:
http://pastebin.com/5nA5hvti

Youssef221
24/01/2015, 11:21 AM
Thanks but the killing streak messages doesn't show,

codes (you made):

switch(Killstreak[killerid])
{
case 0, 1: var = 0;
case 2: format(fstr, sizeof(fstr), "%s (%d) Is On A Double Kill!", killer_name, killerid), var = 1;
case 3: format(fstr, sizeof(fstr), "%s (%d) Is On A Killing Spree!", killer_name, killerid), var = 1;
case 4: format(fstr, sizeof(fstr), "%s (%d) Is On An IG Kill!", killer_name, killerid), var = 2;
case 5: format(fstr, sizeof(fstr), "%s (%d) Is On A Monster Kill!", killer_name, killerid), var = 2;
case 6: format(fstr, sizeof(fstr), "%s (%d) Is Dominating!", killer_name, killerid), var = 3;
case 7: format(fstr, sizeof(fstr), "%s (%d) Is Godlike!", killer_name, killerid), var = 3;
case 8: format(fstr, sizeof(fstr), "%s (%d) Is Beyond Godlike!", killer_name, killerid), var = 4;
case 9: format(fstr, sizeof(fstr), "%s (%d) Is Wicked Sick!", killer_name, killerid), var = 4;
case 10: format(fstr, sizeof(fstr), "%s (%d) Is On A Rockstar Spree!", killer_name, killerid), var = 5;
case 11: format(fstr, sizeof(fstr), "%s (%d) Is ON FIRE!", killer_name, killerid), var = 5;
default: var = 5;
}
if(var && ((Info[killerid][Respect] + var) < 1000))
{
format(fstr, sizeof(fstr), "You Have Earned +%d Respect!", var);
Info[killerid][Respect] += var;
SendClientMessage(killerid, -1, fstr);
}

Threshold
24/01/2015, 11:27 AM
Oh lol, I forgot the SendClientMessage lines...

Edited: http://pastebin.com/5nA5hvti

Youssef221
24/01/2015, 11:36 AM
Lol what the hell?

Threshold
24/01/2015, 12:08 PM
My apologies, the SendClientMessageToAll should have been inside the 'if' statement... not outside it...

I dunno why I keep making such stupid mistakes, but it did take me like an hour or so to fix up this code... so it is pretty late.

http://pastebin.com/5nA5hvti

zaibaslr2
24/01/2015, 12:21 PM
switch(Killstreak[killerid])
{
case 0, 1: var = 0;
case 2: format(fstr, sizeof(fstr), "%s (%d) Is On A Double Kill!", killer_name, killerid), var = 1;
case 3: format(fstr, sizeof(fstr), "%s (%d) Is On A Killing Spree!", killer_name, killerid), var = 1;
case 4: format(fstr, sizeof(fstr), "%s (%d) Is On An IG Kill!", killer_name, killerid), var = 2;
case 5: format(fstr, sizeof(fstr), "%s (%d) Is On A Monster Kill!", killer_name, killerid), var = 2;
case 6: format(fstr, sizeof(fstr), "%s (%d) Is Dominating!", killer_name, killerid), var = 3;
case 7: format(fstr, sizeof(fstr), "%s (%d) Is Godlike!", killer_name, killerid), var = 3;
case 8: format(fstr, sizeof(fstr), "%s (%d) Is Beyond Godlike!", killer_name, killerid), var = 4;
case 9: format(fstr, sizeof(fstr), "%s (%d) Is Wicked Sick!", killer_name, killerid), var = 4;
case 10: format(fstr, sizeof(fstr), "%s (%d) Is On A Rockstar Spree!", killer_name, killerid), var = 5;
case 11: format(fstr, sizeof(fstr), "%s (%d) Is ON FIRE!", killer_name, killerid), var = 5;
default: var = 5;
}
SendClientMessageToAll(0x00FBFFFF, fstr);
if(var && ((Info[killerid][Respect] + var) < 1000))
{
format(fstr, sizeof(fstr), "You Have Earned +%d Respect!", var);
Info[killerid][Respect] += var;
SendClientMessage(killerid, -1, fstr);
}

EDIT: Second page tricks me again,sorry didn't see your post.

Youssef221
24/01/2015, 12:43 PM
Thanks, Threshold, It Now Words, +REPED