SA-MP Forums Archive
little help nedded - 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: little help nedded (/showthread.php?tid=309820)



little help nedded - Gooday - 09.01.2012

Hi, Babul gave me this script wich you can add a lightbar by pressign "H" but:

When i exit the car it automatically is removed and ALL can use the commands so:

How i can dont remove when i exit a car so let continue until someone type "H" again...?

pawn Код:
forward OnPlayerKeyStateChange(playerid, newkeys, oldkeys);public OnPlayerKeyStateChange(playerid, newkeys, oldkeys){
    if((newkeys & KEY_CROUCH) && !(oldkeys & KEY_CROUCH))
    {
        if(GetPlayerState(playerid)==PLAYER_STATE_DRIVER)
        {
            return cmd_lights(playerid);
        }
    }
pawn Код:
forward OnPlayerStateChange(playerid,newstate,oldstate);public OnPlayerStateChange(playerid,newstate,oldstate){
    if(newstate == PLAYER_STATE_ONFOOT)
    {
        GameTextForAll("dfghsdgflksdhfkshdf",10000,4);
        if(GetPVarInt(playerid,"Lights")>0)
        {
            SetPVarInt(playerid,"Lights",0);
            if(IsValidObject(GetPVarInt(playerid,"Siren1")))
            {
                DestroyObject(GetPVarInt(playerid,"Siren1"));
            }
            if(IsValidObject(GetPVarInt(playerid,"Siren2")))
            {
                DestroyObject(GetPVarInt(playerid,"Siren2"));
            }
        }
    }
    return 1;
}
+REP! I NEED THIS