SA-MP Forums Archive
Please help me, I have a problem with the Death Match. - 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)
+--- Thread: Please help me, I have a problem with the Death Match. (/showthread.php?tid=465905)



Please help me, I have a problem with the Death Match. - aezakmi1o - 24.09.2013

Death Match, I want to do, use the command / gdm to warp into a place where I set.
When a player is killed. I want players that were born in the same place. But without success. Players come back to the starting point of my own, I wanted to ask you guys to help me fix it achieved it.

What I do is try. This command is used to put in the "Public SetPlayerSpawn"

if (GdmMode [playerid] == 1)
{
new rand = random (sizeof (GdmSpawn));
SetPlayerPos (playerid, GdmSpawn [rand] [0], GdmSpawn [rand] [1], GdmSpawn [rand] [2]);
}

But it was not successful, please help me fix it.


Thank you very much.


Re: Please help me, I have a problem with the Death Match. - DanishHaq - 24.09.2013

Try and put it under a timer of 100 milliseconds or something. Sometimes, when there's lag on the server, some stuff can overwrite other stuff. Happened to me too.


Re: Please help me, I have a problem with the Death Match. - JamesH - 25.09.2013

Top of the script, gather all the random spawns you want.
pawn Код:
new Float:gdmspawn[][3] =
{
    {x,y,z},
    {x,y,z},
    {x,y,z}
};
pawn Код:
new id = random(sizeof(gdmspawn));
        SetPlayerPos(playerid, gdmspawn[id][0],gdmspawn[id][1],gdmspawn[id][2]);
        SetPlayerInterior(playerid, 0); // depends where you set the spawn
        SetPlayerVirtualWorld(playerid, 0); // choosing the vw of the player.
        TogglePlayerControllable(playerid, false); // letting the player move.