27.02.2010, 14:51
Hey there i have coded a command were if a player types "/teleport [DESTINATION]" it teleports them to that destination but its always returning the first if statement no matter what you type heres the command :
Код:
CMD:teleport(playerid, params[])
{
new TeleportLocation[50];
if (sscanf(params, "z", TeleportLocation)) SendClientMessage(playerid, CommandError, "Usage: /teleport [LocationID/Name]");
else
{
if(strcmp(TeleportLocation, "help",true) || strcmp(TeleportLocation, "00",true))
{
SendClientMessage(playerid, CommandError, ".:: Using /teleport ::.");
SendClientMessage(playerid, CommandSuccess, "To use the /teleport command you must have the Name/ID of the place you want to teleport to.");
SendClientMessage(playerid, CommandSuccess, "To obtain a list of destination names and id's type /teleport names.");
}
else if(strcmp(TeleportLocation, "names", true) || strcmp(TeleportLocation, "01", true))
{
SendClientMessage(playerid, CommandError, ".:: Destination names and ID's ::.");
SendClientMessage(playerid, CommandSuccess, "SF Airport (Planes) [Name: fly] [ID: 02]");
}
else if(strcmp(TeleportLocation, "fly", true) || strcmp(TeleportLocation, "02", true))
{
if(GetPlayerState(playerid) == 2)
{
SetVehiclePos(GetPlayerVehicleID(playerid),-1891.1072,-733.9356,347.8068);
} else SetPlayerPos(playerid, -1891.1072,-733.9356,347.8068);
}
}
return 1;
}


, I changed the 'true' to a 'false' and still ended up with the same outcome.