09.04.2011, 14:59
I have a problem with my script .
It doesn't load Vip_Level from %s.ini
It create's %s.ini and everything is fine but it doesn't load
This is how my code looks
What the problem could be ?
It doesn't load Vip_Level from %s.ini
It create's %s.ini and everything is fine but it doesn't load
This is how my code looks
Код:
public OnPlayerConnect( playerid ) { LoadPlayerVip( playerid ); } public OnPlayerDisconnect( playerid ) { SavePlayerVip( playerid ); } forward load_user_vip(playerid, name[], value[]); public load_user_vip(playerid, name[], value[]) { INI_Int("Vip_Level", PlayerData[ playerid ][ VIP_LEVEL ] ); return 1; } LoadPlayerVip( playerid ) { new userFile[32]; format(userFile, sizeof (userFile), "Vips/%s.ini", pName( playerid ) ); INI_ParseFile(userFile, "load_user_vip", .extra = playerid); } SavePlayerVip( playerid ) { new userFile[32]; format(userFile, sizeof (userFile), "Vips/%s.ini", pName( playerid ) ); new INI:file = INI_Open(userFile); INI_WriteInt(file, "Vip_Level", PlayerData[ playerid ][ VIP_LEVEL ] ); INI_Close(file); }