SA-MP Forums Archive
How to check killerid isn't connected - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How to check killerid isn't connected (/showthread.php?tid=216017)



How to check killerid isn't connected - [WSF]ThA_Devil - 24.01.2011

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?


Re: How to check killerid isn't connected - Dreftas - 24.01.2011

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;
}
?


Re: How to check killerid isn't connected - Macluawn - 24.01.2011

put that on the onplayerdisconnect removing the invalid id check.


Re: How to check killerid isn't connected - [WSF]ThA_Devil - 24.01.2011

i ll try dreftas way....


Re: How to check killerid isn't connected - [WSF]ThA_Devil - 24.01.2011

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



Re: How to check killerid isn't connected - Dreftas - 24.01.2011

Np


Re: How to check killerid isn't connected - [WSF]ThA_Devil - 24.01.2011

doesn't worked under onPlayerDeath ;/


Re: How to check killerid isn't connected - [03]Garsino - 24.01.2011

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))



Re: How to check killerid isn't connected - [WSF]ThA_Devil - 24.01.2011

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


Re: How to check killerid isn't connected - [03]Garsino - 24.01.2011

You don't need else.