17.05.2011, 17:29
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:
and in OnPlayerEnterVehicle:
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:
But i dont know what else to write.
Thank you.
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
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;
}
The problem is in this line:
pawn Код:
if(vehicleid == mechanicvehicles[playerid])
Thank you.