02.08.2018, 17:28
MAX_PLAYERS used in defining variables with an array contains the max ID's of players.
MAX_VEHICLES used in defining variables with an array contains the max ID's of vehicles.
MAX_VEHICLES used in defining variables with an array contains the max ID's of vehicles.
PHP код:
new Banned[MAX_PLAYERS]; // Variable for players only
new Locked[MAX_VEHICLES]; // Variable for vehicles only
public OnPlayerConnect(playerid) //playerid is the player who joined now.
{
if(Banned[playerid] == 1)
{
SendClientMessage(playerid, -1, "You are banned !");
Kick(playerid);
return 1;
}
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(Locked[vehicleid] == 1) // the vehicleid is the same vehicleid parameter of OnPlayerEnterVehicle Callback.
{
SendClientMessage(playerid, -1, "This Vehicle is locked.");
ClearAnimations(playerid); // Clears the player's animation (stopping him from entering this vehicle)
return 1;
}
return 1;
}