05.11.2015, 14:44
PHP код:
COMMAND:teleto(playerid, params[]){
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "ERROR: You are not RCON Admin");
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "ERROR: You need to be on foot to teleport to a location");
new Float:x, Float:y, Float:z, playername[MAX_PLAYER_NAME];
if(sscanf(params, "fff", x, y, z)) return SendClientMessage(playerid, -1, "USAGE: /teleto [Location : x, y, z]");
GetPlayerName(playerid, playername, SOS);
format(string, SOS, "You have been teleported to %f, %f, %f !", x, y, z);
SendClientMessage(playerid, 0x33CCFFAA, string);
SetPlayerPos(playerid, x, y, z);
return 1;
}
PHP код:
CMD:tpto(playerid,params[]){
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "ERROR: You are not RCON Admin");
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "ERROR: You need to be on foot to teleport to a location");
new Float:P[3],int,vw;
if(sscanf(params,"fffI(-1)I(-1)",P[0],P[1],P[2],int,vw)) return SendClientMessage(playerid, 0xFFFFFFFF, "/tpto <X> <Y> <Z> [interior] [virtualworld]");
SetPlayerPos(playerid,P[0],P[1],P[2]);
if(int>-1) SetPlayerInterior(playerid,int);
if(vw>-1) SetPlayerVirtualWorld(playerid,vw);
GetPlayerName(playerid, playername, SOS);
format(string, SOS, "You have been teleported to %f, %f, %f [%d] [%d]!", x, y, z, int, vw);
SendClientMessage(playerid, 0x33CCFFAA, string);
SetPlayerPos(playerid, x, y, z);
return 1;
}