13.01.2012, 21:43
pawn Код:
new gotost[MAX_PLAYERS];
public OnPlayerConnect(playerid) {
gotost[playerid] = 0; // 0 by default
return 1;
}
CMD:togglegoto(playerid, params[]) {
if(gotost[playerid] == 1) {
SendClientMessage(playerid, -1, "Players can no longer teleport to you.");
gotost[playerid] = 0;
}
else {
SendClientMessage(playerid, -1, "Players can now teleport to you.");
gotost[playerid] = 1;
}
return 1;
}
pawn Код:
if(gotost[id] == 1) {
// teleport code
}
else SendClientMessage(playerid, -1, "You cannot teleport to this player.");