22.08.2013, 22:00
So I've got a dynamic vehicle system but I wanna know how I'd make it send just one message and not ALL 3?
For example, this is my OnPlayerEnterVehicle:
This will spam the chat and I don't know how to send it each individually.
For example:
the command is /createvehicle [job] [faction]
So it's detecting whether the players enum equals the vehicles.
So say if it's a faction vehicle, the job would be set to 0.
How would I make it, if the players faction equals the vehicles faction but doesn't equal the vehicles job enum, it'll still let him in the vehicle.
For example, this is my OnPlayerEnterVehicle:
pawn Код:
for(new i = 0; i < MAX_SERVER_VEHICLES; i++)
{
if(VehicleInfo[i][svJob] != PlayerInfo[playerid][pJob] || VehicleInfo[i][svFaction] != PlayerInfo[playerid][pFaction])
{
SendClientMessage(playerid, COLOR_RED, "Error:"COL_WHITE" You don't have the keys for this vehicle.");
RemovePlayerFromVehicle(playerid);
}
if(VehicleInfo[i][svJob] != PlayerInfo[playerid][pJob] || VehicleInfo[i][svFaction] == PlayerInfo[playerid][pFaction])
{
SendClientMessage(playerid, COLOR_RED, "Error:"COL_WHITE" You don't have the keys for this vehicle.");
RemovePlayerFromVehicle(playerid);
}
if(VehicleInfo[i][svJob] == PlayerInfo[playerid][pJob] || VehicleInfo[i][svFaction] != PlayerInfo[playerid][pFaction])
{
SendClientMessage(playerid, COLOR_RED, "Error:"COL_WHITE" You don't have the keys for this vehicle.");
RemovePlayerFromVehicle(playerid);
}
}
For example:
the command is /createvehicle [job] [faction]
So it's detecting whether the players enum equals the vehicles.
So say if it's a faction vehicle, the job would be set to 0.
How would I make it, if the players faction equals the vehicles faction but doesn't equal the vehicles job enum, it'll still let him in the vehicle.


