Huge problem. :\ :( -
I have this problem. I put the SetVehicleParamsEx under OnVehicleSpawn then everytime i enter the vehicle the params are still "1". I dont have idea where do i need to put it.
Код:
else if(strcmp(params, "engine", true) == 0 && IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new vehicle = GetPlayerVehicleID(playerid);
new string[126];
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if(Engine[vehicle] == 0)
{
Engine[vehicle] = 1;
SetVehicleParamsEx(vehicle,1,lights,alarm,doors,bonnet,boot,objective);
format(string, sizeof(string), "* %s turns the engine of their vehicle engine on.", GetPlayerNameEx(playerid));
ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
return 1;
}
else
{
Engine[vehicle] = 0;
SetVehicleParamsEx(vehicle,0,lights,alarm,doors,bonnet,boot,objective);
format(string, sizeof(string), "* %s turns the vehicles engine off.", GetPlayerNameEx(playerid));
ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
return 1;
}
}
return engine;
}
Код:
public OnVehicleSpawn(vehicleid) {
for(new i = 0; i < MAX_PLAYERS; i++)
{
new vehicle = GetPlayerVehicleID(i);
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
Engine[vehicle] = 0;
SetVehicleParamsEx(vehicle,0,lights,alarm,doors,bonnet,boot,objective);
}
Please help me. I really really need it