Teleport problem
#1

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?
Reply
#2

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.
Reply
#3

RemovePlayerFromVehicle(...);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)