Need help
#1

Hi guys! I'm looking for a way to load the player's LP after he logs in. Here's the code.

PHP код:
        case DIALOG_LOGIN:
        {
            if ( !
response ) return Kick playerid );
            if( 
response )
            {
                if(
udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
                    
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra true, .extra playerid);
                    new
                        
tmp2256 ],
                        
playername2MAX_PLAYER_NAME ]
                    ;
                    
GetPlayerName(playeridplayername2sizeof(playername2));
                       
format(tmp2sizeof(tmp2), "~w~Welcome ~n~~g~%s"playername2);
                    
GameTextForPlayer(playeridtmp250001);
                    
GivePlayerCash(playeridPlayerInfo[playerid][pCash]);
                    
PlayerInfo[playerid][pLearn] = INI_Int("pLearn",PlayerInfo[playerid][pLearn]);
                       
SetSpawnInfo(playeridPlayerInfo[playerid][pSpecial], PlayerInfo[playerid][pSkin], PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z], 1.0, -1, -1, -1, -1, -1, -1);
                    
SpawnPlayer(playerid);
                }
                else
                {
                    
ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_INPUT,"Login","You have entered an incorrect password.\nType your password below to login.","Login","Quit");
                }
                return 
1;
            }
        }
    }
    return 
1;

Is there something wrong in this line?
Код:
PlayerInfo[playerid][pLearn] = INI_Int("pLearn",PlayerInfo[playerid][pLearn]);
Reply
#2

Bump
Reply
#3

Sorry, but what is LP? (You can hate me as much as you can)
Reply
#4

Learning Points
Reply
#5

wtf is that ?
Reply
#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
#7

Bumpy dumpty sat on a wall (Bump)
Reply
#8

Fixed. Just replaced
Код:
PlayerInfo[playerid][pLearn] = INI_Int("pLearn",PlayerInfo[playerid][pLearn]);
to
Код:
PlayerInfo[playerid][pLearn];
+rep to all
Reply
#9

Quote:
Originally Posted by NealPeteros
Посмотреть сообщение
Fixed. Just replaced
Код:
PlayerInfo[playerid][pLearn] = INI_Int("pLearn",PlayerInfo[playerid][pLearn]);
to
Код:
PlayerInfo[playerid][pLearn];
+rep to all
No.

Just do this.

Код:
INI_Int("pLearn", PlayerInfo[playerid][pLearn]);
INI_Int(rowname, var that you want to save the row to);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)