25.05.2013, 05:30
Quote:
Use this, take some parts out considering of your GM.
PHP код:
|
pawn Код:
CMD:goto(playerid,params[])
{
if(AdminLevel[playerid] < 5) return 0; //or return 1
new string[128],ID;
if(sscanf(params,"u",ID)) return SendClientMessage(playerid,COLOR_ERROR,"USAGE: /goto (Player Name/ID)");
if(!IsPlayerConnected(ID))
{
format(string,sizeof(string),"The player ID (%d) is not connected to the server. You cannot goto them.",ID);
SendClientMessage(playerid,COLOR_ERROR,string);
return 1;
}
if(IsSpawned[playerid] != 1) return SendClientMessage(playerid,COLOR_ERROR,"You must be alive and spawned in order to be able to use this command.");
if(IsSpawned[ID] != 1)
{
format(string,sizeof(string),"%s(%d) is not spawned. You cannot goto dead people ..",PlayerName(ID),ID);
SendClientMessage(playerid,COLOR_ERROR,string);
return 1;
}
new Float:x,Float:y,Float:z;
GetPlayerPos(ID,x,y,z);
SetPlayerPos(playerid,x+1,y,z);
SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(ID));
SetPlayerInterior(playerid,GetPlayerInterior(ID));
format(string,sizeof(string),"You have teleported to %s(%d).",PlayerName(ID),ID);
SendClientMessage(playerid,COLOR_ADMIN,string);
return 1;
}