15.01.2015, 10:39
Try changing this"
to this:
Also, I have the same code in my script. I'll post it here. If you want, you can edit it and use it.
PHP код:
if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /gethere [playerid]");
PHP код:
if(sscanf(params, "i", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /gethere [playerid]");
PHP код:
dcmd_tptome(playerid, params[])
{
new pID, Float:adminx, Float:adminy, Float:adminz;
if(PlayerInfo[playerid][pAdmin]==0) return SendClientMessage(playerid, COLOR_WHITE,"Server: Unrecognized command, type /commands to see the commands available for you.");
if(PlayerInfo[playerid][pAdmin]==1) return SendClientMessage(playerid, COLOR_ADMINBLUE, "ERROR: This command is unavailable for your admin rank.");
if(admduty[playerid]==0) return SendClientMessage(playerid, COLOR_ADMINBLUE, "ERROR: You must be on duty to use this command.");
if(sscanf(params, "u", pID)) return SendClientMessage(playerid, COLOR_ADMINBLUE, "Correct usage: /tptome [name/id]");
if(playerid==pID) return SendClientMessage(playerid, COLOR_ADMINBLUE, "ERROR: The requested player is you.");
if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, COLOR_ADMINBLUE, "ERROR: This player is not connected.");
if(life[pID]==0) return SendClientMessage(playerid, COLOR_ADMINBLUE, "ERROR: This player has not spawned.");
if(PlayerInfo[pID][pAdmin]==10) return SendClientMessage(playerid, COLOR_ADMINBLUE, "ERROR: You cannot teleport AmalM to your location.");
GetPlayerPos(playerid, adminx, adminy, adminz);
SetPlayerVirtualWorld(pID,GetPlayerVirtualWorld(playerid));
SetPlayerInterior(pID,GetPlayerInterior(playerid));
if(IsPlayerInAnyVehicle(pID))
{
new vehicleid=GetPlayerVehicleID(pID);
SetVehiclePos(vehicleid, adminx, adminy+2, adminz);
}
else
{
SetPlayerPos(pID, adminx, adminy+2, adminz);
}
SendClientMessage(playerid, COLOR_ADMINBLUE, "The requested player has been teleported to your location successfully.");
SendClientMessage(pID, COLOR_ORANGE, "An admin has teleported you to his position.");
return 1;
}