Hazard Warning via SetVehicleParamsEx
#2

try this
pawn Код:
#include <a_samp>

new timer1;
new bool:Swiatla[MAX_PLAYERS];
new engine,lights,alarm,doors,bonnet,boot,objective;

forward ToggleSwiatla(playerid);

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Blank Filterscript by your name here");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[]){
    if (strcmp("/awaryjne", cmdtext, true, 10) == 0)return timer1 = SetTimerEx("ToggleSwiatla", 1000, 1, "i", playerid);
    if (strcmp("/awaryjne-off", cmdtext, true, 10) == 0)return KillTimer(timer1);
    return 0;
}

public ToggleSwiatla(playerid){
    switch(Swiatla[playerid]){
        case true:{
            SwiatlaOFF(playerid);
            Swiatla[playerid] = false;
        }
        case false:{
            SwiatlaON(playerid);
            Swiatla[playerid] = true;
        }
    }


}

stock SwiatlaON(playerid){
   new veh = GetPlayerVehicleID(playerid);
   GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
   SetVehicleParamsEx(veh,engine,VEHICLE_PARAMS_ON,alarm,doors,bonnet,boot,objective);
   GivePlayerMoney(playerid,4000);
   return 1;
}

stock SwiatlaOFF(playerid){
   new veh = GetPlayerVehicleID(playerid);
   GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
   SetVehicleParamsEx(veh,engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
   GivePlayerMoney(playerid,5000);
   return 1;
}
Reply


Messages In This Thread
Hazard Warning via SetVehicleParamsEx - by Gama101 - 23.02.2011, 08:41
Re: Hazard Warning via SetVehicleParamsEx - by (SF)Noobanatior - 23.02.2011, 09:33
Re: Hazard Warning via SetVehicleParamsEx - by Gama101 - 23.02.2011, 09:51
Re: Hazard Warning via SetVehicleParamsEx - by (SF)Noobanatior - 24.02.2011, 02:50
Re: Hazard Warning via SetVehicleParamsEx - by Gama101 - 24.02.2011, 13:09

Forum Jump:


Users browsing this thread: 2 Guest(s)