What is MAX_PLAYERS and MAX_VEHICLES?
#2

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.

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(playeridvehicleidispassenger)
{
    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;

Reply


Messages In This Thread
What is MAX_PLAYERS and MAX_VEHICLES? - by R3SpaWn0 - 02.08.2018, 14:48
Re: What is MAX_PLAYERS and MAX_VEHICLES? - by Juvanii - 02.08.2018, 17:28
Re: What is MAX_PLAYERS and MAX_VEHICLES? - by Dayrion - 02.08.2018, 17:38
Re: What is MAX_PLAYERS and MAX_VEHICLES? - by R3SpaWn0 - 02.08.2018, 19:17
Re: What is MAX_PLAYERS and MAX_VEHICLES? - by ISmokezU - 02.08.2018, 22:21
Re: What is MAX_PLAYERS and MAX_VEHICLES? - by Unkovic - 02.08.2018, 22:39
Re: What is MAX_PLAYERS and MAX_VEHICLES? - by GRiMMREAPER - 02.08.2018, 23:08
Re: What is MAX_PLAYERS and MAX_VEHICLES? - by Dayrion - 03.08.2018, 07:05
Re: What is MAX_PLAYERS and MAX_VEHICLES? - by DBZdabIt3Bro7 - 03.08.2018, 17:07

Forum Jump:


Users browsing this thread: 1 Guest(s)