SA-MP Forums Archive
How to Spawn IN Gamemode after died in Gamemode ? - 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 Spawn IN Gamemode after died in Gamemode ? (/showthread.php?tid=73845)



How to Spawn IN Gamemode after died in Gamemode ? - Bearfist - 18.04.2009

Hi peoples ^^
I createt a simple GunGame In My Gang-Gamemode
But when I died In the Gungame, I spawn at my normal Spawnpoint =(
How do I have to script to Spawn in that Gungame If Died in the Gungame
and If I didn't die I that Gungame I spawn at my normal Spawnpoint..

Hope I doesn't explained It to stupid xD

MFG Bearfist


Re: How to Spawn IN Gamemode after died in Gamemode ? - Soeren - 18.04.2009

Just do something like this: Create a new global variable, like

pawn Code:
new IsInGunGame[MAX_PLAYERS];
When you join the GunGame, you set it to 1 for the respective player,

pawn Code:
IsInGunGame[playerid]=1;
Then you add in OnPlayerSpawn something like

pawn Code:
if(IsInGunGame[playerid]==1)
{
  SetPlayerPos(playerid,x,y,z);
}
Of course you need to set the variable to 0 also at the point you want the player to spawn normally again after the GunGame finished and you have to add it in OnPlayerDisconnect also and set it to 0 for the playerid.

Hope you understand me and I could help you a bit :P


Re: How to Spawn IN Gamemode after died in Gamemode ? - Bearfist - 18.04.2009

Yeeeh

..I got Thanks very much buddy