[HELP] Engine bug - 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: [HELP] Engine bug (
/showthread.php?tid=220107)
[HELP] Engine bug -
01 - 03.02.2011
pawn Код:
else if(PRESSED(KEY_JUMP))
{
if(IsPlayerInAnyVehicle(playerid))
{
if(IsPlayerConnected(playerid))
{
if(!engineOn[GetPlayerVehicleID(playerid)])
{
new idcar = GetPlayerVehicleID(playerid);
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return 1;
if(pveh == 510 || pveh == 462 || pveh == 481 || pveh == 509) return 1;
if(IsARentableCar(idcar))
{
if(HireCar[playerid] != idcar) return 1;
}
if(IsAHarvest(idcar)) return 1;
if(IsADrugHarvest(idcar)) return 1;
if(IsASweeper(idcar)) return 1;
new plname[MAX_PLAYER_NAME];
GetPlayerName(playerid, plname, sizeof(plname));
format(string, sizeof(string), "* %s spins a key and tries to start vehicle engine.", plname);
ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
if(PlayerInfo[playerid][pAdmin] < 1337 && PlayerInfo[playerid][pAdminDuty] == 1)
{
SetTimerEx("StartingTheVehicle",1,0,"i",playerid);
}
else
{
SetTimerEx("StartingTheVehicle",3500,0,"i",playerid);
}
GameTextForPlayer(playerid, "~w~Starting vehicle engine...",3500,3);
gEngine[playerid] = 1;
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /engine",d,m,y,h,mi,s,plname);
CommandLog(string);
return 1;
}
}
}
The Engine didnt turn on in the rentablecar and some car..
pawn Код:
if(!strcmp(cmd, "/engine", true))
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInAnyVehicle(playerid))
{
if(!engineOn[GetPlayerVehicleID(playerid)])
{
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return 1;
if(pveh == 510 || pveh == 462 || pveh == 481 || pveh == 509) return 1;
if(IsARentableCar(idcar))
{
if(HireCar[playerid] != idcar) return 1;
}
if(IsAHarvest(idcar)) return 1;
if(IsADrugHarvest(idcar)) return 1;
if(IsASweeper(idcar)) return 1;
format(string, sizeof(string), "* %s spins a key and tries to start vehicle engine.", sendername);
ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
SetTimerEx("StartingTheVehicle",3500,0,"i",playerid);
GameTextForPlayer(playerid, "~w~Starting vehicle engine...",3500,3);
gEngine[playerid] = 1;
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /engine",d,m,y,h,mi,s,sendername);
CommandLog(string);
return 1;
}
else if(engineOn[GetPlayerVehicleID(playerid)])
{
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return 1;
if(pveh == 510 || pveh == 462 || pveh == 481 || pveh == 509) return 1;
if(IsARentableCar(idcar))
{
if(HireCar[playerid] != idcar) return 1;
}
if(IsAHarvest(idcar)) return 1;
if(IsADrugHarvest(idcar)) return 1;
if(IsASweeper(idcar)) return 1;
format(string, sizeof(string), "* %s spins a key and turns off the engine.", sendername);
ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
GameTextForPlayer(playerid, "~w~Engine Shat Down.",3500,3);
gEngine[playerid] = 0;
TogglePlayerControllable(playerid, 1);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /engine",d,m,y,h,mi,s,sendername);
CommandLog(string);
return 1;
}
}
}
return 1;
}
if /engine the engine always off
while key jump doesnt work sometimes
so can someone fix it when i type /engine the engine turn off or turn on
or while the pressed key jump turns off the engine or turn on the engine
Re: [HELP] Engine bug -
Steven Paul - 03.02.2011
show us your /rentcar script