Guest User

Sistema de VIP por level - BY: Fábio Stralioti

a guest
Oct 4th, 2015
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 9.82 KB | None | 0 0
  1. /* FILTERSCRIPT FEITO POR: FÁBIO STRALIOTI
  2.     Projetos & Trabalhos www.fabiostralioti.atwebpages.com
  3.     Curta minha Página https://www.facebook.com/FS-Encomendas-Pawno-162143720796029/timeline/?ref=hl
  4. */
  5.  
  6. #include <a_samp>
  7. #include <zcmd>
  8. #include <sscanf>
  9. #include <dof2>
  10.  
  11. enum pInfo {
  12.     pVip
  13. };
  14. new Stralioti[MAX_PLAYERS][pInfo];
  15. new Float:X, Float:Y, Float:Z, Float: Angle;
  16. new stralioti[128];
  17. new Id;
  18. new Level;
  19. new Texto;
  20.  
  21. #define VIDA 1
  22. #define VEH  2
  23.  
  24. public OnFilterScriptInit()
  25. {
  26.     print("\n--------------------------------------");
  27.     print("Sistema de VIP por leveis feito por: Fábio Stralioti");
  28.     print("--------------------------------------\n");
  29.     return 1;
  30. }
  31.  
  32. public OnPlayerConnect(playerid)
  33. {
  34.     new salvamentovip[34];
  35.     format(salvamentovip, sizeof(salvamentovip), "Vips/%s.ini", PlayerNome(playerid));
  36.     return 1;
  37. }
  38.  
  39. public OnPlayerDisconnect(playerid) {
  40.     new salvamentovip[34];
  41.     format(salvamentovip, sizeof(salvamentovip), "Vips/%s.ini", PlayerNome(playerid));
  42.     if (!DOF2_FileExists(salvamentovip)) {
  43.         DOF2_CreateFile(salvamentovip);
  44.  
  45.         DOF2_SetInt(salvamentovip, "Level", Stralioti[playerid][pVip]);
  46.         DOF2_SaveFile();
  47.     }
  48.     else {
  49.         DOF2_SetInt(salvamentovip, "Level", Stralioti[playerid][pVip]);
  50.         DOF2_SaveFile();
  51.     }
  52.     return 0;
  53. }
  54.  
  55. public OnFilterScriptExit()
  56. {
  57.     DOF2_Exit();
  58.     return 1;
  59. }
  60.  
  61. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  62. {
  63.     if(dialogid == VIDA)
  64.     {
  65.  
  66.         if(response)
  67.         {
  68.  
  69.             if(listitem == 0)
  70.             {
  71.  
  72.                 SetPlayerHealth(playerid, 10);
  73.             }
  74.             if(listitem == 1)
  75.             {
  76.  
  77.                 SetPlayerHealth(playerid, 20);
  78.             }
  79.             if(listitem == 2)
  80.             {
  81.  
  82.                 SetPlayerHealth(playerid, 30);
  83.             }
  84.             if(listitem == 3)
  85.             {
  86.  
  87.                 SetPlayerHealth(playerid, 40);
  88.             }
  89.             if(listitem == 4)
  90.             {
  91.  
  92.                 SetPlayerHealth(playerid, 50);
  93.             }
  94.             if(listitem == 5)
  95.             {
  96.  
  97.                 SetPlayerHealth(playerid, 60);
  98.             }
  99.             if(listitem == 6)
  100.             {
  101.  
  102.                 SetPlayerHealth(playerid, 70);
  103.             }
  104.             if(listitem == 7)
  105.             {
  106.  
  107.                 SetPlayerHealth(playerid, 80);
  108.             }
  109.             if(listitem == 8)
  110.             {
  111.  
  112.                 SetPlayerHealth(playerid, 90);
  113.             }
  114.             if(listitem == 9)
  115.             {
  116.  
  117.                 SetPlayerHealth(playerid, 100);
  118.             }
  119.         }
  120.     }
  121.  
  122.     if(dialogid == VEH)
  123.     {
  124.  
  125.         if(response)
  126.         {
  127.  
  128.             if(listitem == 0)
  129.             {
  130.  
  131.                 GetPlayerPos(playerid, X, Y, Z);
  132.                 GetPlayerFacingAngle(playerid, Angle);
  133.                 CreateVehicle(560, X+5, Y, Z+1, Angle, random(100), random(100), -1);
  134.                 SendClientMessage(playerid, -1,"Você criou um sultan para deleta-lo use /dc");
  135.             }
  136.             if(listitem == 1)
  137.             {
  138.  
  139.                 GetPlayerPos(playerid, X, Y, Z);
  140.                 GetPlayerFacingAngle(playerid, Angle);
  141.                 CreateVehicle(411, X+5, Y, Z+1, Angle, random(100), random(100), -1);
  142.                 SendClientMessage(playerid, -1,"Você criou um infernus para deleta-lo use /dc");
  143.             }
  144.             if(listitem == 2)
  145.             {
  146.  
  147.                 GetPlayerPos(playerid, X, Y, Z);
  148.                 GetPlayerFacingAngle(playerid, Angle);
  149.                 CreateVehicle(522, X+5, Y, Z+1, Angle, random(100), random(100), -1);
  150.                 SendClientMessage(playerid, -1,"Você criou um nrg-500 para deleta-lo use /dc");
  151.             }
  152.             if(listitem == 3)
  153.             {
  154.  
  155.                 GetPlayerPos(playerid, X, Y, Z);
  156.                 GetPlayerFacingAngle(playerid, Angle);
  157.                 CreateVehicle(431, X+5, Y, Z+1, Angle, random(100), random(100), -1);
  158.                 SendClientMessage(playerid, -1,"Você criou um onibus para deleta-lo use /dc");
  159.             }
  160.             if(listitem == 4)
  161.             {
  162.  
  163.                 GetPlayerPos(playerid, X, Y, Z);
  164.                 GetPlayerFacingAngle(playerid, Angle);
  165.                 CreateVehicle(506, X+5, Y, Z+1, Angle, random(100), random(100), -1);
  166.                 SendClientMessage(playerid, -1,"Você criou um super-gt para deleta-lo use /dc");
  167.             }
  168.             if(listitem == 5)
  169.             {
  170.  
  171.                 if(Stralioti[playerid][pVip] <= 2) return SendClientMessage(playerid, -1,"Você não tem VIP level 2");
  172.                 GetPlayerPos(playerid, X, Y, Z);
  173.                 GetPlayerFacingAngle(playerid, Angle);
  174.                 CreateVehicle(434, X+5, Y, Z+1, Angle, random(100), random(100), -1);
  175.                 SendClientMessage(playerid, -1,"Você criou um hotknife para deleta-lo use /dc");
  176.             }
  177.             if(listitem == 6)
  178.             {
  179.  
  180.                 if(Stralioti[playerid][pVip] <= 3) return SendClientMessage(playerid, -1,"Você não tem VIP level 3");
  181.                 GetPlayerPos(playerid, X, Y, Z);
  182.                 GetPlayerFacingAngle(playerid, Angle);
  183.                 CreateVehicle(451, X+5, Y, Z+1, Angle, random(100), random(100), -1);
  184.                 SendClientMessage(playerid, -1,"Você criou um turismo para deleta-lo use /dc");
  185.             }
  186.             if(listitem == 7)
  187.             {
  188.  
  189.                 if(Stralioti[playerid][pVip] <= 3) return SendClientMessage(playerid, -1,"Você não tem VIP level 3");
  190.                 GetPlayerPos(playerid, X, Y, Z);
  191.                 GetPlayerFacingAngle(playerid, Angle);
  192.                 CreateVehicle(520, X+5, Y, Z+1, Angle, random(100), random(100), -1);
  193.                 SendClientMessage(playerid, -1,"Você criou um hydra para deleta-lo use /dc");
  194.             }
  195.             if(listitem == 8)
  196.             {
  197.  
  198.                 if(Stralioti[playerid][pVip] <= 3) return SendClientMessage(playerid, -1,"Você não tem VIP level 3");
  199.                 GetPlayerPos(playerid, X, Y, Z);
  200.                 GetPlayerFacingAngle(playerid, Angle);
  201.                 CreateVehicle(535, X+5, Y, Z+1, Angle, random(100), random(100), -1);
  202.                 SendClientMessage(playerid, -1,"Você criou um Slamvan para deleta-lo use /dc");
  203.             }
  204.         }
  205.     }
  206.     return 1;
  207. }
  208.  
  209. CMD:setvip(playerid, params[]) {
  210.     new straliotii[128];
  211.     if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Você não é um Administrador Logado na RCON");
  212.     if(sscanf(params, "ud", Id, Level)) return SendClientMessage(playerid, -1,"Use: /setvip [id][Level]");
  213.     if(Level < 0 || Level > 3) return SendClientMessage(playerid, -1, "Level inválido use de 1 á 3");
  214.     if(!IsPlayerConnected(Id)) return SendClientMessage(playerid, -1, "Este jogador não está online");
  215.     format(straliotii, sizeof(straliotii), "O %s deu VIP para o %s Level: %s", PlayerNome(playerid), PlayerNome(Id), Level);
  216.     SendClientMessageToAll(-1, straliotii);
  217.     Stralioti[Id][pVip] =  Level;
  218.     return 1;
  219. }
  220.  
  221. CMD:pegarvida(playerid) {
  222.     if(Stralioti[playerid][pVip] <= 0) return SendClientMessage(playerid, -1,"Você não é um player VIP");
  223.     ShowPlayerDialog(playerid, VIDA, DIALOG_STYLE_LIST, "Vidas", "10%\n20%\n30%\n40%\n50%\n60%\n70%\n80%\n90%\n100%", "Escolher", "Sair");
  224.     return 1;
  225. }
  226.  
  227. CMD:chatvip(playerid, params[]) {
  228.     new texto;
  229.     if(Stralioti[playerid][pVip] <= 0) return SendClientMessage(playerid, -1,"Você não é um player VIP");
  230.     {
  231.  
  232.         for( new i; i < MAX_PLAYERS; i++ ) {
  233.             if(sscanf(params, "s", texto)) return SendClientMessage(playerid, -1,"Use /chatvip [texto]");
  234.             format(stralioti, sizeof(stralioti),"Chat Vip: %s: %s", PlayerNome(playerid),texto);
  235.             SendClientMessage(i,-1,stralioti);
  236.         }
  237.     }
  238.     return 1;
  239. }
  240.  
  241. CMD:veh(playerid) {
  242.     if(Stralioti[playerid][pVip] <= 0) return SendClientMessage(playerid, -1,"Você não é um player VIP");
  243.     ShowPlayerDialog(playerid, VEH, DIALOG_STYLE_LIST, "VEH", "Sultan\nInfernus\nNRG-500\nOnibus\nSuper-GT\nHotknife\nTurismo\nHydra\nSlamvan", "Escolher", "Sair");
  244.     return 1;
  245. }
  246.  
  247. CMD:dc(playerid) {
  248.     if(Stralioti[playerid][pVip] <= 0) return SendClientMessage(playerid, -1,"Você não é um player VIP");
  249.     if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1,"Você não está em um veículo");
  250.     new veiculo;
  251.     veiculo = GetPlayerVehicleID(playerid);
  252.     DestroyVehicle(veiculo);
  253.     SendClientMessage(playerid, -1,"Você deletou o veiculo");
  254.     return 1;
  255. }
  256.  
  257. CMD:jetpack(playerid) {
  258.     if(Stralioti[playerid][pVip] <= 0) return SendClientMessage(playerid, -1,"Você não é um player VIP");
  259.     SetPlayerSpecialAction(playerid, 2);
  260.     format(stralioti, sizeof(stralioti),"O VIP %s criou um jetpack", PlayerNome(playerid));
  261.     SendClientMessageToAll(-1, stralioti);
  262.     return 1;
  263. }
  264.  
  265. CMD:asay(playerid, params[]) {
  266.     if(Stralioti[playerid][pVip] <= 0) return SendClientMessage(playerid, -1,"Você não é um player VIP");
  267.     if(sscanf(params, "us", Id, Texto)) return SendClientMessage(playerid, -1,"Use /asay [texto]");
  268.     format(stralioti, sizeof(stralioti),"[VIP]: %s: %s", PlayerNome(playerid), Texto);
  269.     SendClientMessageToAll(-1, stralioti);
  270.     return 1;
  271. }
  272.  
  273. CMD:reparar(playerid) {
  274.     if(Stralioti[playerid][pVip] <= 0) return SendClientMessage(playerid, -1,"Você não é um player VIP");
  275.     if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1,"Você não está em um veículo");
  276.     format(stralioti, sizeof(stralioti), "O VIP %s reparou o veículo", PlayerNome(playerid));
  277.     SendClientMessage(playerid, -1, stralioti);
  278.     RepairVehicle(GetPlayerVehicleID(playerid));
  279.     return 1;
  280. }
  281.  
  282. CMD:godcar(playerid) {
  283.     if(Stralioti[playerid][pVip] <= 2) return SendClientMessage(playerid, -1,"Você não é um player VIP");
  284.     if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1,"Você não está em um veículo");
  285.     format(stralioti, sizeof(stralioti), "O VIP %s transformou seu veículo indestrutivel", PlayerNome(playerid));
  286.     SendClientMessage(playerid, -1, stralioti);
  287.     SetVehicleHealth(GetPlayerVehicleID(playerid), 99999999);
  288.     return 1;
  289. }
  290.  
  291. CMD:vips(playerid, params[]) {
  292.     new count;
  293.     for(new i = 0; i < MAX_PLAYERS; i++)
  294.     {
  295.  
  296.         if(Stralioti[i][pVip] > 0)
  297.         {
  298.  
  299.             if(IsPlayerConnected(i))
  300.             {
  301.  
  302.                 format(stralioti, sizeof(stralioti),"Vip %s nível %d", PlayerNome(i), Level);
  303.                 SendClientMessage(playerid, -1, stralioti);
  304.                 count++;
  305.             }
  306.         }
  307.     }
  308.     if(count == 0)
  309.     return SendClientMessage(playerid, -1, "Não tem nenhum player vip online");
  310.     return 1;
  311. }
  312.  
  313. CMD:virar(playerid, params[]) {
  314.     if(Stralioti[playerid][pVip] <= 3) return SendClientMessage(playerid, -1,"Você não é um player VIP");
  315.     if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1,"Você não está em um veículo");
  316.     SetCameraBehindPlayer(playerid);
  317.     GetPlayerPos(playerid, X, Y, Z);
  318.     SetVehiclePos(GetPlayerVehicleID(playerid), X, Y, Z);
  319.     SetVehicleZAngle(GetPlayerVehicleID(playerid), 0);
  320.     return 1;
  321. }
  322.  
  323. PlayerNome(playerid) {
  324.     new nomeplayer[MAX_PLAYER_NAME];
  325.     GetPlayerName(playerid, nomeplayer, sizeof(nomeplayer));
  326.     return nomeplayer;
  327. }
Advertisement
Add Comment
Please, Sign In to add comment