29.03.2017, 18:39
So i made this vip system but it keeps giving out free vips to everyplayer that comes online
The code i use to save the player stats below:
The code i use to save the player stats below:
PHP код:
forward SaveChar(playerid);
public SaveChar(playerid)
{
new str[60],year,month,day,hour,mins,sec;
getdate(year, month, day);
gettime(hour,mins,sec);
format(str, 60,"%d/%d/%d at %d:%d:%d", day,month,year,hour,mins,sec);
if(!IsPlayerConnected(playerid)) return 1;
new INI:ACCOUNT = INI_Open(UserPath(playerid));
INI_SetTag(ACCOUNT,"data");
INI_WriteInt(ACCOUNT,"Level",pInfo[playerid][Admin]);
INI_WriteInt(ACCOUNT,"Cash",GetPlayerCash(playerid));
INI_WriteInt(ACCOUNT,"Kills",pInfo[playerid][Kills]);
INI_WriteInt(ACCOUNT,"Deaths",pInfo[playerid][Deaths]);
INI_WriteInt(ACCOUNT, "Score",GetPlayerScore(playerid));
INI_WriteInt(ACCOUNT, "Banned",pInfo[playerid][Banned]);
INI_WriteInt(ACCOUNT, "VIP",pInfo[playerid][VIP]);
INI_WriteInt(ACCOUNT, "VIPDay", pInfo[playerid][VIPDay]);
INI_WriteInt(ACCOUNT, "VIPMonth",pInfo[playerid][VIPMonth]);
INI_WriteInt(ACCOUNT, "VIPHour", pInfo[playerid][VIPHour]);
INI_WriteInt(ACCOUNT, "VIPTemp", pInfo[playerid][VIPTemp]);
INI_WriteInt(ACCOUNT,"Hours",pInfo[playerid][Hours]);
INI_WriteInt(ACCOUNT,"Minutes",pInfo[playerid][Minutes]);
INI_WriteInt(ACCOUNT, "pMuted", pInfo[playerid][pMuted]);
INI_WriteString(ACCOUNT, "LastSeen", str);
INI_Close(ACCOUNT);
new string[100];
format(string, 100, "%s's character has saved successfully.", GetName(playerid));
print(string);
return 1;
}