Fast array question
#1

Hey guys.
Just a fast question on arrays.
I added 4 vehicles, that only some people can use (People who has mechanic job).
I added the vehicles like this:
pawn Код:
new mechanicvehicles[4]; // Because there are 4 vehicles
and in OnPlayerEnterVehicle:
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    if(PlayerInfo[playerid][pJob] != 1)
    {
        if(vehicleid == mechanicvehicles[playerid])
        {
            SetPlayerPos(playerid, x, y, z);
            SendClientMessage(playerid, COLOR_NORMALRED, "( ! ) Only Mechanics can use This Vehicle");
        }
    }
    return 1;
}
But this only ejects the player from one of the vehicles. I want it to happend on all 4 vehicles.
The problem is in this line:
pawn Код:
if(vehicleid == mechanicvehicles[playerid])
But i dont know what else to write.

Thank you.
Reply


Messages In This Thread
Fast array question - by sim_sima - 17.05.2011, 17:29
Re: Fast array question - by sim_sima - 17.05.2011, 17:33
Re: Fast array question - by Wesley221 - 17.05.2011, 17:40
Re: Fast array question - by sim_sima - 17.05.2011, 17:42
Re: Fast array question - by Dreftas - 17.05.2011, 17:43
Re: Fast array question - by Vince - 17.05.2011, 17:46
Re: Fast array question - by sim_sima - 17.05.2011, 17:47

Forum Jump:


Users browsing this thread: 1 Guest(s)