Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <DOF2>
- #include <zcmd>
- #include <sscanf>
- #define Maximo_Players 100
- #define Preco_Vip 10
- #define Dial_Vip 7000
- new VIP[Maximo_Players];
- new Fala[128];
- new Nome[24];
- public OnFilterScriptInit()
- {
- print("Ultimate VIP 0.3x iniciado.");
- print("Criador: Biel_COP.");
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("Ultimate VIP 0.3x encerrado.");
- print("Criador: Biel_COP.");
- DOF2_Exit();
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- GetPlayerName(playerid,Nome,sizeof(Nome));
- format(Fala,sizeof(Fala),"Vips/%s.ini",Nome);
- if(DOF2_FileExists(Fala))
- {
- VIP[playerid] = 1;
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid,reason)
- {
- VIP[playerid] = 0;
- GetPlayerName(playerid,Nome,sizeof(Nome));
- format(Fala,sizeof(Fala),"Vips/%s.ini",Nome);
- if(DOF2_FileExists(Fala))
- {
- DOF2_SaveFile();
- }
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- if(VIP[playerid] == 1)
- {
- GameTextForPlayer(playerid,"~r~Voce e um~n~Player VIP~n~Aproveite",5000,3);
- }
- return 1;
- }
- public OnVehicleDamageStatusUpdate(vehicleid,playerid)
- {
- if(VIP[playerid] == 1)
- {
- GameTextForPlayer(playerid,"~r~Veiculo Reparado",1000,3);
- RepairVehicle(vehicleid);
- }
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- if(VIP[playerid] == 1)
- {
- GetPlayerName(playerid,Nome,sizeof(Nome));
- format(Fala,sizeof(Fala),"Vips/%s.ini",Nome);
- if(DOF2_FileExists(Fala))
- {
- new Hoje = getdate();
- new Vencimento = DOF2_GetInt(Fala,"Vencimento");
- new Dias = DOF2_GetInt(Fala,"Dias");
- if(Hoje-Vencimento >= Dias)
- {
- format(Fala,sizeof(Fala),"Olá %s, seu VIP expirou.\n\nPossível motivo: Vencimento.\n\nEsperamos que tenha aproveitado!\n\nPreço do VIP: R$ %d,00",Nome,Preco_Vip);
- ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX,"VIP Expirado",Fala,"Cancelar","");
- RemoverVip(playerid);
- }
- }
- else
- {
- format(Fala,sizeof(Fala),"Olá %s, seu VIP expirou.\n\nPossível motivo: Sua conta na pasta não existe mais.\n\nEsperamos que tenha aproveitado!\n\nPreço do VIP: R$ %d,00",Nome,Preco_Vip);
- ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX,"VIP Expirado",Fala,"Cancelar","");
- RemoverVip(playerid);
- }
- }
- return 1;
- }
- public OnDialogResponse(playerid,dialogid,response,listitem,inputtext[])
- {
- if(dialogid == Dial_Vip)
- {
- if(response)
- {
- if(!strlen(inputtext))
- {
- ShowPlayerDialog(playerid,Dial_Vip,DIALOG_STYLE_MSGBOX,"Bate Papo VIP","Escreva o texto no campo abaixo","Escrever","Cancelar");
- }
- else
- {
- for(new i=0; i<Maximo_Players; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(VIP[i] == 1)
- {
- GetPlayerName(playerid,Nome,sizeof(Nome));
- format(Fala,sizeof(Fala),"VIP %s: %s",Nome,inputtext);
- SendClientMessage(i,0xEDB2DEAA,Fala);
- }
- }
- }
- }
- return 1;
- }
- }
- return 1;
- }
- forward RemoverVip(playerid);
- public RemoverVip(playerid)
- {
- VIP[playerid] = 0;
- GetPlayerName(playerid,Nome,sizeof(Nome));
- format(Fala,sizeof(Fala),"Vips/%s.ini",Nome);
- if(DOF2_FileExists(Fala))
- {
- DOF2_RemoveFile(Fala);
- }
- return 1;
- }
- CMD:vips(playerid)
- {
- SendClientMessage(playerid,0xBFBFBFAA,"Vips Online:");
- for(new i=0; i<Maximo_Players; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(VIP[i] == 1)
- {
- format(Fala,sizeof(Fala),"VIP: %s.",Nome);
- SendClientMessage(playerid,0xBBFF00AA,Fala);
- }
- }
- }
- return 1;
- }
- CMD:armasvip(playerid)
- {
- if(VIP[playerid] == 1)
- {
- SetPlayerHealth(playerid,100.0);
- SetPlayerArmour(playerid,100.0);
- ResetPlayerWeapons(playerid);
- GivePlayerWeapon(playerid,24,700);
- GivePlayerWeapon(playerid,25,300);
- GivePlayerWeapon(playerid,29,500);
- GivePlayerWeapon(playerid,31,500);
- GivePlayerWeapon(playerid,34,100);
- GivePlayerWeapon(playerid,39,50);
- GivePlayerWeapon(playerid,40,50);
- GameTextForPlayer(playerid,"~r~Equipamentos Adquiridos",5000,3);
- }
- return 1;
- }
- CMD:roupavip(playerid,params[])
- {
- new ID;
- if(VIP[playerid] == 1)
- {
- if(!sscanf(params,"d",ID))
- {
- SendClientMessage(playerid,0xBFBFBFAA,"Use: /roupavip ID.");
- return 1;
- }
- if(ID > 299)
- {
- if(ID < 0)
- {
- SendClientMessage(playerid,0xBFBFBFAA,"Roupas de 0 a 299.");
- return 1;
- }
- }
- else
- {
- SetPlayerSkin(playerid,ID);
- GameTextForPlayer(playerid,"~r~Roupa Trocada",5000,3);
- }
- }
- return 1;
- }
- CMD:majvip(playerid)
- {
- if(VIP[playerid] == 1)
- {
- SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USEJETPACK);
- GameTextForPlayer(playerid,"~r~Mochila a Jato~n~Adquirida",5000,3);
- }
- return 1;
- }
- CMD:vip(playerid)
- {
- if(VIP[playerid] == 1)
- {
- ShowPlayerDialog(playerid,Dial_Vip,DIALOG_STYLE_MSGBOX,"Bate Papo VIP","Escreva o texto no campo abaixo","Escrever","Cancelar");
- }
- return 1;
- }
- CMD:bvip(playerid)
- {
- if(VIP[playerid] == 1)
- {
- ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX,"Beneficios VIP","Comando /armasvip disponível para uso.\n\nComando /roupavip disponível para uso.\n\nComando /majvip disponível para uso.\n\nAtendimento mais atencioso.\n\nNome no /vips, com direito ao bate papo.","Cancelar","");
- }
- return 1;
- }
- CMD:creditosvip(playerid)
- {
- ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX,"Ultimate VIP 0.3x","Criado por Biel_COP.\n\nAjuda inicial de Paulo Ricardo.\n\nUV 0.3x criado a partir de vários pedidos de usuários do Fórum Samp.","Cancelar","");
- return 1;
- }
- CMD:ajudavip(playerid)
- {
- if(VIP[playerid] == 1)
- {
- ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX,"Ajuda VIP","/vips, /armasvip, /roupavip\n\n/majvip, /vip, /bvip\n\n/creditosvip, /ajudavip, /planosvip","Cancelar","");
- }
- if(IsPlayerAdmin(playerid))
- {
- SendClientMessage(playerid,0xFFFF00AA,"/darvip, /removervip");
- }
- return 1;
- }
- CMD:planosvip(playerid)
- {
- format(Fala,sizeof(Fala),"O VIP custa R$ %d,00.\n\nAproveite e compre!",Preco_Vip);
- ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX,"Planos VIP",Fala,"Cancelar","");
- return 1;
- }
- CMD:darvip(playerid,params[])
- {
- new ID;
- new Dias;
- if(IsPlayerAdmin(playerid))
- {
- if(!sscanf(params,"dd",ID,Dias))
- {
- SendClientMessage(playerid,0xBFBFBFAA,"Use: /darvip ID Dias.");
- return 1;
- }
- if(!IsPlayerConnected(ID))
- {
- SendClientMessage(playerid,0xBFBFBFAA,"Player não online.");
- return 1;
- }
- else
- {
- if(VIP[ID] == 1)
- {
- SendClientMessage(playerid,0xBFBFBFAA,"O mesmo Já é VIP.");
- return 1;
- }
- else
- {
- GetPlayerName(ID,Nome,sizeof(Nome));
- format(Fala,sizeof(Fala),"Vips/%s.ini",Nome);
- DOF2_CreateFile(Fala);
- DOF2_SetInt(Fala,"Vencimento",getdate());
- DOF2_SetInt(Fala,"Dias",Dias);
- DOF2_SaveFile();
- VIP[ID] = 1;
- format(Fala,sizeof(Fala),"O administrador deu VIP para o player %s por %d dias.",Nome,Dias);
- SendClientMessageToAll(0xFF8080AA,Fala);
- }
- }
- }
- return 1;
- }
- CMD:removervip(playerid,params[])
- {
- new ID;
- if(IsPlayerAdmin(playerid))
- {
- if(!sscanf(params,"d",ID))
- {
- SendClientMessage(playerid,0xBFBFBFAA,"Use: /removervip ID.");
- return 1;
- }
- if(!IsPlayerConnected(ID))
- {
- SendClientMessage(playerid,0xBFBFBFAA,"Player não online.");
- return 1;
- }
- else
- {
- if(VIP[ID] == 0)
- {
- SendClientMessage(playerid,0xBFBFBFAA,"O mesmo não é VIP.");
- return 1;
- }
- else
- {
- GetPlayerName(ID,Nome,sizeof(Nome));
- format(Fala,sizeof(Fala),"Vips/%s.ini",Nome);
- DOF2_RemoveFile(Fala);
- VIP[ID] = 0;
- format(Fala,sizeof(Fala),"O administrador removeu o VIP do player %s.",Nome);
- SendClientMessageToAll(0xFF8080AA,Fala);
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement