19.04.2014, 20:53
Hello
How do i add when player enter theirs vehicle and if Engine[Vehicle] is 0 it will Send an message like this "Your vehicle engine is not ON"
How do i add when player enter theirs vehicle and if Engine[Vehicle] is 0 it will Send an message like this "Your vehicle engine is not ON"
Код:
else if(strcmp(params, "engine", true) == 0 && IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid == PLAYER_STATE_DRIVER))
{
new enstring[128];
new Vehicle = GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective;
if(Engine[Vehicle] == 1)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
format(enstring, sizeof(enstring), "* %s re-twisted the key and STOPPED the car engine", GetPlayerNameEx(playerid));
ProxDetector(25.0, playerid, enstring, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GetVehicleParamsEx(Vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
SendClientMessage(playerid, COLOR_YELLOW, "You have turned your engine >{FFFFFF} ON");
Engine[Vehicle] = 1, SetVehicleParamsEx(Vehicle, 1, lights, alarm, doors, bonnet, boot, objective);
}
}
else if(Engine[Vehicle] == 0)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
format(enstring, sizeof(enstring), "* %s twisted the key and START the car engine", GetPlayerNameEx(playerid));
ProxDetector(25.0, playerid, enstring, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GetVehicleParamsEx(Vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
SendClientMessage(playerid, COLOR_YELLOW, "You have turned your engine >{FFFFFF} OFF");
Engine[Vehicle] = 0, SetVehicleParamsEx(Vehicle, 0, lights, alarm, doors, bonnet, boot, objective);
}
}
}
return 1;
}


