hunted system
#1

I made hunted system for my server , for any one dun know what is the hunted system : any admin sets some one as a hunted and who kill that hunted will get auto prize, i made the auto prize in OnPlayerDeath callback like that:
pawn Код:
f(ServerHunted == 1 && PlayerInfo[playerid][Hunted] == 1)
{
                   format(string,sizeof(string)," %s has Killed the Hunted %s and got his prize.",RPN(killerid),RPN(playerid));
           SendClientMessageToAll(TRANSPARENT_PURPLE,string);
           format(string,sizeof(string),"You have killed the hunted %s",RPN(playerid));
           SendClientMessage(killerid,COLOR_GREY,string);
           ServerHunted = 0;
           SetPlayerColor(playerid,TRANSPARENT_WHITE);
}
the problem is:
if the hunted died without no one killed him it send the message without name, to recap I wanna make thing if the hunted died without no one killed him send message to all that: no winner, hunted died.
thank you
Reply
#2

i mean in OnPlayerDeath when no killer what can i type?
Reply
#3

Check if killer is connected (if the player dies by themselves, killerid will be INVALID_PLAYER_ID (65535)):
pawn Код:
if (ServerHunted == 1 && PlayerInfo[playerid][Hunted] == 1 && killerid != INVALID_PLAYER_ID)
Reply
#4

thanks Konstantinos, I will try it now.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)