SA-MP Forums Archive
Teleport problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Teleport problem (/showthread.php?tid=127755)



Teleport problem - yoan103 - 14.02.2010

Hi guys i have this script
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/test", cmdtext, true, 5) == 0)
	{
	if (IsPlayerInAnyVehicle(playerid)) {
	SetVehiclePos(GetPlayerVehicleID(playerid), 242.5267, 5267.5267, 6178.6327);
	new pname[MAX_PLAYER_NAME], string[22 + MAX_PLAYER_NAME];
  GetPlayerName(playerid, pname, sizeof(pname));
  format(string, sizeof(string), "%s has gone to /test.", pname);
  SendClientMessageToAll(COLOR_GREEN, string);
	}
	return 1;
	}
It works fine but i can't seem to teleport without a vehicle, why?


Re: Teleport problem - Correlli - 14.02.2010

Quote:
Originally Posted by yoan103
It works fine but i can't seem to teleport without a vehicle, why?
It's obvious, because you have a IsPlayerInAnyVehicle check and you don't have any code for the player who isn't in the vehicle.


Re: Teleport problem - trindade02 - 14.02.2010

RemovePlayerFromVehicle(...);