13.01.2012, 21:30
Well, first of all, create a var ( new GotoStatus[MAX_PLAYERS]; ) at the top of your game mode.
Then, when the player enters the /gotoon cmd the var status will be changed to 1 ( GotoStatus[playerid] = 1; ).
And when he types the /gotooff cmd, the var status will be changed to 0 ( GotoStatus[playerid] = 0; ).
And when the player types /goto [ID], it will check if the target ID goto is on:
You can find the /goto cmd in DCMD by using search (It will be good if you use sscanf2 too).
I hope i helped you.
Then, when the player enters the /gotoon cmd the var status will be changed to 1 ( GotoStatus[playerid] = 1; ).
And when he types the /gotooff cmd, the var status will be changed to 0 ( GotoStatus[playerid] = 0; ).
And when the player types /goto [ID], it will check if the target ID goto is on:
pawn Код:
if(GotoStatus[targetid] == 1)
{
//Apply your /goto cmd here (The teleports etc)
}
else if(GotoStatus[targetid] == 0) return 0;
I hope i helped you.