14.09.2014, 15:23
pawn Код:
if(strcmp(cmdtext, "/goto", true) == 0)
{
new targetid;
if(sscanf(cmdtext[6], "u", targetid))//since in strcmp we cannot use params so i added this cmdtext[6]
{
return SendClientMessage(playerid, COLOR_GRAY, "Usage: /goto [playerid]");
}
else if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1, "Invalid player specified.");
else if(targetid == playerid) return SendClientMessage(playerid, -1, "You cannot use this command on yourself!");
else if(gototog[targetid] == 1) return SendClientMessage(playerid, -1, "That player has disabled players from going to them");
new Float: pos[3];
GetPlayerPos(targetid, pos[0], pos[1], pos[2]);
SetPlayerInterior(playerid, GetPlayerInterior(targetid));
SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(targetid));
return 1;
}
if(strcmp(cmdtext, "/toggoto", true) == 0)
{
if(gototog[playerid] == 0)
{
gototog[playerid] = 1;
SendClientMessage(playerid, -1, "Other players may not teleport to you now!");
}
else if(gototog[playerid] == 1)
{
gototog[playerid] = 0;
SendClientMessage(playerid, -1, "Other players may teleport to you now!");
}
return 1;
}