01.07.2013, 23:59
pawn Код:
CMD:addcashoffline(playerid, params[])
{
new offlineplayer[24], filestring[79], cash;
if(sscanf(params, "s[24]i", offlineplayer, cash)) return SendClientMessage(playerid, COLOR_RED, "/addcashoff NAME CASH");
format(filestring, sizeof(filestring), AccountsPath, offlineplayer[24]);
if(!fexist(filestring)) return SendClientMessage(playerid, COLOR_RED, "No palyer but that name");
INI_ParseFile(filestring, "LoadAccountOffline_%s", .bExtra = true , .extra = offlineplayer[24]);
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[24], PlayerData[offlineplayer[24]][pCash]+cash);
SendClientMessage(playerid, COLOR_RED, gstring);
return 1;
}
forward LoadAccountOffline_user(offlineplayer[24], name[], value[]);
public LoadAccountOffline_user(offlineplayer[24], name[], value[])
{
INI_Int("Cash", PlayerData[offlineplayer[24]][pCash]);
return 1;
}
Thanks in advance