13.01.2011, 11:54
Sup people.
I've got a very strange problem whilst scripting a gamemode, every command works whilst on foot, but when I enter a vehicle, teleport commands stop working. Even tough, commands like /rules and /help works in a vehicle also..I tried to move around and tweak the IsPlayerInVehicle checks in a teleport, but I still get UNKNOWN COMMAND error while typing a teleport inside a vehicle.
I've added these variables just right under OnPlayerCommandText:
And here is an example of a teleport:
I've got a very strange problem whilst scripting a gamemode, every command works whilst on foot, but when I enter a vehicle, teleport commands stop working. Even tough, commands like /rules and /help works in a vehicle also..I tried to move around and tweak the IsPlayerInVehicle checks in a teleport, but I still get UNKNOWN COMMAND error while typing a teleport inside a vehicle.
I've added these variables just right under OnPlayerCommandText:
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { new vehicleid = GetPlayerVehicleID(playerid); new State = GetPlayerState(playerid);
Код:
if (strcmp("/lv", cmdtext, true, 10) == 0) { SetPlayerInterior(playerid, 0); if(IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER) { GameTextForPlayer(playerid,"Las Venturas",4000,6); return SetVehiclePos(vehicleid,2039.5549,1625.7263,10.6719); } SetPlayerPos(playerid,2039.5549,1625.7263,10.6719); GameTextForPlayer(playerid,"Las Venturas",4000,6); return 1; }