17.03.2010, 19:17
i got a weird problem and that the files doesnt save if anyboddy can fix , please do it , here is it :
Код:
#include <a_samp> #include <dini> #include <dutils> #include <dudb> #pragma unused ret_memcpy #define UserPath "VIP" enum Info { PName[MAX_PLAYER_NAME], Pip[16], VIP, } new PlayerInfo[MAX_PLAYERS][Info]; public OnPlayerConnect(playerid) { new FilePath[32]; new Ip[16]; GetPlayerIp(playerid,Ip,sizeof(Ip)); format(FilePath, sizeof(FilePath), "%s/%s.ini", UserPath, PlayerName(playerid)); if(!dini_Exists(FilePath)) { dini_Create(FilePath); dini_Set(FilePath, "Name", PlayerName(playerid)); dini_Set(FilePath, "Ip", Ip); dini_IntSet(FilePath, "VIP", 0); } return 1; } public OnPlayerDisconnect(playerid, reason) { new FilePath[32]; new Ip[16]; format(FilePath, sizeof(FilePath), "%s/%s.ini", UserPath, PlayerName(playerid)); dini_Set(FilePath, "Name", PlayerName(playerid)); dini_Set(FilePath, "Ip", Ip); dini_IntSet(FilePath, "VIP", 0); return 1; } public OnPlayerCommandText(playerid, cmdtext[]) { new cmd[256]; if(strcmp(cmd, "/vr", true) == 0) { if(PlayerInfo[playerid][VIP]) { SetPlayerHealth(playerid,100.0); } return 1; } return 0; } stock PlayerName(playerid) { new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); return name; }