16.09.2012, 15:15
Ok, i will use atltsmax' script as an example.
new PickedClass[MAX_PLAYERS]; (here, it checks if its in a class)
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) (here it makes the server check that the player has entered a vehicle)
{
* * if(PickedClass != AGENT && GetVehicleModel(vehicleid) == hydra id here) (here it checks if the player is with the correct class to use the vehicle (on where is says "hydra id here" you place the id of the vehicle the player is supposed to use))
* * {
* * * * ClearAnimations(playerid); (and here if the player dont completes with the requirements to use the vehicles, gets ejected from it)
* * * * SendClientMessage(playerid, -1, "[*]: You should be Agent in order to drive hydra!"); (and finally here, sends a message to the player saying him which class he has to be to use that vehicle)
* * }
return 1; (at the end, it shows to the server that is a valid action, and to make it work on your server)
}
Hopw i helped you, if I did give me rep
new PickedClass[MAX_PLAYERS]; (here, it checks if its in a class)
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) (here it makes the server check that the player has entered a vehicle)
{
* * if(PickedClass != AGENT && GetVehicleModel(vehicleid) == hydra id here) (here it checks if the player is with the correct class to use the vehicle (on where is says "hydra id here" you place the id of the vehicle the player is supposed to use))
* * {
* * * * ClearAnimations(playerid); (and here if the player dont completes with the requirements to use the vehicles, gets ejected from it)
* * * * SendClientMessage(playerid, -1, "[*]: You should be Agent in order to drive hydra!"); (and finally here, sends a message to the player saying him which class he has to be to use that vehicle)
* * }
return 1; (at the end, it shows to the server that is a valid action, and to make it work on your server)
}
Hopw i helped you, if I did give me rep