Advertisement
Lucas_Alemao

Sistema de recompensas by Lucas_Alemao

Apr 1st, 2012
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.96 KB | None | 0 0
  1. /*
  2.  
  3.          SISTEMA DE RECOMPENSAS
  4.             By:Lucas_Alemao
  5.                   ou
  6.               [iPs]Lucas
  7. */
  8.  
  9.  
  10. #include a_samp
  11. #include zcmd
  12.  
  13. //Defina o valor inicial da recomepnsa.
  14. #define     VALOR_INICIAL 1200
  15.  
  16. #define GetarDado(%0,%1) %1[%0]
  17.  
  18. const Verde = 0x12C41E96;
  19.  
  20. new Recompensa[MAX_PLAYERS];
  21. new Matou[MAX_PLAYERS];
  22. new Seguidos[MAX_PLAYERS];
  23. new str[256];
  24.  
  25. public OnFilterScriptInit()
  26. {
  27.     print("\n\nFS de recompensas By [iPs]Lucas carregado com sucesso\n\n");
  28.     return 1;
  29. }
  30.  
  31. public OnPlayerConnect(playerid)
  32. {
  33.     Recompensa[playerid] = 0;
  34.     Matou[playerid] = 0;
  35.     Seguidos[playerid] = 0;
  36.     return 1;
  37. }
  38.  
  39. public OnPlayerDeath(playerid, killerid, reason)
  40. {
  41.     Matou[killerid]++;
  42.     Matou[playerid] = 0;
  43.     Seguidos[killerid]++;
  44.     if(GetarDado(killerid, Matou) == 1)
  45.     {
  46.         Recompensa[killerid] = VALOR_INICIAL;
  47.     }
  48.     else if(GetarDado(killerid, Seguidos) >= 5)
  49.     {
  50.         format(str, sizeof(str), "[ATENÇÃO] O Jogador {0EF01D}%s{12C41E} ja matou %d pessoas consecutivas. Sua cabeça está valendo $%d.", Nome(killerid), GetarDado(killerid, Matou), GetarDado(killerid, Recompensa));
  51.         SendClientMessageToAll(Verde, str);
  52.         Recompensa[killerid] = Recompensa[killerid]*2;
  53.         Seguidos[killerid] = 0;
  54.     }
  55.     if(GetarDado(playerid, Recompensa) > 0)
  56.     {
  57.         GivePlayerMoney(killerid, Recompensa[playerid]);
  58.         format(str, sizeof(str), "[ATENÇÃO] O Jogador {0EF01D}%s{12C41E} Matou {0EF01D}%s{12C41E} e ganhou uma recompensa de $%d.", Nome(killerid), Nome(playerid), GetarDado(playerid, Recompensa));
  59.         SendClientMessageToAll(Verde, str);
  60.         Recompensa[playerid] = 0;
  61.     }
  62. }
  63.  
  64. CMD:cabecas(playerid)
  65. {
  66.     for(new i = 0; i < MAX_PLAYERS; ++i)
  67.     {
  68.         if(Matou[i] >= 5)
  69.         {
  70.             format(str, sizeof(str), "%s - $%d - Matou: %d", Nome(i), GetarDado(i, Recompensa), GetarDado(i, Matou));
  71.             SendClientMessage(playerid, Verde, str);
  72.         }
  73.     }
  74.     return 1;
  75. }
  76.  
  77. stock Nome(playerid)
  78. {
  79.     new pname[24];
  80.     GetPlayerName(playerid, pname, 24);
  81.     return pname;
  82. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement