06.04.2009, 21:50
I see your using a generator judging by your indentation, here is how it should look.
If hes on foot it teleports him, if hes in a vehicle it teleports him nd vehicle, if you want it so you can ONLY teleport in a vehilce, set it up like this.
Hope that explains it.
Код:
if(strcmp(cmdtext,"/dive3",true)==0) { new vehicleid = GetPlayerVehicleID(playerid); new State = GetPlayerState(playerid); if(IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER) { GameTextForPlayer(playerid, "~w~Dive Jump ~G~3", 5000, 5); return SetVehiclePos(vehicleid,2064.3633,2442.2717,165.6172); } SetPlayerPos(playerid,2064.3633,2442.2717,165.6172); GameTextForPlayer(playerid, "~w~Dive Jump ~G~3", 5000, 5); return 1; }
Код:
if(strcmp(cmdtext,"/skroad",true)==0) { new vehicleid = GetPlayerVehicleID(playerid); new State = GetPlayerState(playerid); if(IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER) { GameTextForPlayer(playerid, "SKROAD", 5000, 5); return SetVehiclePos(vehicleid,3893.8152, -1623.4252, 1442.5); } GameTextForPlayer(playerid, "You are not in a vehicle!", 5000, 5); return 1; }