• Sobre
Este й um sistema bбsico de VIP. Usei o mesmo cуdigo do antigo Sistema de VIP que eu criei.
Para quem quer fazer um Sistema de VIP isto pode ser uma boa base para comeзar. Irei estar sempre atualizando com vбrias vantagens para VIP atй nгo ter mais ideias para vantagens kkkk
• Comandos
• Comando /VantagensVIP
• Comando /Vencimento
• Changelog
Quote:
Update 23/03/2018 - v1.1 Update 24/03/2018 - v1.2
- Resolvido Alguns Bugs
- Adicionado Sistema de Neon
Update 26/03/2018 - v1.3
- Melhoramento do cуdigo - Agradecimento ao F1N4L
- Resolvido alguns bugs - Sem bugs no momento
- Adicionado Nitro Infinito para vips
- Adicionado Reparo Automбtico ao soltar nitro
- Adicionado o comando /VantagensVIP
• Crйditos• Double-O-Seven - DOF2
• ****** e Emmet_ - SSCANF
• ZeeX - ZCMD
• Download
https://github.com/AdiitiProgrammer/AdiVIP
CMD:vips(playerid) { new ContarVIPs = 0; new StringCat[1000]; for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(IsPlayerVIP(playerid)) { format(Str, sizeof(Str), "{00FFFF}%s {FFFFFF}[{00FFFF}%i{FFFFFF}]\n", PlayerName(i), i); strcat(StringCat, Str); ContarVIPs++; } } } if(ContarVIPs == 0) ShowPlayerDialog(playerid, 5000, DIALOG_STYLE_MSGBOX, "{FFFFFF}VIPs Online [{FF0000} 0{FFFFFF}]", "{FF0000}Nenhum VIP online!", "Fechar", #); else if(ContarVIPs == 1) ShowPlayerDialog(playerid, 5000, DIALOG_STYLE_MSGBOX, "{FFFFFF}VIP Online [{00BFFF} 1 {FFFFFF}]", StringCat, "Fechar", #); else { format(Str, sizeof(Str), "{FFFFFF}VIPs Online [{00BFFF} %d {FFFFFF}]", ContarVIPs); ShowPlayerDialog(playerid, 5000, DIALOG_STYLE_MSGBOX, Str, StringCat, "Fechar", #); } return 1; }
Update 23/03/2018 - v1.1
|
AttachObjectToVehicle(GetPVarInt(playerid, "neon24"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0); AttachObjectToVehicle(GetPVarInt(playerid, "neon25"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0); AttachObjectToVehicle(GetPVarInt(playerid, "neon26"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0); AttachObjectToVehicle(GetPVarInt(playerid, "neon27"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
Pena que o usuбrio VIP tem poucas vantagens no seu sistema, fora isso eu gostei do seu trabalho.
|
Parabйns pelo sistema.
__________________ Apenas alguns detalhes que nгo pude deixar despercebidos: #1 - Vocк pode utilizar somente um SendClientMessageToAll(GetPlayerColor(playerid), Str); no switch da linha 85, apenas adicione a funзгo no final do switch e nгo em todos os "case". #2 - No switch da linha 158 vocк usa DeletePVar(playerid, "Status"); apуs um objeto ser destruнdo. Por quк? #3 - O propуsito de PVars й compartilhar informaзхes entre scripts (como CallRemoteFunction). Recomendo o uso de variбveis. #4 - Toda vez que for usar uma funзгo nativa MAIS DE UMA VEZ no mesmo script, recomendo armazenar o valor retornado da funзгo em uma variбvel. Como o caso abaixo: Код:
AttachObjectToVehicle(GetPVarInt(playerid, "neon24"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0); AttachObjectToVehicle(GetPVarInt(playerid, "neon25"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0); AttachObjectToVehicle(GetPVarInt(playerid, "neon26"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0); AttachObjectToVehicle(GetPVarInt(playerid, "neon27"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0); Foram alguns pontos que eu vi e que podem ser melhorados. |
Update 24/03/2018 - v1.2
|
#include <a_samp>
#include <sscanf2>
#include <ZCMD>
#include <DOF2>
//===== [ COLORS ] =====//
#define VERMELHO 0xFF0000FF
#define AZUL_BEST 0x1E90FFFF
#define VERDE 0x00FF00FF
#define COLOR_MAGENTA 0xFF00FFFF
//===== [ MACROS ] =====//
#define SendClientFormat(%0,%1,%2,%3); \
format(Str, sizeof(Str), %2, %3); SendClientMessage(%0, %1, Str);
#define SendClientFormatToAll(%0,%1,%2); \
format(Str, sizeof(Str), %1, %2); SendClientMessageToAll(%0, Str);
#define @_CallBack:%0(%1) \
forward%0(%1); public%0(%1)
//===== [ DIALOGS ] =====//
#define DIALOG_COR_VIP 5001
#define DIALOG_VIP_NEON 5002
//===== [ NEWS ] =====//
new Str[128];
//====================
public OnFilterScriptInit() {
print("\n----------------------------------------------");
print(" AdiVIP Carregado com Sucesso! By:Adiiti");
print("------------------------------------------------\n");
SetTimer("AtualizarChatBubble", 1000, true);
return 1;
}
public OnFilterScriptExit() {
DOF2_Exit();
return 1;
}
public OnPlayerSpawn(playerid) {
if(GetPVarInt(playerid, "Spawnou") != 1) {
if(IsPlayerVIP(playerid )) {
format(Str, sizeof(Str), "/VIPs/%s.ini", PlayerName(playerid));
if(gettime() > DOF2_GetInt(Str, "Vencimento")) {
RemoverV(playerid);
SendClientMessage(playerid, VERMELHO, "Seu VIP expirou e jб nгo tem mais acesso aos comandos exclusivo VIP!");
SetPVarInt(playerid, "Spawnou", 1);
return 1;
} else {
SendClientMessage(playerid, AZUL_BEST, "Vocк й um jogador VIP! Para ver o vencimento digite /Vencimento!");
SetPVarInt(playerid, "Spawnou", 1);
return 1;
}
}
}
return 1;
}
public OnPlayerText(playerid, text[]) {
if(IsPlayerVIP(playerid)) {
format(Str, sizeof(Str), "/VIPs/%s.ini", PlayerName(playerid));
new cor = DOF2_GetInt(Str, "CorVIP");
format(Str, sizeof(Str), "%s: {FFFFFF}[%d] [{%s}VIP{FFFFFF}] %s", PlayerName(playerid), playerid, cor == 1 ? ("FF00FF") : cor == 2 ? ("FFFF00") : cor == 3 ? ("FFA500") : cor == 4 ? ("00FF00") : cor == 5 ? ("00FFFF") : cor == 6 ? ("0000FF") : cor == 7 ? ("B5B5B5") : cor == 8 ? ("FF0000") : ("FFFFFF"), text);
SendClientMessageToAll(GetPlayerColor(playerid), Str);
return 0;
}
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
switch(listitem) {
case DIALOG_COR_VIP: {
if(response) {
format(Str, sizeof(Str), "VIPs/%s.ini", PlayerName(playerid));
DOF2_SetInt(Str, "CorVIP", (listitem + 1) );
DOF2_SaveFile();
SendClientMessage(playerid, VERDE, "Cor alterada com sucesso!");
}
} case DIALOG_VIP_NEON: {
if(response) {
DestroyObject(GetPVarInt(playerid, "neon"));
DestroyObject(GetPVarInt(playerid, "neon1"));
DestroyObject(GetPVarInt(playerid, "neon2"));
DestroyObject(GetPVarInt(playerid, "neon3"));
DestroyObject(GetPVarInt(playerid, "neon4"));
DestroyObject(GetPVarInt(playerid, "neon5"));
DestroyObject(GetPVarInt(playerid, "neon6"));
DestroyObject(GetPVarInt(playerid, "neon7"));
DestroyObject(GetPVarInt(playerid, "neon8"));
DestroyObject(GetPVarInt(playerid, "neon9"));
DestroyObject(GetPVarInt(playerid, "neon10"));
DestroyObject(GetPVarInt(playerid, "neon11"));
DestroyObject(GetPVarInt(playerid, "neon12"));
DestroyObject(GetPVarInt(playerid, "neon13"));
DestroyObject(GetPVarInt(playerid, "neon14"));
DestroyObject(GetPVarInt(playerid, "neon15"));
DestroyObject(GetPVarInt(playerid, "neon16"));
DestroyObject(GetPVarInt(playerid, "neon17"));
DestroyObject(GetPVarInt(playerid, "neon18"));
DestroyObject(GetPVarInt(playerid, "neon19"));
DestroyObject(GetPVarInt(playerid, "neon20"));
DestroyObject(GetPVarInt(playerid, "neon21"));
DestroyObject(GetPVarInt(playerid, "neon22"));
DestroyObject(GetPVarInt(playerid, "neon23"));
DestroyObject(GetPVarInt(playerid, "neon24"));
DestroyObject(GetPVarInt(playerid, "neon25"));
DestroyObject(GetPVarInt(playerid, "neon26"));
DestroyObject(GetPVarInt(playerid, "neon27"));
DestroyObject(GetPVarInt(playerid, "neon28"));
DestroyObject(GetPVarInt(playerid, "neon29"));
DestroyObject(GetPVarInt(playerid, "neon30"));
DestroyObject(GetPVarInt(playerid, "neon31"));
DestroyObject(GetPVarInt(playerid, "neon32"));
DestroyObject(GetPVarInt(playerid, "neon33"));
DestroyObject(GetPVarInt(playerid, "neon34"));
DestroyObject(GetPVarInt(playerid, "neon35"));
switch(listitem) {
case 0: {
SetPVarInt(playerid, "neon", CreateObject(18648,0,0,0,0,0,0));
SetPVarInt(playerid, "neon1", CreateObject(18648,0,0,0,0,0,0));
AttachObjectToVehicle(GetPVarInt(playerid, "neon"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "neon1"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
SendClientMessage(playerid, VERDE, "Neon adicionado com sucesso!");
} case 1: {
SetPVarInt(playerid, "neon2", CreateObject(18647,0,0,0,0,0,0));
SetPVarInt(playerid, "neon3", CreateObject(18647,0,0,0,0,0,0));
AttachObjectToVehicle(GetPVarInt(playerid, "neon2"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "neon3"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
SendClientMessage(playerid, VERDE, "Neon adicionado com sucesso!");
} case 2: {
SetPVarInt(playerid, "neon4", CreateObject(18649,0,0,0,0,0,0));
SetPVarInt(playerid, "neon5", CreateObject(18649,0,0,0,0,0,0));
AttachObjectToVehicle(GetPVarInt(playerid, "neon4"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "neon5"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
SendClientMessage(playerid, VERDE, "Neon adicionado com sucesso!");
} case 3: {
SetPVarInt(playerid, "Status", 1);
SetPVarInt(playerid, "neon6", CreateObject(18652,0,0,0,0,0,0));
SetPVarInt(playerid, "neon7", CreateObject(18652,0,0,0,0,0,0));
AttachObjectToVehicle(GetPVarInt(playerid, "neon6"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "neon7"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
SendClientMessage(playerid, VERDE, "Neon adicionado com sucesso!");
} case 4: {
SetPVarInt(playerid, "neon8", CreateObject(18651,0,0,0,0,0,0));
SetPVarInt(playerid, "neon9", CreateObject(18651,0,0,0,0,0,0));
AttachObjectToVehicle(GetPVarInt(playerid, "neon8"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "neon9"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
SendClientMessage(playerid, VERDE, "Neon adicionado com sucesso!");
} case 5: {
SetPVarInt(playerid, "neon10", CreateObject(18650,0,0,0,0,0,0));
SetPVarInt(playerid, "neon11", CreateObject(18650,0,0,0,0,0,0));
AttachObjectToVehicle(GetPVarInt(playerid, "neon10"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "neon11"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
SendClientMessage(playerid, VERDE, "Neon adicionado com sucesso!");
} case 6: {
SetPVarInt(playerid, "neon12", CreateObject(18648,0,0,0,0,0,0));
SetPVarInt(playerid, "neon13", CreateObject(18648,0,0,0,0,0,0));
SetPVarInt(playerid, "neon14", CreateObject(18649,0,0,0,0,0,0));
SetPVarInt(playerid, "neon15", CreateObject(18649,0,0,0,0,0,0));
AttachObjectToVehicle(GetPVarInt(playerid, "neon12"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "neon13"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "neon14"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "neon15"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
SendClientMessage(playerid, VERDE, "Neon adicionado com sucesso!");
} case 7: {
SetPVarInt(playerid, "neon16", CreateObject(18648,0,0,0,0,0,0));
SetPVarInt(playerid, "neon17", CreateObject(18648,0,0,0,0,0,0));
SetPVarInt(playerid, "neon18", CreateObject(18652,0,0,0,0,0,0));
SetPVarInt(playerid, "neon19", CreateObject(18652,0,0,0,0,0,0));
AttachObjectToVehicle(GetPVarInt(playerid, "neon16"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "neon17"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "neon18"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "neon19"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
SendClientMessage(playerid, VERDE, "Neon adicionado com sucesso!");
} case 8: {
SetPVarInt(playerid, "neon20", CreateObject(18647,0,0,0,0,0,0));
SetPVarInt(playerid, "neon21", CreateObject(18647,0,0,0,0,0,0));
SetPVarInt(playerid, "neon22", CreateObject(18652,0,0,0,0,0,0));
SetPVarInt(playerid, "neon23", CreateObject(18652,0,0,0,0,0,0));
AttachObjectToVehicle(GetPVarInt(playerid, "neon20"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "neon21"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "neon22"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "neon23"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
SendClientMessage(playerid, VERDE, "Neon adicionado com sucesso!");
} case 9: {
SetPVarInt(playerid, "neon24", CreateObject(18647,0,0,0,0,0,0));
SetPVarInt(playerid, "neon25", CreateObject(18647,0,0,0,0,0,0));
SetPVarInt(playerid, "neon26", CreateObject(18650,0,0,0,0,0,0));
SetPVarInt(playerid, "neon27", CreateObject(18650,0,0,0,0,0,0));
AttachObjectToVehicle(GetPVarInt(playerid, "neon24"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "neon25"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "neon26"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "neon27"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
SendClientMessage(playerid, VERDE, "Neon adicionado com sucesso!");
} case 10: {
SetPVarInt(playerid, "neon28", CreateObject(18649,0,0,0,0,0,0));
SetPVarInt(playerid, "neon29", CreateObject(18649,0,0,0,0,0,0));
SetPVarInt(playerid, "neon30", CreateObject(18652,0,0,0,0,0,0));
SetPVarInt(playerid, "neon31", CreateObject(18652,0,0,0,0,0,0));
AttachObjectToVehicle(GetPVarInt(playerid, "neon28"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "neon29"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "neon30"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "neon31"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
SendClientMessage(playerid, VERDE, "Neon adicionado com sucesso!");
} case 11: {
SetPVarInt(playerid, "neon32", CreateObject(18652,0,0,0,0,0,0));
SetPVarInt(playerid, "neon33", CreateObject(18652,0,0,0,0,0,0));
SetPVarInt(playerid, "neon34", CreateObject(18650,0,0,0,0,0,0));
SetPVarInt(playerid, "neon35", CreateObject(18650,0,0,0,0,0,0));
AttachObjectToVehicle(GetPVarInt(playerid, "neon32"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "neon33"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "neon34"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "neon35"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
SendClientMessage(playerid, VERDE, "Neon adicionado com sucesso!");
} case 12: SendClientMessage(playerid, VERDE, "Neon retirado com sucesso!");
}
}
}
}
return 1;
}
CMD:setarvip(playerid, params[]) {
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, VERMELHO, "Vocк nгo tem permissгo!");
new ID, dias;
if(sscanf(params, "ud", ID, dias)) return SendClientMessage(playerid, VERMELHO, "Digite: /SetarVIP (id-do-jogador) (Dias)");
if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, VERMELHO, "Jogador nгo conectado!");
SetarV(ID, dias);
SendClientFormat(playerid, AZUL_BEST, "Vocк deu %d dias de VIP para o(a) jogador(a) %s[%d]", dias, PlayerName(ID), ID);
SendClientFormat(ID, AZUL_BEST, "O(A) Staff %s setou %d dias de VIP para vocк!", PlayerName(playerid), dias);
return 1;
}
CMD:agendarvip(playerid, params[]) {
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, VERMELHO, "Vocк nгo tem permissгo!");
new nick[24], dias;
if(sscanf(params, "s[24]d", nick, dias)) return SendClientMessage(playerid, VERMELHO, "Digite: /agendarvip (nick) (dias)");
format(Str, sizeof(Str), "/VIPs/%s.ini", nick);
if(!DOF2_FileExists(Str)) DOF2_CreateFile(Str);
DOF2_SetInt(Str, "Vencimento", (gettime() + (dias * 86400) ) );
DOF2_SaveFile();
format(Str, sizeof(Str), "Vocк deu %d dias de VIP para %s!", dias, nick);
SendClientMessage(playerid, -1, Str);
return 1;
}
CMD:removervip(playerid, params[]) {
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, VERMELHO, "Vocк nгo tem permissгo!");
new ID;
if(sscanf(params, "u", ID)) return SendClientMessage(playerid, VERMELHO, "Digite: /RemoverVip (id-do-jogador)");
if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, VERMELHO, "Jogador nгo conectado!");
if(!IsPlayerVIP(ID)) return SendClientMessage(playerid, VERMELHO, "Esse jogador nгo й VIP!");
RemoverV(ID);
SendClientFormat(playerid, AZUL_BEST, "Vocк removeu o VIP do(a) jogador(a) %s[%d]!", PlayerName(ID), ID);
SendClientFormat(ID, AZUL_BEST, "O(A) Staff %s removeu o seu VIP!", PlayerName(playerid));
return 1;
}
CMD:vencimento(playerid) {
if(!IsPlayerVIP(playerid)) return SendClientMessage(playerid, VERMELHO, "Vocк nгo tem permissгo!");
new StringCat[256], StrFile[128];
format(StrFile, sizeof(StrFile), "/VIPs/%s.ini", PlayerName(playerid));
format(Str, sizeof(Str), "{FFD700}Nick: {FFFFFF}%s\n\n", PlayerName(playerid));
strcat(StringCat, Str);
format(Str, sizeof(Str), "{FFD700}Vencimento: {FFFFFF}%s \n\n", convertTimestamp(DOF2_GetInt(StrFile, "Vencimento"), 1));
strcat(StringCat, Str);
strcat(StringCat, "Aproveite o seu VIP atй o ъltimo minuto!\n{FFD700}Creditos: {FFFFFF}Adiiti Programmer\n");
ShowPlayerDialog(playerid, 5000, DIALOG_STYLE_MSGBOX, "{FF0000}Vencimento", StringCat, "Fechar", "");
return 1;
}
CMD:vips(playerid) {
new ContarVIPs = 0;
new StringCat[1000];
for(new i = 0; i < MAX_PLAYERS; i++) {
if(IsPlayerConnected(i)) {
if(IsPlayerVIP(i)) {
format(Str, sizeof(Str), "{FFD700}%s {FFFFFF}[%i]\n", PlayerName(i), i);
strcat(StringCat, Str);
ContarVIPs++;
}
}
}
if(ContarVIPs == 0) { ShowPlayerDialog(playerid, 5000, DIALOG_STYLE_MSGBOX, "{FFFFFF}VIPs Online [{FF0000} 0{FFFFFF}]", "{FF0000}Nenhum VIP online!", "Fechar", #);
} else if(ContarVIPs == 1) { ShowPlayerDialog(playerid, 5000, DIALOG_STYLE_MSGBOX, "{FFFFFF}VIP Online [{00BFFF} 1 {FFFFFF}]", StringCat, "Fechar", #);
} else {
format(Str, sizeof(Str), "{FFFFFF}VIPs Online [{00BFFF} %d {FFFFFF}]", ContarVIPs);
ShowPlayerDialog(playerid, 5000, DIALOG_STYLE_MSGBOX, Str, StringCat, "Fechar", #);
}
return 1;
}
CMD:coletev(playerid) {
if(IsPlayerVIP(playerid)) return SendClientMessage(playerid, VERMELHO, "Vocк nгo tem permissгo!");
SendClientMessage(playerid, VERDE, "Colete criado com sucesso!");
SetPlayerArmour(playerid, 100.0);
return 1;
}
CMD:jetpackv(playerid) {
if(!IsPlayerVIP(playerid)) return SendClientMessage(playerid, VERMELHO, "Vocк nгo tem permissгo!");
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, VERMELHO, "Vocк nгo pode utilizar esse comando em um veнculo!");
SendClientMessage(playerid, VERDE, "Jetpack criado com sucesso!");
SetPlayerSpecialAction(playerid, 2);
return 1;
}
CMD:v(playerid, params[]) {
new texto[128], StringText[128];
if(!IsPlayerVIP(playerid)) return SendClientMessage(playerid, VERMELHO, "Vocк nгo tem permissгo!");
if(sscanf(params, "s[128]", texto)) return SendClientMessage(playerid, VERMELHO, "Use: /V (Texto)");
if(strval(texto) > 100) return SendClientMessage(playerid, VERMELHO, "Texto muito grande, diminua por favor!");
format(StringText, sizeof(StringText), "## Chat-VIP ## %s[%i]: %s", PlayerName(playerid), playerid, texto);
ChatVIP(COLOR_MAGENTA, StringText, playerid);
return 1;
}
CMD:virarv(playerid, params[]) {
if(!IsPlayerVIP(playerid)) return SendClientMessage(playerid, VERMELHO, "Vocк nгo tem permissгo!");
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, VERMELHO, "Vocк nгo estб dirigindo um veнculo!");
new Float:a, vehicleid = GetPlayerVehicleID(playerid);
GetVehicleZAngle(vehicleid, a);
SetVehicleZAngle(vehicleid, a);
SendClientMessage(playerid, VERDE, "Vocк virou o veнculo!");
return 1;
}
CMD:repararv(playerid) {
if(!IsPlayerVIP(playerid)) return SendClientMessage(playerid, VERMELHO, "Vocк nгo tem permissгo!");
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, VERMELHO, "Vocк nгo estб dirigindo um veнculo!");
RepairVehicle(GetPlayerVehicleID(playerid));
SendClientMessage(playerid, VERDE, "Vocк reparou o veнculo com sucesso!");
return 1;
}
CMD:pintarv(playerid, params[]) {
if(!IsPlayerVIP(playerid)) return SendClientMessage(playerid, VERMELHO, "Vocк nгo tem permissгo!");
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, VERMELHO, "Vocк nгo estб dirigindo um veнculo!");
new COR1, COR2;
if(sscanf(params, "dd", COR1, COR2)) return SendClientMessage(playerid, VERMELHO, "Digite: /pintar (cor-1) (cor-2)");
ChangeVehicleColor(GetPlayerVehicleID(playerid), COR1, COR2);
SendClientMessage(playerid, VERDE, "Vocк pintou o seu veнculo com sucesso!");
return 1;
}
CMD:comandosvip(playerid) {
if(!IsPlayerVIP(playerid)) return SendClientMessage(playerid, VERMELHO, "Vocк nгo tem permissгo!");
new StringCat[500];
strcat(StringCat, "Comando\tFunзгo\n");
strcat(StringCat, "{FFD700}/Vencimento \t{FFFFFF}Use para ver o vencimento do seu VIP\n");
strcat(StringCat, "{FFD700}/ColeteV \t{FFFFFF}Use para colocar colete\n");
strcat(StringCat, "{FFD700}/JetpackV \t{FFFFFF}Use para criar um jetpack\n");
strcat(StringCat, "{FFD700}/VirarV \t{FFFFFF}Use para virar o veнculo\n");
strcat(StringCat, "{FFD700}/RepararV \t{FFFFFF}Use para reparar o veнculo\n");
strcat(StringCat, "{FFD700}/PintarV \t{FFFFFF}Use para pintar o veнculo\n");
strcat(StringCat, "{FFD700}/NeonV \t{FFFFFF}Use para colocar neon no veнculo\n");
strcat(StringCat, "{FFD700}/V \t{FFFFFF}Use para falar no chat vip");
ShowPlayerDialog(playerid, 5000, DIALOG_STYLE_TABLIST_HEADERS, "{FFD700}Comandos VIP", StringCat, "Fechar", "");
return 1;
}
CMD:corvip(playerid, params[]) {
new StringCat[500];
if(!IsPlayerVIP(playerid)) return SendClientMessage(playerid, VERMELHO, "Vocк nгo tem permissгo!");
strcat(StringCat, "{FF00FF}VIP\n");
strcat(StringCat, "{FFFF00}VIP\n");
strcat(StringCat, "{FFA500}VIP\n");
strcat(StringCat, "{00FF00}VIP\n");
strcat(StringCat, "{00FFFF}VIP\n");
strcat(StringCat, "{0000FF}VIP\n");
strcat(StringCat, "{B5B5B5}VIP\n");
strcat(StringCat, "{FF0000}VIP");
ShowPlayerDialog(playerid, DIALOG_COR_VIP, DIALOG_STYLE_LIST, "{00FF00}Cor VIP", StringCat, "Continuar", "Fechar");
return 1;
}
CMD:neonv(playerid) {
if(!IsPlayerVIP(playerid)) return SendClientMessage(playerid, VERMELHO, "Vocк nгo tem permissгo!");
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, VERMELHO, "Vocк nгo estб dirigindo um veнculo!");
new StringCat[256];
strcat(StringCat, "Azul Escuro\n");
strcat(StringCat, "Vermelho\n");
strcat(StringCat, "Verde\n");
strcat(StringCat, "Branco\n");
strcat(StringCat, "Violeta\n");
strcat(StringCat, "Amarelo\n");
strcat(StringCat, "Ciano\n");
strcat(StringCat, "Azul Claro\n");
strcat(StringCat, "Rosa\n");
strcat(StringCat, "Laranja\n");
strcat(StringCat, "Verde Claro\n");
strcat(StringCat, "Amarelo Claro\n");
strcat(StringCat, "Remover Neon");
ShowPlayerDialog(playerid, DIALOG_VIP_NEON, DIALOG_STYLE_LIST, "Neon", StringCat, "Selecionar", "Cancelar");
return 1;
}
@_CallBack: AtualizarChatBubble() {
for(new i = 0; i < MAX_PLAYERS; i++) {
if(IsPlayerVIP(i)) {
format(Str, sizeof(Str), "/VIPs/%s.ini", PlayerName(i));
if(gettime() > DOF2_GetInt(Str, "Vencimento")) {
SendClientMessage(i, -1, "Seu VIP acaba de expirar!");
RemoverV(i);
continue;
}
new cor = DOF2_GetInt(Str, "CorVIP");
SetPlayerChatBubble(i, "VIP", cor == 1 ? (0xFF00FFFF) : cor == 2 ? (0xFFFF00FF) : cor == 3 ? (0xFFA500FF) : cor == 4 ? (0x00FF00FF) : cor == 5 ? (0x00FFFFFF) : cor == 6 ? (0x0000FFFF) : cor == 7 ? (0xB5B5B5FF) : cor == 8 ? (0xFF0000FF) : (-1), 50.0, 10000);
}
}
}
@_CallBack: ChatVIP(COLOR, TextoVIP[], playerid) {
for(new i = 0; i < MAX_PLAYERS; i++) {
if(IsPlayerConnected(i)) {
if(IsPlayerVIP(i)) {
SendClientMessage(i, COLOR, TextoVIP);
}
}
}
return 1;
}
stock SetarV(playerid, dias) {
format(Str, sizeof(Str), "/VIPs/%s.ini", PlayerName(playerid));
if(!IsPlayerVIP(playerid)) {
DOF2_CreateFile(Str);
DOF2_SetInt(Str, "Vencimento", (gettime() + (dias * 86400)));
DOF2_SetInt(Str, "CorVIP", 1);
DOF2_SaveFile();
} else {
DOF2_SetInt(Str, "Vencimento", (DOF2_GetInt(Str, "Vencimento") + (dias * 86400)));
DOF2_SaveFile();
}
return 1;
}
stock RemoverV(playerid) {
format(Str, sizeof(Str), "/VIPs/%s.ini", PlayerName(playerid));
DOF2_RemoveFile(Str);
return 1;
}
stock IsPlayerVIP(playerid) {
format(Str, sizeof(Str), "/VIPs/%s.ini", PlayerName(playerid));
if(DOF2_FileExists(Str)) return 1;
return 0;
}
stock PlayerName(playerid) {
new Nome[MAX_PLAYER_NAME];
GetPlayerName(playerid, Nome, 24);
return Nome;
}
stock convertTimestamp( timestamp, _form=0 ) {
timestamp -= 10800;
new year = 1970, day = 0, month = 0, hour = 0, mins = 0, sec = 0, returnstring[32];
new days_of_month[12] = { 31,28,31,30,31,30,31,31,30,31,30,31 };
new names_of_month[12][10] = {"Janeiro","Fevereiro","Marзo","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"};
while(timestamp>31622400){
timestamp -= 31536000;
if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0) ) timestamp -= 86400;
year++;
}
if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) days_of_month[1] = 29;
else days_of_month[1] = 28;
while(timestamp>86400){
timestamp -= 86400, day++;
if(day == days_of_month[month]) day=0, month++;
}
while(timestamp > 60){
timestamp -= 60, mins++;
if(mins == 60) mins = 0, hour++;
}
sec = timestamp;
switch( _form ){
case 1: format(returnstring, 31, "%02d/%02d/%d %02d:%02d:%02d", day+1, month+1, year, hour, mins, sec);
case 2: format(returnstring, 31, "%s %02d, %d, %02d:%02d:%02d", names_of_month[month],day+1,year, hour, mins, sec);
case 3: format(returnstring, 31, "%d %c%c%c %d, %02d:%02d", day+1,names_of_month[month][0],names_of_month[month][1],names_of_month[month][2], year,hour,mins);
case 4: format(returnstring, 31, "%02d.%02d.%d-%02d:%02d:%02d", day+1, month+1, year, hour, mins, sec);
default: format(returnstring, 31, "%02d:%02d:%02d %02d/%02d/%d", hour, mins, sec, day+1, month+1, year);
}
return returnstring;
}