hlmod.hu
https://hlmod.hu/

fejlövés + 1 frag
https://hlmod.hu/viewtopic.php?f=9&t=8824
Oldal: 1 / 1

Szerző:  pixxa112 [2013.06.04. 21:56 ]
Hozzászólás témája:  fejlövés + 1 frag

Hali.

Valaki ebbe bele tudja írni, hogy ha valaki lő egy fejest akkor kap +1 fraget.
Előre is köszi:
SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <fakemeta>
  3.  
  4. public plugin_init()
  5. {
  6. register_plugin("fejloves+300","1.0","Eg@r4$il{")
  7. register_event("Damage","event_damage","b","2!0"); // damage event
  8. register_cvar("amx_headshotmoney","300")
  9. }
  10.  
  11. public event_damage(id)
  12. {
  13. if(get_user_health(id)>0)return PLUGIN_CONTINUE
  14.  
  15. new weapon,bodypart,attacker = get_user_attacker(id, weapon, bodypart)
  16. if(get_user_health(id)<=0 && bodypart==1 && get_user_team(id)!=get_user_team(attacker))
  17. {
  18. ShowHud(attacker)
  19. fm_set_user_money(attacker,fm_get_user_money(attacker)+get_cvar_num("amx_headshotmoney")>16000?16000:fm_get_user_money(attacker)+get_cvar_num("amx_headshotmoney"))
  20. return PLUGIN_CONTINUE
  21. }
  22. return PLUGIN_CONTINUE
  23. }
  24.  
  25. stock fm_get_user_money(index)
  26. {
  27. return get_pdata_int(index,115)
  28. }
  29.  
  30. stock fm_set_user_money(index, money, flash = 1)
  31. {
  32. set_pdata_int(index, 115, money);
  33.  
  34. message_begin(MSG_ONE, get_user_msgid("Money"), _, index);
  35. write_long(money);
  36. write_byte(flash ? 1 : 0);
  37. message_end();
  38. }
  39.  
  40. public ShowHud(id)
  41. {
  42. set_hudmessage(255, 20, 147,0.87,0.83,1,3.0,3.0,0.1,0.2,2)
  43. show_hudmessage(id, "+%i$ A fejl:ov'es'ert!",get_cvar_num("amx_headshotmoney")>16000?16000:get_cvar_num("amx_headshotmoney"))
  44. return PLUGIN_CONTINUE
  45. }
  46. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  47. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1053\\ f0\\ fs16 \n\\ par }
  48. */

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