How to check killerid isn't connected
#1

i tried to make killing bonuses filterscript but i need somehow get that killerid isn't connected...
pawn Код:
if(killerid == INVALID_PLAYER_ID)
{
new name[MAX_PLAYER_NAME], string[200];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s has ended his own killstreak of %i!",name,KillingSpree[playerid]);
SendClientMessageToAll(COLOR_RED, string);
KillingSpree[playerid] = 0;
}
BUT... this didn't worked into server.... any other way to get that killer isn't connected?
Reply
#2

pawn Код:
if(!IsPlayerConnected(killerid))
{
new name[MAX_PLAYER_NAME], string[200];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s has ended his own killstreak of %i!",name,KillingSpree[playerid]);
SendClientMessageToAll(COLOR_RED, string);
KillingSpree[playerid] = 0;
}
?
Reply
#3

put that on the onplayerdisconnect removing the invalid id check.
Reply
#4

i ll try dreftas way....
Reply
#5

thanks Dreftas!
Код:
This forum requires that you wait 60 seconds between posts. Please try again in 17 seconds.
Reply
#6

Np
Reply
#7

doesn't worked under onPlayerDeath ;/
Reply
#8

Quote:
Originally Posted by Dreftas
Посмотреть сообщение
pawn Код:
if(!IsPlayerConnected(killerid))
{
new name[MAX_PLAYER_NAME], string[200];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s has ended his own killstreak of %i!",name,KillingSpree[playerid]);
SendClientMessageToAll(COLOR_RED, string);
KillingSpree[playerid] = 0;
}
?
Maybe you want to check if the killer is connected...?

Use
pawn Код:
if(IsPlayerConnected(killerid))
instead of
pawn Код:
if(!IsPlayerConnected(killerid))
Reply
#9

it should work better? and check if not in } else { ?
Reply
#10

You don't need else.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)