Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //na enum
- VipExpira,
- pVip,
- CMD:vips(playerid, params[]) //comandos vip
- {
- SendClientMessage(playerid, COR_BARRAS, "» Todos os VIP's online:");
- new count=0;
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- if(Player[i][pLogged] == true)
- {
- if(Player[i][pVip] == 1)
- {
- if(IsPlayerConnected(i))
- {
- new str[256];
- new pname[24];
- GetPlayerName(i, pname, 24);
- format(str, 256, "» Vip: %s | [Tempo restante %s]", pname, Convert(Player[i][VipExpira]-gettime()));
- SendClientMessage(playerid, 0xE3E3E3FF, str);
- count++;
- }
- }
- }
- }
- if(count == 0)
- {
- SendClientMessage(playerid, 0xD8D8D8FF, "Não tem nenhum vip on-line agora!");
- }
- return 1;
- }
- //==============================================================================//
- stock setVipUser(dias, id, extra[])
- {
- new String[128];
- format(String, sizeof(String), CONTAS, getPName(id));
- Player[id][VipExpira] = gettime()+(ONE_DAY*dias);
- Player[id][pVip] = 1;
- format(String, sizeof(String), CONTAS, getPName(id));
- DOF2_SetInt(String,"Vip",Player[id][pVip]);
- DOF2_SetInt(String,"VipExpira",Player[id][VipExpira]);
- DOF2_SaveFile();
- DOF2_CreateFile(VIP_FILE(getPName(id)));
- DOF2_SetInt(VIP_FILE(getPName(id)), "Dias", dias);
- DOF2_SetInt(VIP_FILE(getPName(id)), "VipExpira",Player[id][VipExpira]);
- DOF2_SetString(VIP_FILE(getPName(id)), "Extra", extra);
- DOF2_SaveFile();
- format(String,128, "setVipUser(%d, %s, %s)", dias, getPName(id), extra);
- WriteLog("setVipUser", String);
- return 1;
- }
- //==============================================================================//
- stock setVipAccount(dias, acc[], extra[])
- {
- new String[128];
- format(String, sizeof(String), CONTAS, acc);
- new exp = gettime()+(ONE_DAY*dias);
- format(String, sizeof(String), CONTAS, acc);
- DOF2_SetInt(String,"Vip", 1);
- DOF2_SaveFile();
- DOF2_CreateFile(VIP_FILE(acc));
- DOF2_SetInt(VIP_FILE(acc), "Dias", dias);
- DOF2_SetInt(VIP_FILE(acc), "VipExpira", exp);
- DOF2_SetString(VIP_FILE(acc), "Extra", extra);
- DOF2_SaveFile();
- return 1;
- }
- //==============================================================================//
- Convert(number)
- {
- new hours = 0, mins = 0, secs = 0, string[128];
- hours = floatround(number / 3600);
- mins = floatround((number / 60) - (hours * 60));
- secs = floatround(number - ((hours * 3600) + (mins * 60)));
- new days = 0;
- if(hours >= 24)
- {
- days = floatround((hours/24), floatround_floor);
- hours = hours % 24;
- }
- if(days > 0)
- {
- format(string, 100, "%ddias, %dh %dm e %ds", days, hours, mins, secs);
- }
- else if(hours > 0)
- {
- format(string, 100, "%dh %dm e %ds", hours, mins, secs);
- }
- else
- {
- format(string, 100, "%dm e %ds", mins, secs);
- }
- return string;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement