28.01.2012, 20:52
Hey,
For some reason this doesn't work:
Haven't really learned strcmp well but it TPs me to the same locations. Any idea?
For some reason this doesn't work:
pawn Код:
CMD:drift(playerid, params[])
{
// if(sscanf(params, "d")) return SCM(playerid, -1, ""COL_RED"Usage:"COL_GREY" /drift "COL_ORANGE"[1 - 53]");
if(isnull(params)) return SCM(playerid, -1, ""COL_RED"Usage:"COL_GREY" /drift "COL_ORANGE"[1 - 5]");
if(strcmp("1", params))
{
if(IsPlayerInAnyVehicle(playerid))
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SetVehiclePos(GetPlayerVehicleID(playerid),-358.1943,1531.2909,75.1698);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 264.7289);
SetCameraBehindPlayer(playerid);
}
else return SCM(playerid, -1, ""COL_RED"Error:"COL_GREY" You must be the driver of the vehicle.");
}
else
{
SetPlayerPos(playerid,-358.1943,1531.2909,75.1698);
SetPlayerFacingAngle(playerid, 264.7289);
SetCameraBehindPlayer(playerid);
}
}
if(strcmp(params, "2"))
{
if(IsPlayerInAnyVehicle(playerid))
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SetVehiclePos(GetPlayerVehicleID(playerid), 2265.3010,1399.5085,42.8203);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 269.7637);
SetCameraBehindPlayer(playerid);
}
else return SCM(playerid, -1, ""COL_RED"Error:"COL_GREY" You must be the driver of the vehicle.");
}
else
{
SetPlayerPos(playerid,2265.3010,1399.5085,42.8203);
SetPlayerFacingAngle(playerid, 269.7637);
SetCameraBehindPlayer(playerid);
}
}
if(strcmp(params, "3"))
{
if(IsPlayerInAnyVehicle(playerid))
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SetVehiclePos(GetPlayerVehicleID(playerid), -2489.8352,-616.3492,132.5658);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 178.7448);
SetCameraBehindPlayer(playerid);
}
else return SCM(playerid, -1, ""COL_RED"Error:"COL_GREY" You must be the driver of the vehicle.");
}
else
{
SetPlayerPos(playerid, -2489.8352, -616.3492, 132.5659);
SetPlayerFacingAngle(playerid, 178.7448);
SetCameraBehindPlayer(playerid);
}
}
if(strcmp(params, "4"))
{
if(IsPlayerInAnyVehicle(playerid))
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SetVehiclePos(GetPlayerVehicleID(playerid), 2243.2185,1963.3853,31.7797);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 178.7448);
SetCameraBehindPlayer(playerid);
}
else return SCM(playerid, -1, ""COL_RED"Error:"COL_GREY" You must be the driver of the vehicle.");
}
else
{
SetPlayerPos(playerid, 2243.2185, 1963.3853, 31.7797);
SetPlayerFacingAngle(playerid, 178.7448);
SetCameraBehindPlayer(playerid);
}
}
if(strcmp(params, "5"))
{
if(IsPlayerInAnyVehicle(playerid))
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SetVehiclePos(GetPlayerVehicleID(playerid), 1146.2200,2178.7068,10.8203);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 178.7448);
SetCameraBehindPlayer(playerid);
}
else return SCM(playerid, -1, ""COL_RED"Error:"COL_GREY" You must be the driver of the vehicle.");
}
else
{
SetPlayerPos(playerid, 1146.2200, 2178.7068, 10.8203);
SetPlayerFacingAngle(playerid, 178.7448);
SetCameraBehindPlayer(playerid);
}
}
return 1;
}