SA-MP Forums Archive
big cars problem ! - 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)
+--- Thread: big cars problem ! (/showthread.php?tid=563033)



big cars problem ! - simo0000 - 13.02.2015

hello guys
i'm scripting my own mysql RP script and i got a big problem
when i turn car engine and i press forward key the game freeze andcan't exit game
i delete all my gta mods , i tested other RP mysql GM and it works perfect but in my gm still the same problem , someone can help me?

sorry for my bad english
thanks
best regards


Re: big cars problem ! - GGRoleplay - 13.02.2015

Show the code for turning on the engine.


Re: big cars problem ! - simo0000 - 13.02.2015

Quote:
Originally Posted by GGRoleplay
Посмотреть сообщение
Show the code for turning on the engine.
pawn Код:
CMD:v(playerid, params[])
{
new veh = GetPlayerVehicleID(playerid);
new engine,lights,alarm,doors,bonnet,boot,objective;
new choice[32];
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFF2C30FF, "You are not inside any vehicle!");
if(sscanf(params, "s[32]", choice))
{
SendClientMessage(playerid, 0x2BA2FFFF , "USAGE: /v [Name]");
SendClientMessage(playerid, 0x2BA2FFFF , "Available names: Engine | Lights | Hood | Trunk ");
return 1;
}
if (strcmp(choice, "Engine", true) == 0)
{
    if(GetPVarInt(playerid, "Engine") == 0)
        {
                GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
                SetVehicleParamsEx(veh,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                SetPVarInt(playerid, "Engine", 1);
                SendClientMessage(playerid, 0xF1FF00FF, "Engine started!");
        }
    else if(GetPVarInt(playerid, "Engine") == 1)
        {
                GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
                SetVehicleParamsEx(veh,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
                SetPVarInt(playerid, "Engine", 0);
                SendClientMessage(playerid, 0xF1FF00FF, "Engine stopped!");
        }
}

if (strcmp(choice, "Lights", true) == 0)
{
    if(GetPVarInt(playerid, "Lights") == 0)
        {
                if(GetPVarInt(playerid, "Engine") == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "You must turn on the engine first!");
                GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
                SetVehicleParamsEx(veh,engine,VEHICLE_PARAMS_ON,alarm,doors,bonnet,boot,objective);
                SetPVarInt(playerid, "Lights", 1);
                SendClientMessage(playerid, 0xF1FF00FF, "Lights have been turned on!");
        }
    else if(GetPVarInt(playerid, "Lights") == 1)
        {
                GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
                SetVehicleParamsEx(veh,engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
                SetPVarInt(playerid, "Lights", 0);
                SendClientMessage(playerid, 0xF1FF00FF, "Lights have been turned off!");
        }
}

if (strcmp(choice, "Hood", true) == 0)
{
    if(GetPVarInt(playerid, "Bonnet") == 0)
        {
                GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
                SetVehicleParamsEx(veh,engine,lights,alarm,doors,VEHICLE_PARAMS_ON,boot,objective);
                SetPVarInt(playerid, "Bonnet", 1);
                SendClientMessage(playerid, 0xF1FF00FF, "Your car hood has been opened!");
        }
    else if(GetPVarInt(playerid, "Bonnet") == 1)
        {
                GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
                SetVehicleParamsEx(veh,engine,lights,alarm,doors,VEHICLE_PARAMS_OFF,boot,objective);
                SetPVarInt(playerid, "Bonnet", 0);
                SendClientMessage(playerid, 0xF1FF00FF, "Your car hood has been closed!");
        }
}


if (strcmp(choice, "Trunk", true) == 0)
{
    if(GetPVarInt(playerid, "Boot") == 0)
        {
        GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
        SetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,VEHICLE_PARAMS_ON,objective);
        SetPVarInt(playerid, "Boot", 1);
        SendClientMessage(playerid, 0xF1FF00FF, "Your car trunk has been opened!");
        }
    else if(GetPVarInt(playerid, "Boot") == 1)
        {
        GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
        SetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,VEHICLE_PARAMS_OFF,objective);
        SetPVarInt(playerid, "Boot", 0);
        SendClientMessage(playerid, 0xF1FF00FF, "Your car trunk has been closed!");
        }
}
return 1;
}



Re: big cars problem ! - GGRoleplay - 13.02.2015

Try and change VEHICLE_PARAMS_ON to 1 and VEHICLE_PARAMS_OFF to 0, and see if that helped.


Re: big cars problem ! - GGRoleplay - 13.02.2015

If that didn't work, put the GetVehicleParamsEx outside of the if(strcmp(choice etc.. and use instead of GetPVarInt if(engine == 1)


GGRoleplay - simo0000 - 13.02.2015

Quote:
Originally Posted by GGRoleplay
Посмотреть сообщение
Try and change VEHICLE_PARAMS_ON to 1 and VEHICLE_PARAMS_OFF to 0, and see if that helped.
still same problem
plz help

Quote:
Originally Posted by GGRoleplay
Посмотреть сообщение
If that didn't work, put the GetVehicleParamsEx outside of the if(strcmp(choice etc.. and use instead of GetPVarInt if(engine == 1)
same problem


Re: big cars problem ! - GGRoleplay - 13.02.2015

Maybe someone else knows a fix for it, I have the same as in my script my last method and it works fine.


Re: big cars problem ! - simo0000 - 13.02.2015

but the big problem it is i remove the engine command and i remove ManualVehicleEngineAndLights(); from OnGameModeInit()
and i test it and still the same when i move the game freeze


Re: big cars problem ! - Crayder - 13.02.2015

GGRoleplay, simo0000; you guys are true double posters.

I am pretty sure this has nothing to do with your script. Re-install GTA.


Re: big cars problem ! - simo0000 - 13.02.2015

Quote:
Originally Posted by Crayder
Посмотреть сообщение
GGRoleplay, simo0000; you guys are true double posters.

I am pretty sure this has nothing to do with your script. Re-install GTA.
i re-install GTA and the same problem help me plz