#1

Here is the code
PHP код:
 if(response)
            {
                if(!
strlen(inputtext)) return ShowPlayerDialog(playeridDIALOG_REGISTERDIALOG_STYLE_INPUT,""COL_WHITE"Register",COL_RED"Invalid Password","Register","Close");
                new 
INI:File INI_Open(UserPath(playerid));
                
INI_SetTag(File,"data");
                
INI_WriteInt(File,"Password",udb_hash(inputtext));
                
INI_WriteInt(File,"Cash",10000);
                
INI_WriteInt(File,"Admin",0);
                
INI_WriteInt(File,"Kills",0);
                
INI_WriteInt(File,"Deaths",0);
                
INI_WriteInt(File,"Skin",0);
                
INI_Close(File);
                
ShowPlayerDialog(playeridDIALOG_SUCCESS_1DIALOG_STYLE_MSGBOX,""COL_WHITE"Success",""COL_GREEN"You have registerd successfully","Start","");
                
SpawnPlayer(playerid);
                
            } 
When the player register he must have 10,000 but when the player spawn i didn't give him the money i add
PHP код:
GivePlayerMoney(playeridPlayerInfo[playerid][pCash]); 
But i doesn't work !
Please Help.
Reply
#2

This
Код:
if(response) 
{ 
	if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Register",COL_RED"Invalid Password","Register","Close"); 
	new INI:File = INI_Open(UserPath(playerid)); 
	INI_SetTag(File,"data"); 
	INI_WriteInt(File,"Password",udb_hash(inputtext)); 
	INI_WriteInt(File,"Cash",10000); 
	INI_WriteInt(File,"Admin",0); 
	INI_WriteInt(File,"Kills",0); 
	INI_WriteInt(File,"Deaths",0); 
	INI_WriteInt(File,"Skin",0); 
	INI_Close(File); 
	ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success",""COL_GREEN"You have registerd successfully","Start",""); 
	SpawnPlayer(playerid); 
}
only creates a file and writes to it; there's no assignment to
Код:
PlayerInfo[playerid][pCash]
thus it is the most probable, that this variable is equal to 0. You can do either:
Код:
GivePlayerMoney(playerid, 10000);
or
Код:
...
	INI_WriteInt(File,"Cash",10000); 
	Player[playerid][pCash] = 10000;
...
With this 2nd one, your
Код:
GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
should work fine.

Greetings.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)