Quote:
Originally Posted by Kindred
Example:
pawn Код:
AdminVehicles[4]; //This is a global variable
AdminVehicles[0] = AddStaticVehicle(522,217.8630,1854.9401,12.4834,0.6474,151,0); // nrg area51 AdminVehicles[1] = AddStaticVehicle(470,213.7728,1854.6956,12.9258,1.8452,43,0); // patriot area51 AdminVehicles[2] = AddStaticVehicle(447,225.8707,1887.0684,17.6522,1.7829,75,2); // seasparrow area51 AdminVehicles[3] = AddStaticVehicle(495,221.9560,1854.6931,13.2558,359.1743,151,0); // sandking area51
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { for(new i = 0; i < 4; i++) { if(vehicleid == AdminVehicles[i]) { //If the vehicle is an admin vehicle, do something here to check if the player is admin } } return 1; }
I suggest searching first
|
err... This only check it when the player enters the vehicle..
If you want it only for admins, I would suggest using OnPlayerStateChange to check when they are inside a vehicle, to remove them if they are not admin..
EDIT: for your error, replace the
pawn Код:
AdminVehicles[4]; //This is a global variable
that Kindred wrote, with
pawn Код:
new AdminVehicles[4]; //This is a global variable