Can some correct this for me? - 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: Can some correct this for me? (
/showthread.php?tid=186825)
Can some correct this for me? -
Luis- - 30.10.2010
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if (IsPlayerInAnyVehicle(playerid))
{
if (Engine[vehicleid] == 0)
TogglePlayerControllable(playerid, 0);
GameTextForPlayer(playerid, "Please type ~r~/eon~r~ to turn the Vehicles Engine on", 4, 3000);
}
return 1;
}
When I enter the a vehicle it does not freeze me or send the game text?
Re : Can some correct this for me? -
admantis - 30.10.2010
Quote:
Originally Posted by -Luis
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { if (IsPlayerInAnyVehicle(playerid)) { if (Engine[vehicleid] == 0) TogglePlayerControllable(playerid, 0); GameTextForPlayer(playerid, "Please type ~r~/eon~r~ to turn the Vehicles Engine on", 3000, 4); } return 1; }
When I enter the a vehicle it does not freeze me or send the game text?
|
dont use OnPlayerEnterVehicle
pawn Код:
public OnPlayerStateChange(playerid,newstate,oldstate)
{
if (newstate == PLAYER_STATE_DRIVER && oldstate == PLAYER_STATE_ONFOOT)
{
if (Engine[vehicleid] == 0)
{
TogglePlayerControllable(playerid, 0);
GameTextForPlayer(playerid, "Please type ~r~/eon~r~ to turn the Vehicles Engine on", 4, 3000);
}
else if(Engine[vehicleid] == 1) return SendClientMessage(playerid,color,"The engine is on you can drive");
}
}
return 1;
}
By the way, on GameTextForPlayer you inverse the numbers, 3000 is the time, not the style.