Class Selection problems!
#2

You're not giving him any weapons under OnDialogResponse when they first choose.
Also, this system should be per-player to prevent issues.

PHP Code:
new showclass[MAX_PLAYERS], class_assault[MAX_PLAYERS], class_sniper[MAX_PLAYERS];
public 
OnPlayerConnect(playerid)
{
    
showclass[playerid] = 0;
    
class_assault[playerid] = 0;
    
class_sniper[playerid] = 0;
    return 
1;
}
public 
OnPlayerSpawn(playerid)
{
    if(
showclass[playerid] == 0)
    {
        
ShowPlayerDialog(playerid2DIALOG_STYLE_LIST"Class Selction""Assault-Rank 1\nSniper-Rank 2""Choose""");
    }
    else if(
showclass[playerid] == && class_assault[playerid] == 1)
    {
        
GivePlayerWeapon(playerid24100);
        
GivePlayerWeapon(playerid2776);
        
GivePlayerWeapon(playerid163);
        
GivePlayerWeapon(playerid31300);
    }
    else if(
showclass[playerid] == && class_sniper[playerid] == 1)
    {
        
GivePlayerWeapon(playerid40);
        
GivePlayerWeapon(playerid2360);
        
GivePlayerWeapon(playerid173);
        
GivePlayerWeapon(playerid34200);
    }
    return 
1;
}
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
response)
    {
        switch(
listitem)
        {
            case 
0:
            {
                
GivePlayerWeapon(playerid24100);
                
GivePlayerWeapon(playerid2776);
                
GivePlayerWeapon(playerid163);
                
GivePlayerWeapon(playerid31300);
                
showclass[playerid] = 1;
                
class_assault[playerid] = 1;
            }
            case 
1:
            {
                
GivePlayerWeapon(playerid40);
                
GivePlayerWeapon(playerid2360);
                
GivePlayerWeapon(playerid173);
                
GivePlayerWeapon(playerid34200);
                
showclass[playerid] = 1;
                
class_sniper[playerid] = 1;
            }
        }
    }
    return 
1;

Reply


Messages In This Thread
Class Selection problems! - by Ankon - 26.07.2016, 06:13
Re: Class Selection problems! - by itsCody - 26.07.2016, 06:22
Re: Class Selection problems! - by Ankon - 26.07.2016, 06:27

Forum Jump:


Users browsing this thread: 1 Guest(s)