Is this right?
#1

While re-vamping something in my script, I wind up putting this:
pawn Код:
for(new i = 0; i < sizeof(DynamicCars); i++)
    {
        if(DynamicCars[i][CarType] != 1)
        {
        SetVehicleParamsForPlayer(i, playerid, 1, 0);
        }
    }
But it's not working. But I'm also not getting any errors, is it even right?
Reply
#2

This looks fine. What do you want to make with this? To lock the car?
Reply
#3

Unlocking it. It won't unlock. I've turned it into this:

pawn Код:
for (new carid =0; carid<MAX_VEHICLES; carid++)
    {
   
    if(DynamicCars[carid][CarType] == 1)
    {
    SetVehicleParamsForPlayer(carid, playerid, 0, 0);
    SendClientMessage(playerid, COLOR_RED, "This works.");
    }
   
    }
I get the message three times (3 vehicles have type '1', so yeah that should be legit.) But they aren't unlocking.
Reply
#4

You dont need for if you are unlocking just that car.
Use this



if(DynamicCars[GetPlayerVehicleID(playerid)][CarType] == 1)
{
SetVehicleParamsForPlayer(GetPlayerVehicleID(playe rid),playerid,0,1);
}
Reply
#5

1) It's unlocking /THREE/ cars of the same TYPE.

2) The player is not in a vehicle during the time this is processed.
Reply
#6

Yep, that should work.
Reply
#7

Bro where do you put this code. In onplayerentervehicle on onplayerstatechange?
Reply
#8

Inside of a command, actually.
Reply
#9

Man put the command here.
Reply
#10

Nevermind it. Found a way to bypass it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)