Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <fun>
- #define PLUGIN "Fragek"
- #define VERSION "1.0"
- #define AUTHOR "mforce"
- #define FEJLOVES_FRAG (1) // az alap +1, tehát 2
- #define KES_FRAG (2) // az alap +2, tehát 3
- // Vedd ki a # elől a // jelet, ha ki akarod íratni chatre is, hogy miért mennyi frag járt.
- //#define CHATRE_IRAS
- #if defined CHATRE_IRAS
- #define PREFIX "Fragek"
- #endif
- public plugin_init() {
- register_plugin(PLUGIN, VERSION, AUTHOR);
- register_event("DeathMsg", "halal", "a")
- }
- public halal() {
- new killer = read_data(1)
- new victim = read_data(2)
- new headshot = read_data(3)
- if(killer != victim) {
- new weapon[32]; read_data(4, weapon, charsmax(weapon));
- format(weapon, charsmax(weapon), "weapon_%s", weapon);
- new weapid = get_weaponid(weapon);
- if(weapid == CSW_KNIFE) keseles_frag(killer);
- else if(headshot) fejes_frag(killer);
- }
- }
- keseles_frag(index) {
- if(!is_user_connected(index)) return;
- set_user_frags(index,get_user_frags(index)+KES_FRAG);
- #if defined CHATRE_IRAS
- ChatColor(index, "!g[%s]!y Kaptál!t %i fraget!y a késelésért!", PREFIX, KES_FRAG+1)
- #endif
- }
- fejes_frag(index) {
- if(!is_user_connected(index)) return;
- set_user_frags(index,get_user_frags(index)+FEJLOVES_FRAG);
- #if defined CHATRE_IRAS
- ChatColor(index, "!g[%s]!y Kaptál!t %i fraget!y a fejlövésért!", PREFIX, FEJLOVES_FRAG+1)
- #endif
- }
- #if defined CHATRE_IRAS
- stock ChatColor(const id, const szMessage[], any:...) {
- static pnum, players[32], szMsg[190], IdMsg;
- vformat(szMsg, charsmax(szMsg), szMessage, 3);
- if(!IdMsg) IdMsg = get_user_msgid("SayText");
- if(id) {
- if(!is_user_connected(id)) return;
- players[0] = id;
- pnum = 1;
- }
- else get_players(players, pnum, "ch");
- for(new i; i < pnum; i++) {
- message_begin(MSG_ONE, IdMsg, .player = players[i]);
- write_byte(players[i]);
- write_string(szMsg);
- message_end();
- }
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment