10.12.2011, 13:38
(
Последний раз редактировалось suhrab_mujeeb; 10.12.2011 в 14:38.
)
Ok, for example you got 3 commands for dm. This is the simplest untested way to do it.
- Edit
And for your /leavedm cmd
Just keep increasing the SpawnCheck[playerid] value for every command and the same goes in with the OnPlayerSpawn.
pawn Код:
// Top of your script
new SpawnCheck[MAX_PLAYERS];
pawn Код:
// Under OnPlayerConnect and OnPlayerDisconnect
SpawnCheck[playerid] = 0;
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;
pawn Код:
CMD: leavedm(playerid, params[])
{
SpawnCheck[playerid] = 0;
// rest of the code
}