Random Spawn In Dm After Death
#1

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 ?
Reply
#2

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
Reply
#3

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

in cmd join put

JoinDM[playerid] = 1;

in public of spawn player

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

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.
    }
}
Reply
#6

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.
Reply
#7

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
Reply
#8

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

I'll looking for u
Reply
#9

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.
Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)