ParseFile bug +rep
#1

I am facing a problem with INI_ParseFile, whenever I use it within a CMD.

PHP код:
CMD:giveoffmoney(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] < 1) return 0;
       if(
PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playeridCOLOR_YELLOWGREEN"Error: You are not authorized to use this command.");
    new 
string[128], user[50], amount;
    if(
sscanf(params"s[50]i"useramount)) return SendClientMessage(playeridCOLOR_ORANGE"Usage: /giveoffmoney [playername] [amount]");
    
format(stringsizeof string"/Users/%s.txt"user);
    if(!
fexist(string)) return SendClientMessage(playeridCOLOR_RED"Error: The player has not been found in our database!");
    
INI_ParseFile(string"LoadPlayerData_user", .bExtra true, .extra playerid);
    new 
INI:File INI_Open(string);
    
INI_SetTag(File"PlayerData");
    
INI_WriteInt(File"Money"PlayerInfo[playerid][pMoney] + amount);
    
INI_Close(File);
    
format(stringsizeof string"You have given '%s' $%i. Player '%s' has now $%i dollars."useramountuserPlayerInfo[playerid][pMoney] + amount);
    
SendClientMessage(playerid, -1string);
    return 
1;

The problem is, the stats of the [playername] are transferring to me. It's kinda hard to explain...
----
For example: Michael is admin level 3 and Sarah is admin level 0.
Michael uses the CMD: /giveoffmoney Sarah 500
after committing this, Michael receives the STATS of Sarah, so Michael's admin level is 0 now.
+rep.
Reply


Messages In This Thread
ParseFile bug +rep - by saffierr - 09.03.2016, 20:53
Re: ParseFile bug +rep - by BroZeus - 10.03.2016, 04:46
Re: ParseFile bug +rep - by saffierr - 10.03.2016, 06:45
Re: ParseFile bug +rep - by BroZeus - 10.03.2016, 06:52
Re: ParseFile bug +rep - by saffierr - 10.03.2016, 07:07
Re: ParseFile bug +rep - by BroZeus - 10.03.2016, 10:31
Re: ParseFile bug +rep - by saffierr - 10.03.2016, 11:03

Forum Jump:


Users browsing this thread: 1 Guest(s)