Need help
#6

They're like points so that you can upgrade your skills. Example:

PHP код:
    if(dialogid == DIALOG_HLEARN)
    {
         if(
response)
             {
                 new 
string[90];
                 if(
listitem == 0)
                {
                    if(
PlayerInfo[playerid][pLearn] > 0)
                    {
                        if(
PlayerInfo[playerid][Unarmed] < 3)
                        {
                            
PlayerInfo[playerid][pLearn] --;
                            
PlayerInfo[playerid][Unarmed] ++;
                            
format(stringsizeof(string), "SERVER: You have learned the Unarmed/Strength skill Rank %d."PlayerInfo[playerid][Unarmed]);
                            
SendClientMessage(playerid,COLOR_WHITE,string);
                        }
                        else
                        {
                            
SendClientMessage(playeridCOLOR_RED"ERROR: You cannot spend any more learning points on Unarmed/Strength skill. You have mastered it.");
                        }
                    }
                    else
                    {
                        
SendClientMessage(playeridCOLOR_RED"ERROR: You don't have any Learning Points to spend.");
                    }
                }
                    else if(
listitem == 1)
            {
                if(
PlayerInfo[playerid][pLearn] > 0)
                {
                    if(
PlayerInfo[playerid][Knife] < 5)
                    {
                        
PlayerInfo[playerid][pLearn] --;
                        
PlayerInfo[playerid][Knife] ++;
                        
format(stringsizeof(string), "SERVER: You have learned the Knife skill Rank %d."PlayerInfo[playerid][Knife]);
                        
SendClientMessage(playeridCOLOR_WHITE,string);
                    }
                    else
                    {
                        
SendClientMessage(playeridCOLOR_RED"ERROR: You cannot spend any more learning points on Knife skill. You have mastered it.");
                    }
                 }
                else
                {
                    
SendClientMessage(playeridCOLOR_RED"ERROR: You don't have any Learning Points to spend.");
                }
            }
                 else if(
listitem == 2)
            {
                if(
PlayerInfo[playerid][pLearn] > 0)
                {
                    if(
PlayerInfo[playerid][Katana] < 5)
                    {
                        
PlayerInfo[playerid][pLearn] --;
                        
PlayerInfo[playerid][Katana] ++;
                        
format(stringsizeof(string), "SERVER: You have learned the Katana skill Rank %d."PlayerInfo[playerid][Katana]);
                        
SendClientMessage(playeridCOLOR_WHITE,string);
                    }
                    else
                    {
                        
SendClientMessage(playeridCOLOR_RED"ERROR: You cannot spend any more learning points on Katana skill. You have mastered it.");
                    }
                 }
                else
                {
                    
SendClientMessage(playeridCOLOR_RED"ERROR: You don't have any Learning Points to spend.");
                }
            }
                 else if(
listitem == 3)
            {
                if(
PlayerInfo[playerid][pLearn] > 0)
                {
                    if(
PlayerInfo[playerid][Colt45] < 5)
                    {
                        
PlayerInfo[playerid][pLearn] --;
                        
PlayerInfo[playerid][Colt45] ++;
                        
format(stringsizeof(string), "SERVER: You have learned the Colt 45 skill Rank %d."PlayerInfo[playerid][Colt45]);
                        
SendClientMessage(playeridCOLOR_WHITE,string);
                    }
                    else
                    {
                        
SendClientMessage(playeridCOLOR_RED"ERROR: You cannot spend any more learning points on Colt 45 skill. You have mastered it.");
                    }
                 }
                else
                {
                    
SendClientMessage(playeridCOLOR_RED"ERROR: You don't have any Learning Points to spend.");
                }
            }
                 else if(
listitem == 4)
            {
                if(
PlayerInfo[playerid][pLearn] > 0)
                {
                    if(
PlayerInfo[playerid][Tazer] < 5)
                    {
                        
PlayerInfo[playerid][pLearn] --;
                        
PlayerInfo[playerid][Tazer] ++;
                        
format(stringsizeof(string), "SERVER: You have learned the Silenced Pistol/Tazer skill Rank %d."PlayerInfo[playerid][Tazer]);
                        
SendClientMessage(playeridCOLOR_WHITE,string);
                    }
                    else
                    {
                        
SendClientMessage(playeridCOLOR_RED"ERROR: You cannot spend any more learning points on Silenced Pistol/Tazer skill. You have mastered it.");
                    }
                 }
                else
                {
                    
SendClientMessage(playeridCOLOR_RED"ERROR: You don't have any Learning Points to spend.");
                }
            }
          }
          return 
1;
    } 
Reply


Messages In This Thread
Need help - by NealPeteros - 11.10.2016, 14:09
Re: Need help - by NealPeteros - 12.10.2016, 09:51
Re: Need help - by ChristolisTV - 12.10.2016, 11:02
Re: Need help - by NealPeteros - 12.10.2016, 11:56
Re: Need help - by Yaa - 12.10.2016, 11:59
Re: Need help - by NealPeteros - 12.10.2016, 12:06
Re: Need help - by NealPeteros - 13.10.2016, 09:55
Re: Need help - by NealPeteros - 13.10.2016, 10:17
Re: Need help - by Runn3R - 13.10.2016, 11:02

Forum Jump:


Users browsing this thread: 2 Guest(s)