Engine wont turn off.
#1

When I turn the engine on using /engine, its work but when I want to turn it off using /engine too.. it's still on and display action "has turned the engine on" not even turn off..

pawn Код:
COMMAND:engine(playerid, params[])
{
    new xr = GetPlayerVehicleID(playerid);
    new car = GetPlayerNearestVehicle(playerid);
    new vehicleid = GetPlayerNearestVehicle(playerid);
    new engine,lights,alarm,doors,bonnet,boot,objective;
    new sender[MAX_STRING];
    //Vehicles[GetPlayerVehicleID(playerid)][carteam] != CIV
    if(PlayerTemp[playerid][hname]==1) myStrcpy(sender,"Stranger");
    else myStrcpy(sender,NameEx(playerid));
    if(IsPlayerInAnyVehicle(playerid) && Vehicles[xr][carmodel] == 481 && Vehicles[xr][carmodel] == 509) return SendClientError(playerid, "You are not in any vehicle, or there is no engine implented.");
    {
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientError(playerid, "You are not in any vehicle!");
        new State;
        State = GetPlayerState(playerid);
        if(State!=PLAYER_STATE_DRIVER)  return SendClientMessage(playerid,COLOR_GREY,"You are not the driver!");
        new stringa[MAX_STRING];
        new vid = GetPlayerVehicleID(playerid);
        if(Vehicles[GetPlayerVehicleID(playerid)][carteam] == CIV && strcmp(PlayerInfo[playerid][playerteam],Vehicles[GetPlayerVehicleID(playerid)][carteam],false) && strcmp(PlayerName(playerid),Vehicles[vehicleid][carowner],false) && strcmp(PlayerName(playerid),Vehicles[vehicleid][dupekey],false))
        {
            return SendClientError(playerid, "You don't have the authority to use this vehicle or you don't have the dupe keys!");
        }
        if(engine == 0)
        {
            SetVehicleParamsEx(vid, 1, lights, alarm, doors, bonnet, boot, objective);
            format(stringa,sizeof(stringa),"%s has turns on the engine of the %s.",sender,GetVehicleName(car));
            NearMessage(playerid,stringa,COLOR_ME2);
            TogglePlayerControllable(playerid, true);
        }
        else
        {
            SetVehicleParamsEx(vid, 0, lights, alarm, doors, bonnet, boot, objective);
            format(stringa,sizeof(stringa),"%s has turns off the engine of the %s.",sender,GetVehicleName(car));
            NearMessage(playerid,stringa,COLOR_ME2);
            TogglePlayerControllable(playerid, true);
        }
    }
    return 1;
}
Reply


Messages In This Thread
Engine wont turn off. - by jimdo - 14.08.2016, 03:19
Re: Engine wont turn off. - by X337 - 14.08.2016, 03:44
Re: Engine wont turn off. - by jimdo - 14.08.2016, 03:46
Re: Engine wont turn off. - by X337 - 14.08.2016, 03:51
Re: Engine wont turn off. - by jimdo - 14.08.2016, 04:26
Re: Engine wont turn off. - by Sew_Sumi - 14.08.2016, 04:29
Re: Engine wont turn off. - by jimdo - 14.08.2016, 04:35
Re: Engine wont turn off. - by WhiteGhost - 14.08.2016, 04:40
Re: Engine wont turn off. - by Sew_Sumi - 14.08.2016, 04:43

Forum Jump:


Users browsing this thread: 1 Guest(s)