little help nedded
#1

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
Reply


Messages In This Thread
little help nedded - by Gooday - 09.01.2012, 10:58

Forum Jump:


Users browsing this thread: 2 Guest(s)