Little Help
#7

Sorry, I was about to post my solution but SAMP forums decided to have a maintenance...
Here it is:
pawn Код:
public OnFilterScriptInit() //Or OnGameModeInit() if you're using a gamemode
{
    SetTimer("BobCheck", 1000, true);
    return 1;
}

forward BobCheck();
public BobCheck()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            for(new v = 0; v < MAX_VEHICLES; v++)
            {
                if(GetVehicleModel(v) == 422)
                {
                    if(UserStats[i][KeysBob] == 1) //If they have keys
                    {
                        SetVehicleParamsForPlayer(v, i, 0, 0); //Unlock Vehicle (Bobcat)
                    }
                    else
                    {
                        SetVehicleParamsForPlayer(v, i, 0, 1); //Lock Vehicle (Bobcat)
                    }
                }
            }
        }
    }
    return 1;
}
I also noticed you were trying to use vehicle == 422. I used to do this when I was new to scripting, this is probably where your script was screwing up. You need to use GetVehicleModel if you're trying to get the actual Model ID. Example: The Vehicle model for NRG is 522. The Vehicle model for Infernus is 411. However, vehicle model and vehicle ID are two different things. So in this case, you should have used if(GetVehicleModel(vehicleid) == 422)
Reply


Messages In This Thread
Little Help - by Sanady - 27.08.2012, 10:55
Re: Little Help - by clarencecuzz - 27.08.2012, 10:58
Re: Little Help - by Sanady - 27.08.2012, 11:16
Re: Little Help - by Sanady - 27.08.2012, 11:49
Re: Little Help - by Unte99 - 27.08.2012, 12:03
Re: Little Help - by Sanady - 27.08.2012, 12:09
Re: Little Help - by clarencecuzz - 28.08.2012, 11:51

Forum Jump:


Users browsing this thread: 2 Guest(s)