SA-MP Forums Archive
Random Spawn In Dm After Death - 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: Random Spawn In Dm After Death (/showthread.php?tid=427656)



Random Spawn In Dm After Death - Xicor - 02.04.2013

How i can make somebody type dm so he gets teleported to random positions of dm and spawns in random positions after death until he types leavedm ?


Re: Random Spawn In Dm After Death - brawrr - 02.04.2013

U need create cmd for join dm, (join and teleport to place) in callback onplayerspawn you need create check if player joined dm, he again teleported to dm zone, for exit from dm u need create cmd or somethink like that, in cmd u need set join param to 0 and spawnplayer or teleported


Re: Random Spawn In Dm After Death - Xicor - 02.04.2013

I have the command for join and leave and it works fine.I just want to make the player spawn in dm after death.


Re: Random Spawn In Dm After Death - brawrr - 02.04.2013

in cmd join put

JoinDM[playerid] = 1;

in public of spawn player

if(JoinDM[playerid] == 1)
{
SetPlayerPos(playerid, XYZ);// teleport player to dm
}


Re: Random Spawn In Dm After Death - Jeffry - 02.04.2013

pawn Код:
//Top of your GM
new JoinedDM[MAX_PLAYERS];
pawn Код:
//Where the player joins the DM
JoinedDM[playerid] = 1;
pawn Код:
//Where the player leaves the DM  AND OnPlayerDisconnect
JoinedDM[playerid] = 0;
pawn Код:
//OnPlayerSpawn
if(JoinedDM[playerid] == 1)
{
    switch(random(3))
    {
        case 0: SetPlayerPos(playerid, x0,y0,z0);
        case 1: SetPlayerPos(playerid, x1,y1,z1);
        case 2: SetPlayerPos(playerid, x2,y2,z2);
        //(...)  Replace xyz by their values.
    }
}



Re: Random Spawn In Dm After Death - Xicor - 02.04.2013

brawrr I tried it but the player spawns in the random spawns after class selection which means its not working and i want to make player spawn in random positions (4,5) after death but not only in one.


Re: Random Spawn In Dm After Death - gurmani11 - 02.04.2013

Here its the way
Код:
///on the places of variables
new Float:DM1[][4] = 
{x,y,z},////// put spawns but without angle
{x,y,z},
{x,y,z},
{x,y,z},
{x,y,z}
};
///////in your onplayerspawn or in your /Dm  command
if (strcmp("/dm", cmdtext, true, 4) == 0) // /dm command
{
new rand = random(sizeof(DM1));
SetPlayerPos(playerid, DM1[rand][0], DM1[rand][1], DM1[rand][2]); // Rnadom DM Spawns



Re: Random Spawn In Dm After Death - SequenceCuz - 04.04.2013

It u wanna make what u want u can PM me man

I'll looking for u


Re: Random Spawn In Dm After Death - Xicor - 04.04.2013

Jeffry,I tried it and it works perfectly if i use it without my random spawns (Which are after Class selection).And if i use it with the random spawns death spawns get mixed with each other.


Re: Random Spawn In Dm After Death - Jeffry - 11.04.2013

Quote:
Originally Posted by Xicor
Посмотреть сообщение
Jeffry,I tried it and it works perfectly if i use it without my random spawns (Which are after Class selection).And if i use it with the random spawns death spawns get mixed with each other.
Then you might show us the complete OnPlayerSpawn or which ever callback is mixed up.