Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Filterscript criado por DelK.
- //Perfil no fórum-samp: http://forum.sa-mp.com/member.php?u=297267
- //Creditos: DelK, Zeex, Y_Lees
- //===================Includes================//
- #include <a_samp>
- #include <zcmd>
- #include <dof2>
- #include <sscanf2>
- //================Definições===================//
- #define FILTERSCRIPT
- #define ConvertDays(%0) (gettime() + (86400 * (%0)))
- #define SendFormattedMessageToAll(%0,%1,%2) do{new _string[148]; format(_string,sizeof(_string),%1,%2); SendClientMessageToAll(%0,_string);} while(False)
- #define SendFormattedMessage(%0,%1,%2,%3) do{new _string[148]; format(_string,sizeof(_string),%2,%3); SendClientMessage(%0,%1,_string);} while(False)
- //================Cores============================//
- #define CorErro 0xFF0000AA
- #define CorUsoCorreto 0x3552F2FF
- #define CorVermelho 0xFF0000AA
- #define CorPrincipal 0x33AAFFFF
- //==============Fim das cores/inicio das variaveis================================//
- enum pDados
- {
- Vip
- }
- new Player[MAX_PLAYERS][pDados];
- new Pegouequip[MAX_PLAYERS] = false, Pegoucolete[MAX_PLAYERS] = false, Pegouvida[MAX_PLAYERS] = false, False=false;
- forward MensagemVip(const DString[]);
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- print("¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨");
- print("¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨");
- print("¨¨¨¨¨Sistema de Vip por: DelK Carregado com Exîto.¨¨¨¨¨\n");
- print("¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨[ Sistema DVip/v1.0 ]¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨");
- print("¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨");
- print("¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- #endif
- public OnPlayerConnect(playerid)
- {
- if(DOF2_FileExists(ArquivoVip(playerid)))
- {
- Player[playerid][Vip] = DOF2_GetInt(ArquivoVip(playerid),"Dias");
- if(VerifyExpiredDays(Player[playerid][Vip]))
- {
- DOF2_RemoveFile(ArquivoVip(playerid));
- Player[playerid][Vip] = 0;
- SendClientMessage(playerid, -1, "Lamento mais seu tempo como um player {FFFF00}( Vip ) {FFFFFF}expirou!");
- }
- else
- {
- new DString[128];
- format(DString, sizeof(DString), "Seu {FFFF00}( Vip ){1E90FF} expira em %s.", ConvertToDays(Player[playerid][Vip]));
- SendClientMessage(playerid, CorPrincipal, DString);
- }
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- Pegouequip[playerid] = false, Pegoucolete[playerid] = false, Pegouvida[playerid] = false;
- return 1;
- }
- CMD:cchave(playerid, params[])
- {
- new chave[20], days, Arquivo[64];
- if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid, CorErro, "[ERRO]: Você não está logado na RCON");
- if(sscanf(params, "s[20]d", chave, days)) return SendClientMessage(playerid, CorUsoCorreto, "Uso correto: /cchave [chave] [dias]");
- SendFormattedMessage(CorPrincipal, "{F4A460}[INFO]: O Administrador %s criou a chave: %s | Com: %d Dias de vip.", Nome(playerid), chave, days);
- format(Arquivo, sizeof(Arquivo), "Chaves/%s.ini", chave);
- DOF2_CreateFile(Arquivo);
- days = ConvertDays(days);
- DOF2_SetInt(Arquivo, "Dias", days);
- DOF2_SaveFile();
- return 1;
- }
- CMD:ativarchave(playerid, params[])
- {
- new chave[20], days, Arquivo[64];
- if(sscanf(params, "s[20]", chave)) return SendClientMessage(playerid, CorUsoCorreto, "Uso correto: /ativarchave [chave]");
- format(Arquivo, sizeof(Arquivo), "Chaves/%s.ini", chave);
- if(!DOF2_FileExists(Arquivo))
- {
- SendClientMessage(playerid, CorPrincipal," Está chave não existe/Ou já foi ativada.");
- return 1;
- }
- days = DOF2_GetInt(Arquivo, "Dias");
- SendFormattedMessageToAll(CorPrincipal, "{F4A460}[INFO]: %s Ativou uma chave vip | Com: %s de vip.", Nome(playerid), ConvertToDays(days));
- Player[playerid][Vip] = days;
- DOF2_RemoveFile(Arquivo);
- return 1;
- }
- CMD:setvip(playerid, params[])
- {
- new id, days;
- if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid, CorErro, "[ERRO]: Você não está logado na RCON");
- if(sscanf(params, "u[24]d", id, days)) return SendClientMessage(playerid, CorUsoCorreto, "Uso correto: /setvip [id] [dias]");
- if(days < 0) return SendClientMessage(playerid, CorErro, "[ERRO]: Digite um numero de dias válidos!");
- if(!(IsPlayerConnected(id))) return SendClientMessage(playerid, CorErro, "[ERRO]: Este jogador não está Logado.");
- if(DOF2_FileExists(ArquivoVip(id))) return SendClientMessage(playerid, CorErro, "[ERRO]: Este jogador já é um {FFFF00}( Vip ).");
- Player[id][Vip] = ConvertDays(days);
- new DString[85];
- format(DString, sizeof(DString), "[INFO]: Você recebeu %d dias de {FFFF00}( Vip ){FFFFFF} do administrador %s.", days, Nome(playerid));
- SendClientMessage(id, -1, DString);
- SendFormattedMessageToAll(CorPrincipal, "{F4A460}[INFO]: O Administrador %s tornou %s um membro {FFFF00}( Vip ) | {F4A460}Por: %d Dias.", Nome(playerid), Nome(id), days);
- DOF2_CreateFile(ArquivoVip(id));
- DOF2_SetInt(ArquivoVip(id), "Dias", Player[id][Vip]);
- DOF2_SaveFile();
- return true;
- }
- CMD:tirarvip(playerid, params[])
- {
- new DString[85] , id;
- if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid, CorErro, "[ERRO]: Você não está logado na RCON");
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, CorUsoCorreto, "Use /TirarVip [ID]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, CorErro, "[ERRO]: ID inválido");
- if(Player[id][Vip] == 0) return SendClientMessage(playerid, CorErro, "Este player não é um mebro {FFFF00}( Vip ).");
- format(DString, sizeof(DString), "{FF0000} %s teve sua conta retirada da lista de {FFFF00}( Vips ).",Nome(id));
- SendClientMessageToAll(CorPrincipal, DString);
- DOF2_RemoveFile(ArquivoVip(id));
- Player[id][Vip] = 0;
- return 1;
- }
- CMD:jetpackv(playerid)
- {
- if(Player[playerid][Vip] < 1) return SendClientMessage(playerid, CorErro, "[ERRO]: Você não tem permissão para usar este comando.");
- SetPlayerSpecialAction(playerid, 2);
- new DString[44];
- format(DString, sizeof(DString), " %s criou um jetpack {FFFF00}( Vip ).", Nome(playerid));
- SendClientMessage(playerid, 0xC798FAAA, DString);
- return 1;
- }
- CMD:repararv(playerid)
- {
- if(Player[playerid][Vip] < 1) return SendClientMessage(playerid, CorErro, "[ERRO]: Você não tem permissão para usar este comando.");
- if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, CorErro, "ERRO: Você não pode utilizar esse comando fora de um veículo!");
- SendClientMessage(playerid, CorPrincipal, "[INFO]: Veículo reparado com sucesso!");
- RepairVehicle(GetPlayerVehicleID(playerid));
- return 1;
- }
- CMD:coletev(playerid)
- {
- if(Player[playerid][Vip] < 1) return SendClientMessage(playerid, CorErro, "[ERRO]: Você não tem permissão para usar este comando.");
- if(Pegoucolete[playerid] == 1) return SendClientMessage(playerid, CorErro, "[ERR]: Você só pode usar este comando 1 vez por morte.");
- Pegoucolete[playerid] = true;
- SetPlayerArmour(playerid, 100);
- SendClientMessage(playerid, CorPrincipal, "[INFO]: Você encheu seu colete {FFFF00}( Vip ).");
- return 1;
- }
- CMD:vidav(playerid)
- {
- if(Player[playerid][Vip] < 1) return SendClientMessage(playerid, CorErro, "[ERRO]: Você não tem permissão para usar este comando.");
- if(Pegouvida[playerid] == 1) return SendClientMessage(playerid, CorErro, "[ERRO]: Você só pode usar este comando 1 vez por morte.");
- Pegouvida[playerid] = true;
- SetPlayerHealth(playerid, 100);
- SendClientMessage(playerid, CorPrincipal, "[INFO]: Você encheu sua vida {FFFF00}( Vip ).");
- return 1;
- }
- CMD:equiparv(playerid)
- {
- if(Player[playerid][Vip] < 1) return SendClientMessage(playerid, CorErro, "[ERRO]: Você não tem permissão para usar este comando.");
- if(Pegouequip[playerid] == 1) return SendClientMessage(playerid, CorErro, "[ERR]: Você só pode usar este comando 1 vez por morte.");
- Pegouequip[playerid] = true;
- SetPlayerHealth(playerid, 100);
- SetPlayerArmour(playerid, 100);
- GivePlayerWeapon(playerid, 4, 1);//Faca
- GivePlayerWeapon(playerid, 16, 10);//Granada
- GivePlayerWeapon(playerid, 24, 800);//Desert
- GivePlayerWeapon(playerid, 25, 800);//Showgun
- GivePlayerWeapon(playerid, 29, 1000);//Mp5
- GivePlayerWeapon(playerid, 31, 1000);//M4
- GivePlayerWeapon(playerid, 34, 500);//Sniper
- GivePlayerWeapon(playerid, 46, 1);//Jetpack
- SendClientMessage(playerid, CorPrincipal, "[INFO]: Você pegou seu equipamento {FFFF00}( Vip ).");
- return 1;
- }
- CMD:tunarv(playerid)
- {
- if(Player[playerid][Vip] < 1) return SendClientMessage(playerid, CorErro, "[ERRO]: Você não tem permissão para usar este comando.");
- new vehicle;
- vehicle = GetPlayerVehicleID(playerid);
- ChangeVehiclePaintjob(vehicle,1);
- AddVehicleComponent(vehicle,1035);
- AddVehicleComponent(vehicle,1078);
- AddVehicleComponent(vehicle,1010);
- AddVehicleComponent(vehicle,1087);
- AddVehicleComponent(vehicle,1046);
- AddVehicleComponent(vehicle,1171);
- AddVehicleComponent(vehicle,1149);
- AddVehicleComponent(vehicle,1147);
- AddVehicleComponent(vehicle,1036);
- AddVehicleComponent(vehicle,1040);
- SendClientMessage(playerid, CorPrincipal,"[Auto-Tunning]: Veiculo tunado com sucesso agora vá tirar uma marra {FFFF00}( Vip ).");
- return 1;
- }
- CMD:vips(playerid)
- {
- SendClientMessage(playerid, 0xADFF2FFF, "Todos os {FFFF00}( Vips ).");
- new count=0;
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(Player[i][Vip] > 0)
- {
- SendFormattedMessage(playerid, 0xE3E3E3FF, "{FFFF00}( Vip ):»{00CED1} %s Tempo restante %s", Nome(i), ConvertToDays(Player[playerid][Vip]));
- count++;
- }
- }
- }
- if(count == 0) return SendClientMessage(playerid, 0xE3E3E3FF, "Não tem nem um player {FFFF00}( Vip ).");
- return 1;
- }
- CMD:v(playerid, params[])
- {
- new DString[100], texto[128];
- if(sscanf(params, "s[128]", texto)) return SendClientMessage(playerid, CorUsoCorreto, "Uso correto: /v [texto]");
- if(Player[playerid][Vip] < 1) return SendClientMessage(playerid, CorErro, "[ERRO]: Você não tem permissão para usar este comando.");
- format(DString, sizeof(DString),"{FFFF00}( Chat-Vip ){FFFFFF}: {FFFF00}%s{FFFFFF}: %s ", Nome(playerid), texto);
- MensagemVip(DString);
- return 1;
- }
- CMD:comandosv(playerid)
- {
- if(Player[playerid][Vip] < 1) return SendClientMessage(playerid, CorErro, "[ERRO]: Você não tem permissão para usar este comando.");
- new dialogrande[750];
- strcat(dialogrande, "{FFFF00}»/setvip - {CD0000}Para setar vip a alguém«\n\n");
- strcat(dialogrande, "{FFFF00}»/tirarvip - {CD0000}Para tirar vip de alguém«\n\n");
- strcat(dialogrande, "{FFFF00}»/jetpackv - {CD0000}Para pegar uma mochila voadora«\n\n");
- strcat(dialogrande, "{FFFF00}»/coletev - {CD0000}Para encher seu colete«\n\n");
- strcat(dialogrande, "{FFFF00}»/vidav - {CD0000}Para encher sua vida«\n\n");
- strcat(dialogrande, "{FFFF00}»/criarveh - {CD0000}Para criar um veículo exclusivo«\n\n");
- strcat(dialogrande, "{FFFF00}»/delveh - {CD0000}Para deletar um veículo criado«\n\n");
- strcat(dialogrande, "{FFFF00}»/equiparv - {CD0000}Para pegar um kit de armamento«\n\n");
- strcat(dialogrande, "{FFFF00}»/tunarv - {CD0000}Para tunar seu veículo exclusivo«\n\n");
- strcat(dialogrande, "{FFFF00}»/vips - {CD0000}Para ver a lista de {FFFF00}( Vips )«\n\n");
- strcat(dialogrande, "{FFFF00}»/vipsoff - {CD0000}Lista de todos os {FFFF00}( Vips )«\n\n");
- strcat(dialogrande, "{FFFF00}»/v - {CD0000}Para falar no chat dos {FFFF00}( Vips )«\n\n");
- strcat(dialogrande, "{FFFF00}»/repararv - {CD0000}Para reparar seu veículo {FFFF00}( Vip )«");
- ShowPlayerDialog(playerid, 9997, DIALOG_STYLE_MSGBOX, "Visualizando os comandos {FFFF00}( Vips ).", dialogrande, "Visto", "");
- return 1;
- }
- //============[ Stocks ]=======================//
- stock ArquivoVip(playerid)
- {
- static Arquivo[33]; format(Arquivo, sizeof(Arquivo), "Vips/%s.ini", Nome(playerid)); return Arquivo;
- }
- stock Nome(playerid)
- {
- static Name[MAX_PLAYER_NAME]; GetPlayerName(playerid, Name, sizeof(Name)); return Name;
- }
- stock VerifyExpiredDays(days)
- return (days) < gettime();
- stock ConvertToDays(n)
- {
- #pragma tabsize 0
- new t[5], DString[75];
- t[4] = n-gettime();
- t[0] = t[4] / 3600;
- t[1] = ((t[4] / 60) - (t[0] * 60));
- t[2] = (t[4] - ((t[0] * 3600) + (t[1] * 60)));
- t[3] = (t[0]/24);
- if(t[3] > 0)
- t[0] = t[0] % 24,
- format(DString, sizeof(DString), "%ddias, %02dh %02dm e %02ds", t[3], t[0], t[1], t[2]);
- else if(t[0] > 0)
- format(DString, sizeof(DString), "%02dh %02dm e %02ds", t[0], t[1], t[2]);
- else
- format(DString, sizeof(DString), "%02dm e %02ds", t[1], t[2]);
- return DString;
- }
- //========================[ Fim das stocks/inicio das public ]==========================//
- public MensagemVip(const DString[])
- {
- for(new i = 0; i <= MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i) == 1)
- {
- if(Player[i][Vip] >= 1)
- {
- SendClientMessage(i, CorPrincipal, DString);
- }
- }
- }
- return 1;
- }
- //=========================[ Fim das public/fim do FS ]===============================//
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement