07.08.2013, 11:57
Hello, how to make when i say /ls to teleport me to ls and other tps.
new Float:GalsTeleport[6][7] =
{
{1971.9337,-2296.6978,13.5469,83.7772},
{1965.8896,-2320.8816,13.5469,83.7772},
{1955.5322,-2342.9412,13.5469,10.1432},
{1913.7225,-2335.3032,13.5469,261.7289},
{1915.0986,-2291.8071,13.5469,261.7289},
{1921.5833,-2273.5156,13.5469,261.7289}
};
CMD:ls(playerid,params[])
{
new rand = random(sizeof(GalsTeleport));
new cartype = GetPlayerVehicleID(playerid);
new State = GetPlayerState(playerid);
if(State!=PLAYER_STATE_DRIVER)
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,GalsTeleport[rand][0],GalsTeleport[rand][1],GalsTeleport[rand][2]+0.40);
SetPlayerFacingAngle(playerid,GalsTeleport[rand][3]);
SetVehicleZAngle(cartype,GalsTeleport[rand][3]);
GameTextForPlayer(playerid,"~y~Gals Airport!",5000,3);
}
else if(IsPlayerInVehicle(playerid,cartype)== 1)
{
SetVehiclePos(cartype,GalsTeleport[rand][0],GalsTeleport[rand][1],GalsTeleport[rand][2]+0.40);
SetVehicleZAngle(cartype,GalsTeleport[rand][3]);
SetPlayerInterior(playerid,0);
GameTextForPlayer(playerid,"~y~Gals Airport!",5000,3);
}
else
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,GalsTeleport[rand][0],GalsTeleport[rand][1],GalsTeleport[rand][2]+0.40);
SetPlayerFacingAngle(playerid,GalsTeleport[rand][3]);
}
return 1;
}