02.07.2013, 01:05
try
I may be wrong actually, but why do you keep defining the length of offlineplayer? Might that be causing the issues?
pawn Код:
CMD:addcashoffline(playerid, params[])
{
new offlineplayer[MAX_PLAYER_NAME+1], filestring[79], cash;
if(sscanf(params, "s[MAX_PLAYER_NAME+1]i", offlineplayer, cash)) return SendClientMessage(playerid, COLOR_RED, "/addcashoff NAME CASH");
format(filestring, sizeof(filestring), AccountsPath, offlineplayer[MAX_PLAYER_NAME+1]);
if(!fexist(filestring)) return SendClientMessage(playerid, COLOR_RED, "No palyer but that name");
INI_ParseFile(filestring, "LoadAccountOffline_%s", .bExtra = true , .extra = offlineplayer[MAX_PLAYER_NAME+1]);
new INI:File = INI_Open(filestring);
INI_WriteInt(File, "Cash", PlayerData[offlineplayer[24]][pCash]+cash);
INI_Close(File);
format(gstring, sizeof(gstring), "%s now has $%d", offlineplayer[MAX_PLAYER_NAME+1], PlayerData[offlineplayer[MAX_PLAYER_NAME+1]][pCash]+cash);
SendClientMessage(playerid, COLOR_RED, gstring);
return 1;
}
forward LoadAccountOffline_user(offlineplayer[MAX_PLAYER_NAME+1], name[], value[]);
public LoadAccountOffline_user(offlineplayer[MAX_PLAYER_NAME+1], name[], value[])
{
INI_Int("Cash", PlayerData[offlineplayer[MAX_PLAYER_NAME+1]][pCash]);
return 1;
}