18.02.2014, 20:41
Code:
new VIPTime[MAX_PLAYERS]; public OnPlayerConnect(playerid) { VIPTime[playerid] = 0; // Load VIPTime from a file. if(VIPTime[playerid] != 0) { // Give them membership. } return 1; } public OnPlayerDisconnect(playerid, reason) { // Save the VIPTime variable. } public OnPlayerUpdate(playerid) { new Timestamp = gettime(); if(Timestamp >= VIPTime[playerid]) { // Cancel their membership. VIPTime[playerid] = 0; } return 1; } stock AddMembershipForADay(playerid) { if(! IsPlayerConnected(playerid)) { return false; } if(VIPTime[playerid] == 0) { // new member VIPTime[playerid] += gettime(); // Give them membership. } VIPTime[playerid] += (60 * 60 * 24); return true; }