Respawn command - 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: Respawn command (
/showthread.php?tid=163220)
Respawn command -
lilswizy - 26.07.2010
Hi everyone I need help ive never before used dcmd and I need help creating a command that will respawn everyone not just 1 person if someone is going to help me the command is has to be /newround.Thanks
Re: Respawn command -
DJDhan - 26.07.2010
I assume you have the dcmd define line, if not:
Put this inder the includes
Код:
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
Put this anywhere (out side any callback)
Код:
dcmd_newround(playerid,params[])
{
new i;
for(i=0;i<GetMaxPlayers();i++)
{
SpawnPlayer(i); //to spawn every player
ForceClassSelection(i);
SetPlayerHealth(i,0.0); //above two lines will bring them back to Class selection
}
return 1;
}
//Under OnPlayerCommandText
Код:
dcmd(newround,8,cmdtext);
Re: Respawn command -
lilswizy - 26.07.2010
Thank you i will try it out now
Edit:it all works thank you very much.