If the player does not have enough scoure Prevent him from ride Hydra , tank or ....
#10

Quote:
Originally Posted by karemmahmed22
Посмотреть сообщение
Under includes:-
You can edit values (scores).
ex: #define PLAYER_LEVEL1 50 instead of #define PLAYER_LEVEL1 10
PHP код:
#define PLAYER_LEVEL1 10 
#define PLAYER_LEVEL2 20
#define PLAYER_LEVEL3 50
#define PLAYER_LEVEL4 70
#define PLAYER_LEVEL5 100 
OnPlayerStateChange:-
PHP код:
    if(newstate == PLAYER_STATE_DRIVER)
    {
    
        new 
pIscore;
        new 
vehicleid;
        
vehicleid GetPlayerVehicleID(playerid);
        
pIscore GetPlayerScore(playerid);
        if (
GetVehicleModel(vehicleid) == 476 && pIscore PLAYER_LEVEL1//  Rustler
        
{
            
SendClientMessage(playerid,-1,"Your level is not high enough to drive this vehicle, please kill others to gain score!");
            
RemovePlayerFromVehicle(playerid);
        }
        
        else if(
GetVehicleModel(vehicleid) == 447 && pIscore PLAYER_LEVEL2//Seasparrow
        
{
            
            
SendClientMessage(playerid,-1,"Your level is not high enough to drive this vehicle, please kill others to gain score!");
            
RemovePlayerFromVehicle(playerid);
        }
        
        else if(
GetVehicleModel(vehicleid) == 593 && pIscore PLAYER_LEVEL3//Dodo
            
        
{
            
            
RemovePlayerFromVehicle(playerid);
            
SendClientMessage(playerid,-1,"Your level is not high enough to drive this vehicle, please kill others to gain score!");
        }
        
        else if(
GetVehicleModel(vehicleid) == 425 && pIscore PLAYER_LEVEL4//Hunter
            
        
{
            
RemovePlayerFromVehicle(playerid);
            
SendClientMessage(playerid,-1,"Your level is not high enough to drive this vehicle, please kill others to gain score!");
        }
        
        else if(
GetVehicleModel(vehicleid) == 520 && pIscore PLAYER_LEVEL5//Hydra
            
        
{
            
RemovePlayerFromVehicle(playerid);
            
SendClientMessage(playerid,-1,"Your level is not high enough to drive this vehicle, please kill others to gain score!");
        }
    
    
    } 
Edit your vehicle ids and scores.

PHP код:
//------------------------------------------------
ReturnPlayerClassName(playerid)
{
    new 
classstr[28] = "Unknown";
    switch(
gClass[playerid])
    {
        case 
0classstr "Support";
        case 
1classstr "Medic";
        case 
2classstr "Scout";
        case 
3classstr "Jetrunner";
        case 
4classstr "Pilot";
        case 
5classstr "Spy";
        case 
6classstr "Terminator";
    }
    return 
classstr;
}
//------------------------------------------------
ShowPlayerClassSelectionDialog(playerid)
{
    new 
dialogstr[556];
    new 
rank GetPlayerRank(playerid);
    
strcat(dialogstr""SAMP_BLUE"Support (Rank 0+)\n");
    
strcat(dialogstr""SAMP_BLUE"Medic (Rank 0+)\n");
    if(
rank >= 1strcat(dialogstr""SAMP_BLUE"Scout (Rank 1+)\n");
    else 
strcat(dialogstr""GREY"Scout (Rank 1+)\n");
    if(
rank >= 3strcat(dialogstr""SAMP_BLUE"Jetrunner (Rank 3+)\n");
    else 
strcat(dialogstr""GREY"Jetrunner (Rank 3+)\n");
    if(
rank >= 5strcat(dialogstr""SAMP_BLUE"Pilot (Rank 5+)\n");
    else 
strcat(dialogstr""GREY"Pilot (Rank 5+)\n");
    if(
rank >= 8strcat(dialogstr""SAMP_BLUE"Spy (Rank 8+)\n");
    else 
strcat(dialogstr""GREY"Spy (Rank 8+)\n");
    if(
rank >= 12strcat(dialogstr""SAMP_BLUE"Terminator (Rank 12+)\n");
    else 
strcat(dialogstr""GREY"Terminator (Rank 12+)\n");
    return 
ShowPlayerDialog(playeridDIALOG_CLASSDIALOG_STYLE_LIST"Class selection (/sc)"dialogstr"Spawn""Last Class");
}
//------------------------------------------------ 
]

this is my class system source
According to this source, one can change this code for me?
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)