07.09.2012, 18:13
pawn Код:
CMD:go(playerid, params[])
{
new ID;//creates a new something idk what we call it :P but it is defined later on or used in something this 1 is used in next line
if(sscanf(params, "u", ID)) return SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}Usage: /go [PlayerID/PartofName]");//checks if you have written something after /goto if no it sends error
if(!IsPlayerConnected(ID) || ID == playerid) return SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}This player is Offline or it is Yourself");
if(GetPVarInt(playerid, "Jailed") == 1) return GameTextForPlayer(playerid,"Player is Jailed",2000,3);
if(IsPlayerInDM[playerid] == 1) return SendClientMessage(playerid, 0xFFFFFFFF,"{FFFF00}(/go) {FF0000}command is disabled at this moment");
if(IsInHouse{ID} == 1) return SendClientMessage(playerid, 0xFFFFFFFF,"ERROR: Stated Player is inside a house. Try again later.");
new Float:x, Float:y, Float:z,str[64],tID;
if(sscanf(params,"u",tID)) return 0;
GetPlayerPos(tID, x, y, z);
if(IsPlayerInAnyVehicle(playerid))
{
LinkVehicleToInterior(GetPlayerVehicleID(playerid), GetPlayerInterior(tID));
SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), GetPlayerVirtualWorld(tID));
SetVehiclePos(GetPlayerVehicleID(playerid), x + 1, y + 1, z);
}
else
{
SetPlayerInterior(playerid, GetPlayerInterior(tID));
SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(tID));
SetPlayerPos(playerid, x + 1, y + 1, z + 0.5);
}
format(str, sizeof(str), "{FFFF00}(/go) %s (%d) has teleported to you", getname(playerid), playerid);
SendClientMessage(tID, 0xFFFFFFFF, str);
return 1;
}
I wonder why you use sscanf twice.
Try this before trying the one above:
pawn Код:
CMD:go(playerid, params[])
{
new ID;//creates a new something idk what we call it :P but it is defined later on or used in something this 1 is used in next line
if(sscanf(params, "u", ID)) return SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}Usage: /go [PlayerID/PartofName]");//checks if you have written something after /goto if no it sends error
if(!IsPlayerConnected(ID) || ID == playerid) return SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}This player is Offline or it is Yourself");
if(GetPVarInt(playerid, "Jailed") == 1) return GameTextForPlayer(playerid,"Player is Jailed",2000,3);
if(IsPlayerInDM[playerid] == 1) return SendClientMessage(playerid, 0xFFFFFFFF,"{FFFF00}(/go) {FF0000}command is disabled at this moment");
if(IsInHouse{tID} == 1) return SendClientMessage(playerid, 0xFFFFFFFF,"ERROR: Stated Player is inside a house. Try again later.");
new Float:x, Float:y, Float:z,str[64],ID;
GetPlayerPos(ID, x, y, z);
if(IsPlayerInAnyVehicle(playerid))
{
LinkVehicleToInterior(GetPlayerVehicleID(playerid), GetPlayerInterior(ID));
SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), GetPlayerVirtualWorld(ID));
SetVehiclePos(GetPlayerVehicleID(playerid), x + 1, y + 1, z);
}
else
{
SetPlayerInterior(playerid, GetPlayerInterior(ID));
SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(ID));
SetPlayerPos(playerid, x + 1, y + 1, z + 0.5);
}
format(str, sizeof(str), "{FFFF00}(/go) %s (%d) has teleported to you", getname(playerid), playerid);
SendClientMessage(tID, 0xFFFFFFFF, str);
return 1;
}