OnPlayerDeath determine - 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: OnPlayerDeath determine (
/showthread.php?tid=274845)
OnPlayerDeath determine -
billy4601 - 07.08.2011
I was editing a GF script. i want make Wanted player death , The system will Send some messages
to player.
case1:Player kill by Cop
case2:Player death(no-one kill),and Other player near by death player
case3:Player death
This is my code, case1 is work but other case is not work. How to fix?
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
if (WantedLevel[playerid] >= 1)
{//工作區域
if(PlayerInfo[killerid][pMember] == 1||PlayerInfo[killerid][pMember] == 2)
{
SendClientMessage(playerid, COLOR_LIGHTRED, " You are kill by cop'");
}
else if(killerid == INVALID_PLAYER_ID)
//else
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(CrimInRange(30.0, playerid,i))
{
SendClientMessage(playerid, COLOR_LIGHTRED, " you are die, Some player near you'");
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, " you are die");
}
}
}
}