SA-MP Forums Archive
Need Help - 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: Need Help (/showthread.php?tid=154476)



Need Help - xinix000 - 14.06.2010

i want to change when player death they must type /kill to spawn but my people in server they use F3 in mod_S... and they didn't wait to type /kill

how can i change when player death they must still at same place untill they type /kill and if they use F3 they will spawn at same place and die again

Thks For All answer


Re: Need Help - DJDhan - 14.06.2010

Put this at the top:

Код:
new bool:allowedtospawn[MAX_PLAYERS];
Then under OnPlayerDeath(playerid,reason)

Код:
if(killerid== INVALID_PLAYER_ID)
{
  TogglePlayerSpectating(playerid,1);
  TogglePlayerControllable(playerid,0);
  SendClientMessage(playerid,0xff0000aa,"Type /kill to spawn again.");
  allowedtospawn[playerid]=false;
}
Now under OnPlayerCommandText(playerid,cmdtext[])

Код:
if(!strcmp(cmdtext,"/kill",true,5))
{
  SetPlayrHealth(playerid,0.0);
  allowedtospawn[playerid]=true;
  return 1;
}
Then under OnPlayerSpawn(playerid)

Код:
if(allowedtospawn[playerid]==false)
{
SetPlayerHealth(playerid,0.0);
allowedtospawn[playerid]=true;
}
The above code should work.


Re: Need Help - xinix000 - 14.06.2010

on this 2 line it's show the same error

if(allowedtospawn[playerid]==false)
if(killerid== INVALID_PLAYER_ID)

error 010: invalid function or declaration


Re: Need Help - xinix000 - 14.06.2010

Anyone Can help me ??