Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ////////////////////////////////////////////////////////////////////////////////
- //
- //
- // #### ######## ###### ######## ######## ### ## ##
- // ## ## ## ## ## ## ## ## ## ### ###
- // ## ## ## ## ## ## ## ## #### ####
- // ## ######## ###### ## ###### ## ## ## ### ##
- // ## ## ## ## ## ######### ## ##
- // ## ## ## ## ## ## ## ## ## ##
- // #### ## ###### ## ######## ## ## ## ##
- //
- //
- // pVip System v2.1
- //
- /* ______ ______ _
- // | ___ \ | ___ \ | |
- // | |_/ /_ _ | |_/ /_ _ _ _| | ___
- // | ___ \ | | | | __/ _` | | | | |/ _ \
- // | |_/ / |_| |_ | | | (_| | |_| | | (_) |
- // \____/ \__, (_) \_| \__,_|\__,_|_|\___/
- // __/ |
- // |___/
- */
- //
- // !!! Sistema de Vips com Dias !!!
- //
- // [iPs]TeaM soluções de programação em geral
- //
- // http://ipsteam.tk/forum/ (contate-nos)
- //
- /////////////////////////////////////////////////////////////////////////////////
- #define FILTERSCRIPT
- #include a_samp
- #define pCMD 2 //Coloque aqui o Processador de comandos(1 - bCmd, 2 - iCmd, 3 - zCmd)
- #define pSAVE 1 //Coloque aqui o Sistema de Salvamento(1 - bLines, 2 - DOF2)
- #if pCMD == 1
- #include bcmd
- #include sscanf2
- #endif
- #if pCMD == 2
- #include IPS/iCmd
- #endif
- #if pCMD == 3
- #include zcmd
- #include sscanf2
- #endif
- #if pSAVE == 1
- #include IPS/bLines
- #endif
- #if pSAVE == 2
- #include DOF2
- #endif
- #define Arquivo "Contas/%s.ini" //Local das Contas dos Jogadores.
- #define Vip_List "VipList.ini" //Local da VipList.
- new pVip[MAX_PLAYERS][2];
- public OnFilterScriptInit() {
- print("Vip System By. Paulo!");
- print(" Carregado com Sucesso!!");
- return 1;
- }
- public OnFilterScriptExit() {
- print("Vip System By. Paulo!");
- print(" Descarregado com Sucesso!!");
- #if pSAVE == 1
- File_Save();
- #else
- DOF2_Exit();
- #endif
- return 1;
- }
- public OnPlayerConnect(playerid) {
- new pFile[64], pNome[21];
- GetPlayerName(playerid, pNome, 20);
- format(pFile, 64, Arquivo, pNome);
- #if pSAVE == 1
- File_Open(Arquivo);
- if(File_GetInt(1)) {
- if(gettime() >= File_GetInt(0)) {
- File_SetInt(0, 0);
- File_SetInt(1, 0);
- SendClientMessage(playerid, 0xFF0000FF, "[INFO] Seu VIP expirou!!");
- }
- pVip[playerid][0] = File_GetInt(0);
- pVip[playerid][1] = File_GetInt(1);
- }
- #else
- if(DOF2_GetInt(Arquivo, "pVip")) {
- if(gettime() >= DOF2_GetInt(Arquivo, "pTime")) {
- DOF2_SetInt(Arquivo, "pVip", 0);
- DOF2_SetInt(Arquivo, "pTime", 0);
- DOF2_SaveFile();
- SendClientMessage(playerid, 0xFF0000FF, "[INFO] Seu VIP expirou!!");
- }
- pVip[playerid][0] = DOF2_GetInt(Arquivo, "pTime");
- pVip[playerid][1] = DOF2_GetInt(Arquivo, "pVip");
- }
- #endif
- return 1;
- }
- #if pCMD == 1
- // ---> bCmd
- bCMD[darvip]>(playerid:params[]:help) {
- if(help) return SendClientMessage(playerid, -1, "Este comando é usado para dar vip!");
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO] Você não é um Admin!");
- new GiveID, sVip, pDias;
- if(sscanf(params, "uii", GiveID, sVip, pDias)) return SendClientMessage(playerid, 0xFFFFFFFF, "[USO] /darvip [Id/Nick] [Vip(1-Bronze, 2-Prata e 3-Ouro)] [Dias]");
- if(!IsPlayerConnected(GiveID)) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO] Jogador Offline!");
- if(!(sVip > 0 && sVip < 4)) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO] Vip somente de 1-3!");
- if(pDias < 1) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO] Dias maiores que 0!");
- new pStr[33];
- format(pStr, sizeof(pStr), "[INFO] Você recebeu VIP %s por %d dias!!", (sVip == 1 ? ("Bronze") : sVip == 2 ? ("Prata") : ("Ouro")), pDias);
- SendClientMessage(GiveID, 0x00FF00FF, pStr);
- new pFile[64], pNome[21];
- GetPlayerName(GiveID, pNome, 20);
- format(pFile, 64, Arquivo, pNome);
- pVip[GiveID][0] = (gettime() + (pDias * 24 * 60 * 60));
- pVip[GiveID][1] = sVip;
- #if pSAVE == 1
- // ---> bLines
- File_Open(pFile);
- File_SetInt(0, pVip[GiveID][0]);
- File_SetInt(1, pVip[GiveID][1]);
- #else
- // ---> DOF2
- DOF2_SetInt(pFile, "pTime", pVip[GiveID][0]);
- DOF2_SetInt(pFile, "pVip", pVip[GiveID][1]);
- DOF2_SaveFile();
- #endif
- return 1;
- }
- bCMD[tirarvip]>(playerid:params[]:help) {
- if(help) return SendClientMessage(playerid, -1, "Este comando é usado para tirar o Vip!");
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO] Você não é um Admin!");
- new GiveID;
- if(sscanf(params, "u", GiveID)) return SendClientMessage(playerid, 0xFFFFFFFF, "[USO] /tirarvip [Id/Nick]");
- if(!IsPlayerConnected(GiveID)) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO] Jogador Offline!");
- new pFile[64], pNome[21], pStr[32];
- GetPlayerName(GiveID, pNome, 20);
- format(pFile, 64, Arquivo, pNome);
- format(pStr, sizeof(pStr), "[INFO] Você perdeu seu VIP %s!!", (pVip[GiveID][1] == 1 ? ("Bronze") : pVip[GiveID][1] == 2 ? ("Prata") : ("Ouro")));
- SendClientMessage(GiveID, 0xFF0000FF, pStr);
- pVip[GiveID][0] = 0;
- pVip[GiveID][1] = 0;
- #if pSAVE == 1
- // ---> bLines
- File_Open(pFile);
- File_SetInt(0, 0);
- File_SetInt(1, 0);
- #else
- // ---> DOF2
- DOF2_SetInt(pFile, "pTime", 0);
- DOF2_SetInt(pFile, "pVip", 0);
- DOF2_SaveFile();
- #endif
- return 1;
- }
- bCMD[tempovip]>(playerid:params[]:help) {
- if(help) return SendClientMessage(playerid, -1, "Este comando é usado para ver o tempo Vip!");
- if(!pVip[playerid][1]) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO] Você não é um VIP!");
- new pStr[45];
- if(pVip[playerid][1]) {
- if(gettime() >= pVip[playerid][0]) {
- new pFile[64], pNome[21];
- GetPlayerName(playerid, pNome, 20);
- format(pFile, 64, Arquivo, pNome);
- pVip[playerid][0] = 0;
- pVip[playerid][1] = 0;
- #if pSAVE == 1
- File_Open(pFile);
- File_SetInt(0, 0);
- File_SetInt(1, 0);
- #else
- DOF2_SetInt(pFile, "pTime", 0);
- DOF2_SetInt(pFile, "pVip", 0);
- DOF2_SaveFile();
- #endif
- return SendClientMessage(playerid, 0xFF0000FF, "[INFO] Seu VIP expirou!!");
- }
- format(pStr, sizeof(pStr), "[INFO] Restam %d dias para acabar o seu VIP!", (((pVip[playerid][0] - gettime()) / 60) / 60) / 24);
- SendClientMessage(playerid, 0x00FF00FF, pStr);
- }
- return 1;
- }
- bCMD[vips]>(playerid:params[]:help) {
- if(help) return SendClientMessage(playerid, -1, "Este comando é usado para ver os Vips Online!");
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO] Você não é um Admin!");
- new pStr[512];
- for(new i = (MAX_PLAYERS - 1), pNome[24]; i > -1; --i) if(IsPlayerConnected(i) && pVip[playerid][0]) GetPlayerName(i, pNome, 24), strcat(pStr, pNome), strcat(pStr, "\n");
- if(!pStr[0] || (pStr[0] == '\1' && !pStr[1])) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO] Nenhum Vip Online!");
- ShowPlayerDialog(playerid, 5845, DIALOG_STYLE_MSGBOX, "Vips Online", pStr, "Fechar", #);
- return 1;
- }
- bCMD[comprarvip]>(playerid:params[]:help) {
- if(help) return SendClientMessage(playerid, -1, "Este comando é usado para comprar Vip!");
- new sVip[7], pDias;
- if(sscanf(params, "s[7]i", sVip, pDias)) return SendClientMessage(playerid, 0xFFFFFFFF, "[USO] /comprarvip [Vip(Ouro, Prata e Bronze)] [Dias]");
- new File: pArq = fopen(Vip_List, io_write), pNome[21], pStr[64];
- GetPlayerName(playerid, pNome, 20);
- format(pStr, 64, "Nome: %s, Vip: %s e Dias: %i\r\n", pNome, sVip, pDias);
- fwrite(pArq, pStr);
- fclose(pArq);
- return SendClientMessage(playerid, -1, "Você foi colocado na lista de espera para adquirir Vip, Aguarde..");
- }
- bCMD[darvipoff]>(playerid:params[]:help) {
- if(help) return SendClientMessage(playerid, -1, "Este comando é usado para dar vip off!");
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO] Você não é um Admin!");
- new pNome[21], sVip, pDias;
- if(sscanf(params, "s[21]ii", pNome, sVip, pDias)) return SendClientMessage(playerid, 0xFFFFFFFF, "[USO] /darvipoff [Nick] [Vip(1-Bronze, 2-Prata e 3-Ouro)] [Dias]");
- if(!(sVip > 0 && sVip < 4)) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO] Vip somente de 1-3!");
- if(pDias < 1) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO] Dias maiores que 0!");
- new pFile[64];
- format(pFile, 64, Arquivo, pNome);
- if(!fexist(pFile)) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO] Essa conta não existe!");
- #if pSAVE == 1
- // ---> bLines
- File_Open(pFile);
- File_SetInt(0, (gettime() + (pDias * 24 * 60 * 60)));
- File_SetInt(1, sVip);
- #else
- // ---> DOF2
- DOF2_SetInt(pFile, "pTime", (gettime() + (pDias * 24 * 60 * 60)));
- DOF2_SetInt(pFile, "pVip", sVip);
- DOF2_SaveFile();
- #endif
- format(pFile, 33, "[INFO] Você setou o VIP de %s para %s por %d dias!!", pNome, (sVip == 1 ? ("Bronze") : sVip == 2 ? ("Prata") : ("Ouro")), pDias);
- SendClientMessage(playerid, 0x00FF00FF, pFile);
- return 1;
- }
- #endif
- #if pCMD == 2
- // ---> iCmd
- scmd(darvip, playerid, erro)<GiveID, sVip, pDias>scanf("uii", GiveID, sVip, pDias) {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO] Você não é um Admin!");
- if(erro) return SendClientMessage(playerid, 0xFFFFFFFF, "[USO] /darvip [Id/Nick] [Vip(1-Bronze, 2-Prata e 3-Ouro)] [Dias]");
- if(!IsPlayerConnected(GiveID)) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO] Jogador Offline!");
- if(!(sVip > 0 && sVip < 4)) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO] Vip somente de 1-3!");
- if(pDias < 1) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO] Dias maiores que 0!");
- new pStr[33];
- format(pStr, sizeof(pStr), "[INFO] Você recebeu VIP %s por %d dias!!", (sVip == 1 ? ("Bronze") : sVip == 2 ? ("Prata") : ("Ouro")), pDias);
- SendClientMessage(GiveID, 0x00FF00FF, pStr);
- new pFile[64], pNome[21];
- GetPlayerName(GiveID, pNome, 20);
- format(pFile, 64, Arquivo, pNome);
- pVip[GiveID][0] = (gettime() + (pDias * 24 * 60 * 60));
- pVip[GiveID][1] = sVip;
- #if pSAVE == 1
- // ---> bLines
- File_Open(pFile);
- File_SetInt(0, pVip[GiveID][0]);
- File_SetInt(1, pVip[GiveID][1]);
- #else
- // ---> DOF2
- DOF2_SetInt(pFile, "pTime", pVip[GiveID][0]);
- DOF2_SetInt(pFile, "pVip", pVip[GiveID][1]);
- DOF2_SaveFile();
- #endif
- return 1;
- }
- scmd(tirarvip, playerid, erro)<GiveID>scanf("u", GiveID) {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO] Você não é um Admin!");
- if(erro) return SendClientMessage(playerid, 0xFFFFFFFF, "[USO] /tirarvip [Id/Nick]");
- if(!IsPlayerConnected(GiveID)) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO] Jogador Offline!");
- new pFile[64], pNome[21], pStr[32];
- GetPlayerName(GiveID, pNome, 20);
- format(pFile, 64, Arquivo, pNome);
- format(pStr, sizeof(pStr), "[INFO] Você perdeu seu VIP %s!!", (pVip[GiveID][1] == 1 ? ("Bronze") : pVip[GiveID][1] == 2 ? ("Prata") : ("Ouro")));
- SendClientMessage(GiveID, 0xFF0000FF, pStr);
- pVip[GiveID][0] = 0;
- pVip[GiveID][1] = 0;
- #if pSAVE == 1
- // ---> bLines
- File_Open(pFile);
- File_SetInt(0, 0);
- File_SetInt(1, 0);
- #else
- // ---> DOF2
- DOF2_SetInt(pFile, "pTime", 0);
- DOF2_SetInt(pFile, "pVip", 0);
- DOF2_SaveFile();
- #endif
- return 1;
- }
- cmd(tempovip, playerid, params[]) {
- if(!pVip[playerid][1]) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO] Você não é um VIP!");
- new pStr[45];
- if(pVip[playerid][1]) {
- if(gettime() >= pVip[playerid][0]) {
- new pFile[64], pNome[21];
- GetPlayerName(playerid, pNome, 20);
- format(pFile, 64, Arquivo, pNome);
- pVip[playerid][0] = 0;
- pVip[playerid][1] = 0;
- #if pSAVE == 1
- File_Open(pFile);
- File_SetInt(0, 0);
- File_SetInt(1, 0);
- #else
- DOF2_SetInt(pFile, "pTime", 0);
- DOF2_SetInt(pFile, "pVip", 0);
- DOF2_SaveFile();
- #endif
- return SendClientMessage(playerid, 0xFF0000FF, "[INFO] Seu VIP expirou!!");
- }
- format(pStr, sizeof(pStr), "[INFO] Restam %d dias para acabar o seu VIP!", (((pVip[playerid][0] - gettime()) / 60) / 60) / 24);
- SendClientMessage(playerid, 0x00FF00FF, pStr);
- }
- return 1;
- }
- cmd(vips, playerid, params[]) {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO] Você não é um Admin!");
- new pStr[512];
- for(new i = (MAX_PLAYERS - 1), pNome[24]; i > -1; --i) if(IsPlayerConnected(i) && pVip[playerid][0]) GetPlayerName(i, pNome, 24), strcat(pStr, pNome), strcat(pStr, "\n");
- if(!pStr[0] || (pStr[0] == '\1' && !pStr[1])) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO] Nenhum Vip Online!");
- ShowPlayerDialog(playerid, 5845, DIALOG_STYLE_MSGBOX, "Vips Online", pStr, "Fechar", #);
- return 1;
- }
- scmd(comprarvip, playerid, erro)<sVip[7], pDias>scanf("s[7]i", sVip, pDias) {
- if(erro) return SendClientMessage(playerid, 0xFFFFFFFF, "[USO] /comprarvip [Vip(Ouro, Prata e Bronze)] [Dias]");
- new File: pArq = fopen(Vip_List, io_write), pNome[21], pStr[64];
- GetPlayerName(playerid, pNome, 20);
- format(pStr, 64, "Nome: %s, Vip: %s e Dias: %i\r\n", pNome, sVip, pDias);
- fwrite(pArq, pStr);
- fclose(pArq);
- return SendClientMessage(playerid, -1, "Você foi colocado na lista de espera para adquirir Vip, Aguarde..");
- }
- scmd(darvipoff, playerid, erro)<pNome[21], sVip, pDias>scanf("s[21]ii", pNome, sVip, pDias) {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO] Você não é um Admin!");
- if(erro) return SendClientMessage(playerid, 0xFFFFFFFF, "[USO] /darvipoff [Nick] [Vip(1-Bronze, 2-Prata e 3-Ouro)] [Dias]");
- if(!(sVip > 0 && sVip < 4)) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO] Vip somente de 1-3!");
- if(pDias < 1) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO] Dias maiores que 0!");
- new pFile[64];
- format(pFile, 64, Arquivo, pNome);
- if(!fexist(pFile)) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO] Essa conta não existe!");
- #if pSAVE == 1
- // ---> bLines
- File_Open(pFile);
- File_SetInt(0, (gettime() + (pDias * 24 * 60 * 60)));
- File_SetInt(1, sVip);
- #else
- // ---> DOF2
- DOF2_SetInt(pFile, "pTime", (gettime() + (pDias * 24 * 60 * 60)));
- DOF2_SetInt(pFile, "pVip", sVip);
- DOF2_SaveFile();
- #endif
- format(pFile, 33, "[INFO] Você setou o VIP de %s para %s por %d dias!!", pNome, (sVip == 1 ? ("Bronze") : sVip == 2 ? ("Prata") : ("Ouro")), pDias);
- SendClientMessage(playerid, 0x00FF00FF, pFile);
- return 1;
- }
- public OnPlayerCallCommand(playerid, cmdtext[]) return 1;
- #endif
- #if pCMD == 3
- // ---> ZCMD
- CMD:darvip(playerid, params[]) {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO] Você não é um Admin!");
- new GiveID, sVip, pDias;
- if(sscanf(params, "uii", GiveID, sVip, pDias)) return SendClientMessage(playerid, 0xFFFFFFFF, "[USO] /darvip [Id/Nick] [Vip(1-Bronze, 2-Prata e 3-Ouro)] [Dias]");
- if(!IsPlayerConnected(GiveID)) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO] Jogador Offline!");
- if(!(sVip > 0 && sVip < 4)) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO] Vip somente de 1-3!");
- if(pDias < 1) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO] Dias maiores que 0!");
- new pStr[33];
- format(pStr, sizeof(pStr), "[INFO] Você recebeu VIP %s por %d dias!!", (sVip == 1 ? ("Bronze") : sVip == 2 ? ("Prata") : ("Ouro")), pDias);
- SendClientMessage(GiveID, 0x00FF00FF, pStr);
- new pFile[64], pNome[21];
- GetPlayerName(GiveID, pNome, 20);
- format(pFile, 64, Arquivo, pNome);
- pVip[GiveID][0] = (gettime() + (pDias * 24 * 60 * 60));
- pVip[GiveID][1] = sVip;
- #if pSAVE == 1
- // ---> bLines
- File_Open(pFile);
- File_SetInt(0, pVip[GiveID][0]);
- File_SetInt(1, pVip[GiveID][1]);
- #else
- // ---> DOF2
- DOF2_SetInt(pFile, "pTime", pVip[GiveID][0]);
- DOF2_SetInt(pFile, "pVip", pVip[GiveID][1]);
- DOF2_SaveFile();
- #endif
- return 1;
- }
- CMD:tirarvip(playerid, params[]) {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO] Você não é um Admin!");
- new GiveID;
- if(sscanf(params, "u", GiveID)) return SendClientMessage(playerid, 0xFFFFFFFF, "[USO] /tirarvip [Id/Nick]");
- if(!IsPlayerConnected(GiveID)) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO] Jogador Offline!");
- new pFile[64], pNome[21], pStr[32];
- GetPlayerName(GiveID, pNome, 20);
- format(pFile, 64, Arquivo, pNome);
- format(pStr, sizeof(pStr), "[INFO] Você perdeu seu VIP %s!!", (pVip[GiveID][1] == 1 ? ("Bronze") : pVip[GiveID][1] == 2 ? ("Prata") : ("Ouro")));
- SendClientMessage(GiveID, 0xFF0000FF, pStr);
- pVip[GiveID][0] = 0;
- pVip[GiveID][1] = 0;
- #if pSAVE == 1
- // ---> bLines
- File_Open(pFile);
- File_SetInt(0, 0);
- File_SetInt(1, 0);
- #else
- // ---> DOF2
- DOF2_SetInt(pFile, "pTime", 0);
- DOF2_SetInt(pFile, "pVip", 0);
- DOF2_SaveFile();
- #endif
- return 1;
- }
- CMD:tempovip(playerid) {
- if(!pVip[playerid][1]) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO] Você não é um VIP!");
- new pStr[45];
- if(pVip[playerid][1]) {
- if(gettime() >= pVip[playerid][0]) {
- new pFile[64], pNome[21];
- GetPlayerName(playerid, pNome, 20);
- format(pFile, 64, Arquivo, pNome);
- pVip[playerid][0] = 0;
- pVip[playerid][1] = 0;
- #if pSAVE == 1
- File_Open(pFile);
- File_SetInt(0, 0);
- File_SetInt(1, 0);
- #else
- DOF2_SetInt(pFile, "pTime", 0);
- DOF2_SetInt(pFile, "pVip", 0);
- DOF2_SaveFile();
- #endif
- return SendClientMessage(playerid, 0xFF0000FF, "[INFO] Seu VIP expirou!!");
- }
- format(pStr, sizeof(pStr), "[INFO] Restam %d dias para acabar o seu VIP!", (((pVip[playerid][0] - gettime()) / 60) / 60) / 24);
- SendClientMessage(playerid, 0x00FF00FF, pStr);
- }
- return 1;
- }
- CMD:vips(playerid, params[]) {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO] Você não é um Admin!");
- new pStr[512];
- for(new i = (MAX_PLAYERS - 1), pNome[24]; i > -1; --i) if(IsPlayerConnected(i) && pVip[playerid][0]) GetPlayerName(i, pNome, 24), strcat(pStr, pNome), strcat(pStr, "\n");
- if(!pStr[0] || (pStr[0] == '\1' && !pStr[1])) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO] Nenhum Vip Online!");
- ShowPlayerDialog(playerid, 5845, DIALOG_STYLE_MSGBOX, "Vips Online", pStr, "Fechar", #);
- return 1;
- }
- CMD:comprarvip(playerid, params[]) {
- new sVip[7], pDias;
- if(sscanf(params, "s[7]i", sVip, pDias)) return SendClientMessage(playerid, 0xFFFFFFFF, "[USO] /comprarvip [Vip(Ouro, Prata e Bronze)] [Dias]");
- new File: pArq = fopen(Vip_List, io_write), pNome[21], pStr[64];
- GetPlayerName(playerid, pNome, 20);
- format(pStr, 64, "Nome: %s, Vip: %s e Dias: %i\r\n", pNome, sVip, pDias);
- fwrite(pArq, pStr);
- fclose(pArq);
- return SendClientMessage(playerid, -1, "Você foi colocado na lista de espera para adquirir Vip, Aguarde..");
- }
- CMD:darvipoff(playerid, params[]) {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO] Você não é um Admin!");
- new pNome[21], sVip, pDias;
- if(sscanf(params, "s[21]ii", pNome, sVip, pDias)) return SendClientMessage(playerid, 0xFFFFFFFF, "[USO] /darvipoff [Nick] [Vip(1-Bronze, 2-Prata e 3-Ouro)] [Dias]");
- if(!(sVip > 0 && sVip < 4)) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO] Vip somente de 1-3!");
- if(pDias < 1) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO] Dias maiores que 0!");
- new pFile[64];
- format(pFile, 64, Arquivo, pNome);
- if(!fexist(pFile)) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO] Essa conta não existe!");
- #if pSAVE == 1
- // ---> bLines
- File_Open(pFile);
- File_SetInt(0, (gettime() + (pDias * 24 * 60 * 60)));
- File_SetInt(1, sVip);
- #else
- // ---> DOF2
- DOF2_SetInt(pFile, "pTime", (gettime() + (pDias * 24 * 60 * 60)));
- DOF2_SetInt(pFile, "pVip", sVip);
- DOF2_SaveFile();
- #endif
- format(pFile, 33, "[INFO] Você setou o VIP de %s para %s por %d dias!!", pNome, (sVip == 1 ? ("Bronze") : sVip == 2 ? ("Prata") : ("Ouro")), pDias);
- SendClientMessage(playerid, 0x00FF00FF, pFile);
- return 1;
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement