Why Will This Teleport Not Work? (maybe paste the correct here)
#3

I see your using a generator judging by your indentation, here is how it should look.

Код:
  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 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.


Код:
  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;
	}
Hope that explains it.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)