Engine - 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: Engine (
/showthread.php?tid=95512)
Engine -
Hot - 03.09.2009
I have these scripts:
Engine:
Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new VID = GetPlayerVehicleID(playerid);
new MOD = GetVehicleModel(playerid);
new string[128];
if(newstate == PLAYER_STATE_DRIVER)
{
format(string, sizeof(string), "~g~%s",VehicleTittle[GetVehicleModel(VID)-400]);
GameTextForPlayer(playerid,string,3500,1);
if(VehicleStarted[VID] == 0 && MOD != 510 && MOD != 509 && MOD != 481)
{
TogglePlayerControllable(playerid,0);
SendClientMessage(playerid,WHITE,"* This Vehicle is not Started yet. You can start it with key: 'TAB'");
}
else
{
SendClientMessage(playerid,YELLOW,"* This Vehicle is already started!");
}
if(VehicleGas[VID] < 1)
{
SendClientMessage(playerid,WHITE,"* No fuel in Vehicle!");
}
}
return 1;
}
Код:
public FuelUpdate()
{
new string[256];
for(new i=0;i<MAX_PLAYERS;i++)
{
new VID = GetPlayerVehicleID(i);
new MOD = GetVehicleModel(i);
if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
{
if(IsPlayerConnected(i))
{
if(Filling[i] == 0 && VehicleStarted[VID] == 1 && MOD != 510 && MOD != 509 && MOD != 481)
{
if(VehicleGas[VID] >= 1)
{
VehicleGas[VID] -= 1;
format(string, sizeof(string),"~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~~l~~p~FUEL: ~w~%d%",VehicleGas[VID]);
GameTextForPlayer(i,string,11500,3);
}
else
{
TogglePlayerControllable(i,0);
GameTextForPlayer(i,"~n~~n~~n~~n~~b~Your car is without fuel!",2500,3);
SendClientMessage(i,WHITE,"* Your Vehicle is without Gas! Use '/exit' to get out.");
}
}
}
}
}
return 1;
}
But Gas and Fuel Update keep showing for bikes, what's wrong?
Re: Engine -
Hot - 04.09.2009
Help?
Re: Engine -
Imran.Abbas - 04.09.2009
idk Well.. Check this
Код:
if(VehicleStarted[VID] == 0 && MOD != 510 && MOD != 509 && MOD != 481)
Change car ids
Re: Engine -
Hot - 04.09.2009
Already checked, idk why this problem keep happening! Help please!
sorry bad english.