How can i do this ?
#9

Ok, for example you got 3 commands for dm. This is the simplest untested way to do it.
pawn Код:
// Top of your script
new SpawnCheck[MAX_PLAYERS];
pawn Код:
// Under OnPlayerConnect and OnPlayerDisconnect
SpawnCheck[playerid] = 0;
- Edit

pawn Код:
// Commands for example
CMD: dm1(playerid, params[])
{
    // Save this into the variable
    SpawnCheck[playerid] = 1;
    SetPlayerPos(playerid, dm1x, dm1y, dm1z);
    // rest of the code
}
CMD: dm2(playerid, params[])
{
    // Save this into the variable
    SpawnCheck[playerid] = 2;
    SetPlayerPos(playerid, dm2x, dm2y, dm2z);
    // rest of the code
}
CMD: dm3(playerid, params[])
{
    // Save this into the variable
    SpawnCheck[playerid] = 3;
    SetPlayerPos(playerid, dm3x, dm3y, dm3z);
    // rest of the code
}
pawn Код:
// So now you will use this for the spawn part
// Under your OnPlayerSpawn put this
if(SpawnCheck[playerid] == 1)
{
    SetPlayerPos(playerid, dm1x, dm1y, dm1z);
}
else if(SpawnCheck[playerid] == 2)
{
    SetPlayerPos(playerid, dm2x, dm2y, dm2z);
}
else if(SpawnCheck[playerid] == 3)
{
    SetPlayerPos(playerid, dm2x, dm2y, dm2z);
}
else return 1;
And for your /leavedm cmd
pawn Код:
CMD: leavedm(playerid, params[])
{
    SpawnCheck[playerid] = 0;
    // rest of the code
}
Just keep increasing the SpawnCheck[playerid] value for every command and the same goes in with the OnPlayerSpawn.
Reply


Messages In This Thread
How can i do this ? - by Ronaldo_raul™ - 07.12.2011, 14:35
Re: How can i do this ? - by cod4esle - 07.12.2011, 14:59
Re: How can i do this ? - by Ronaldo_raul™ - 07.12.2011, 15:04
Re: How can i do this ? - by CSSI - 07.12.2011, 15:10
Re: How can i do this ? - by sim_sima - 07.12.2011, 15:11
Re: How can i do this ? - by CSSI - 07.12.2011, 15:13
Re: How can i do this ? - by Ronaldo_raul™ - 07.12.2011, 15:14
Re: How can i do this ? - by Ronaldo_raul™ - 08.12.2011, 14:51
Re: How can i do this ? - by suhrab_mujeeb - 10.12.2011, 13:38
Re: How can i do this ? - by Ronaldo_raul™ - 26.12.2011, 12:32

Forum Jump:


Users browsing this thread: 1 Guest(s)