hlmod.hu
https://hlmod.hu/

Halal Event(Pont levonas)
https://hlmod.hu/viewtopic.php?f=9&t=24477
Oldal: 1 / 1

Szerző:  Pardon [2016.03.30. 21:40 ]
Hozzászólás témája:  Halal Event(Pont levonas)

  1. #include <amxmodx>
  2.  
  3. #pragma semicolon 1
  4.  
  5. new Pont[33];
  6. new const Prefix[] = "[Daemon Mod 1.0]";
  7.  
  8. public plugin_init()
  9. {
  10.     register_plugin("Daemon Mods", "1.0", "Pardon.");
  11.    
  12.     register_event("DeathMsg", "g_Halal", "a");
  13. }
  14. public g_Halal()
  15. {
  16.     new Gyilkos = read_data(1);
  17.     new Aldozat = read_data(2);
  18.    
  19.     if(Gyilkos != Aldozat && read_data(3))
  20.     {
  21.         Pont[Gyilkos] += 2;
  22.         client_printcolor(Gyilkos, "!g%s !tFEJLÖVÉS! !nEzért !g+2 !nPontod kaptál!g!", Prefix);
  23.     }
  24.     else if(Gyilkos != Aldozat)
  25.     {
  26.         Pont[Gyilkos] ++;
  27.         client_printcolor(Gyilkos, "!g%s !nEzért !g+1 !nPontod kaptál!g!", Prefix);
  28.     }
  29. }
  30. stock client_printcolor(const id, const input[], any:...)
  31. {
  32.         new count = 1, players[32];
  33.         static msg[191];
  34.         vformat(msg, 190, input, 3);
  35.  
  36.         replace_all(msg, 190, "!g", "^4");
  37.         replace_all(msg, 190, "!n", "^1");
  38.         replace_all(msg, 190, "!t", "^3");    
  39.  
  40.         if (id) players[0] = id; else get_players(players, count, "ch")
  41.         {
  42.                 for (new i = 0; i < count; i++)
  43.                 {
  44.                         if (is_user_connected(players[i]))
  45.                         {
  46.                                 message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
  47.                                 write_byte(players[i]);
  48.                                 write_string(msg);
  49.                                 message_end();
  50.                         }
  51.                 }
  52.         }
  53.         return PLUGIN_HANDLED;
  54. }


Sziasztok ebben hogy birom lekerni azt hogy pl: ha en meghalok akkor levegyen 2 Pontod? Aki megcsinalja/segit megy a gomb
Elore is koszonom.

Szerző:  demon [2016.03.31. 00:10 ]
Hozzászólás témája:  Re: Halal Event(Pont levonas)

  1. #include <amxmodx>
  2.  
  3. #pragma semicolon 1
  4.  
  5. new Pont[33];
  6. new const Prefix[] = "[Daemon Mod 1.0]";
  7.  
  8. public plugin_init()
  9. {
  10.     register_plugin("Daemon Mods", "1.0", "Pardon.");
  11.    
  12.     register_event("DeathMsg", "g_Halal", "a");
  13. }
  14. public g_Halal()
  15. {
  16.     new Gyilkos = read_data(1);
  17.     new Aldozat = read_data(2);
  18.     if(Gyilkos != Aldozat)
  19.     {
  20.         if(read_data(3))
  21.         {
  22.             Pont[Gyilkos] += 2;
  23.             client_printcolor(Gyilkos, "!g%s !tFEJLÖVÉS! !nEzért !g+2 !nPontod kaptál!g!", Prefix);
  24.         }
  25.         else
  26.         {
  27.             Pont[Gyilkos] ++;
  28.             client_printcolor(Gyilkos, "!g%s !nEzért !g+1 !nPontod kaptál!g!", Prefix);
  29.         }
  30.         Pont[Aldozat] -= (Pont[Aldozat] >= 2) ? 2 : 0; //Azért így, hogy ne menjen a pontja 0-tól lejjebb
  31.     }
  32. }
  33. stock client_printcolor(const id, const input[], any:...)
  34. {
  35.         new count = 1, players[32];
  36.         static msg[191];
  37.         vformat(msg, 190, input, 3);
  38.  
  39.         replace_all(msg, 190, "!g", "^4");
  40.         replace_all(msg, 190, "!n", "^1");
  41.         replace_all(msg, 190, "!t", "^3");    
  42.  
  43.         if (id) players[0] = id; else get_players(players, count, "ch")
  44.         {
  45.                 for (new i = 0; i < count; i++)
  46.                 {
  47.                         if (is_user_connected(players[i]))
  48.                         {
  49.                                 message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
  50.                                 write_byte(players[i]);
  51.                                 write_string(msg);
  52.                                 message_end();
  53.                         }
  54.                 }
  55.         }
  56.         return PLUGIN_HANDLED;
  57. }

Oldal: 1 / 1 Minden időpont UTC+02:00 időzóna szerinti
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/