Raised This Month: $ Target: $400
 0% 

frags count


Post New Thread Reply   
 
Thread Tools Display Modes
m4st3rxy
Junior Member
Join Date: Mar 2004
Location: Germany
Old 04-20-2004 , 14:20  
Reply With Quote #11

mmhhh this istn working:
Code:
#include <amxmodx> new g_FragsOnDeath[32]; public plugin_init() {    register_plugin("monsterk","1.0","LuNiX")    register_event("DeathMsg", "eDeathMsg", "a")    register_cvar("ismonster","3") } if (lastfrgs == get_cvar_num("ismonster")){    client_print(0,print_chat,"[AMX] blablablabla") } public eDeathMsg(id) {    g_FragsOnDeath[read_data(2)] = get_user_frags(id); } public lastfrgs(id) {    return get_user_frags(id) - g_FragsOnDeath[id]; }

Quote:
monster2.sma(12) : error 010: invalid function or declaration
monster2.sma(12) : error 055: start of function body without function header
m4st3rxy is offline
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 04-20-2004 , 14:29  
Reply With Quote #12

I wouldnt expect it to work; you have an if outside a function.

Btw the func lastfrgs doesnt need to be public..
__________________
hello, i am pm
PM is offline
m4st3rxy
Junior Member
Join Date: Mar 2004
Location: Germany
Old 04-20-2004 , 15:42  
Reply With Quote #13

ok i dont get any errors anymore but nothing happens pls test ist out!
Code:
#include <amxmodx> new g_FragsOnDeath[32]; public plugin_init() {    register_plugin("MOnsterk","1.0","LuNiX")    register_event("DeathMsg", "eDeathMsg", "a")    register_cvar("ismonster","2") } public eDeathMsg(id) {    g_FragsOnDeath[read_data(2)] = get_user_frags(id); } lastfrgs(id) {    if (lastfrgs(id) == get_cvar_num("ismonster")){    client_print(0,print_chat,"[AMX] blablablabla");    return get_user_frags(id) - g_FragsOnDeath[id] }    return PLUGIN_HANDLED }

in game no "[AMX] blablablabla" appears!! whats wrong???
m4st3rxy is offline
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 04-21-2004 , 02:51  
Reply With Quote #14

heh,
a) you dont call lastfrgs
b) better dont, it is an endless recursion atm if you want do say blabla when he did xx kills from last death to this death, try this:

Code:
#include <amxmodx> new g_FragsOnDeath[32]; public plugin_init() {    register_plugin("MOnsterk","1.0","LuNiX")    register_event("DeathMsg", "eDeathMsg", "a")    register_cvar("ismonster","2") } public eDeathMsg(id) {    if ((get_user_frags(id) - g_FragsOnDeath[id]) >= get_cvar_num("ismonster"))    {       client_print(0, print_chat, "[AMX] blablablabla");    }    g_FragsOnDeath[read_data(2)] = get_user_frags(id); }

Not tested tho[/small]
__________________
hello, i am pm
PM is offline
m4st3rxy
Junior Member
Join Date: Mar 2004
Location: Germany
Old 04-21-2004 , 12:11  
Reply With Quote #15

Code:
#include <amxmodx> new g_FragsOnDeath[32]; public plugin_init() {    register_plugin("MOnster","1.0","LuNiX")    register_event("DeathMsg", "eDeathMsg", "a")    register_cvar("ismonster","3") } public eDeathMsg(id) {    if ((get_user_frags(id) - g_FragsOnDeath[id]) >= get_cvar_num("ismonster"))    {       set_hudmessage(0,132,255, 0.02, 0.27, 0, 10.0, 10.04, 0.0, 0.5, 13)       show_hudmessage(0,"MOnster!!!!")       client_cmd(0,"spk fvox/warning")       client_print(0, print_chat, "[AMX] MOnster!!!")    }    g_FragsOnDeath[read_data(2)] = get_user_frags(id); }

it doesnt work (same problem) nothing happens...
maybe the get_cvar_num is not returning a value in that way... but... help pls!
m4st3rxy is offline
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 04-21-2004 , 12:37  
Reply With Quote #16

stupid fault, try this

Code:
#include <amxmodx> new g_FragsOnDeath[32]; public plugin_init() {    register_plugin("MOnster","1.0","LuNiX")    register_event("DeathMsg", "eDeathMsg", "a")    register_cvar("ismonster","3") } public eDeathMsg(id) {    new pid = read_data(2);    if ((get_user_frags(pid) - g_FragsOnDeath[pid]) >= get_cvar_num("ismonster"))    {       set_hudmessage(0,132,255, 0.02, 0.27, 0, 10.0, 10.04, 0.0, 0.5, 13)       show_hudmessage(0,"MOnster!!!!")       client_cmd(0,"spk fvox/warning")       client_print(0, print_chat, "[AMX] MOnster!!!")    }    g_FragsOnDeath[pid] = get_user_frags(pid); }

untested again
__________________
hello, i am pm
PM is offline
m4st3rxy
Junior Member
Join Date: Mar 2004
Location: Germany
Old 04-21-2004 , 14:13  
Reply With Quote #17

OK, now i recieve a message and sound but its so crazy! when u died 2 times, and nextround you kill one person, the sound and the messages appears!! PLS TEST it out!! and look what is wrong! ;)...
or are still probs with the sourcecode?

edit: i see only the HUDmsg when other make the crazy monsterkill!

Code:
#include <amxmodx> new g_FragsOnDeath[32]; public plugin_init() {    register_plugin("Only MOnsterkill","1.0","LuNiX")    register_event("DeathMsg", "eDeathMsg", "a")    register_cvar("ismonster","5") } new Blue[3] = {0,63,191} public eDeathMsg(id) {    new name[32]    get_user_name(id,name,31)    new pid = read_data(2);    if ((get_user_frags(pid) - g_FragsOnDeath[pid]) >= get_cvar_num("ismonster"))    {       set_hudmessage(Blue[0],Blue[1],Blue[2],0.05,0.65,2,0.02,6.0,0.01,0.1,2)       show_hudmessage(0,"%s -> MOnster!!!!",name)       client_cmd(0,"spk misc/monsterkill")       client_print(0, print_chat, "[AMX] MONSTERKILL! %s changed to a Monster since last Death!!!",name)    }    g_FragsOnDeath[pid] = get_user_frags(pid); }
m4st3rxy is offline
SniperBeamer
AMX Mod X Founder
Join Date: Jun 2003
Location: Good Old Europe
Old 04-21-2004 , 14:38  
Reply With Quote #18

this might work:
Code:
#include <amxmodx> new g_FragsOnDeath[32] = { 0, ... } public plugin_init() {    register_plugin("Only MOnsterkill","1.0","LuNiX")    register_event("DeathMsg", "eDeathMsg", "a")    register_cvar("ismonster","5") } new Blue[3] = {0,63,191} public eDeathMsg(id) {    new pid = read_data(2)    if ((get_user_frags(pid) - g_FragsOnDeath[pid]) >= get_cvar_num("ismonster"))    {       new name[32]       get_user_name(pid,name,31)           set_hudmessage(Blue[0],Blue[1],Blue[2],0.05,0.65,2,0.02,6.0,0.01,0.1,2)       show_hudmessage(0,"%s -> MOnster!!!!",name)       client_cmd(0,"spk misc/monsterkill")       client_print(0, print_chat, "[AMX] MONSTERKILL! %s changed to a Monster since last Death!!!",name)    }    g_FragsOnDeath[id] = get_user_frags(id) }
__________________
SniperBeamer is offline
m4st3rxy
Junior Member
Join Date: Mar 2004
Location: Germany
Old 04-21-2004 , 15:02  
Reply With Quote #19

LoL! when you DIE your name appears in the MSGs and the sound is played!
edit:
edit:
Code:
 new pid = read_data(2)
to:
Code:
  new pid = read_data(1)

1) there is still the prob, that you donīt see the HUDmsg when other player make a Monsterkill!
2) when you made a monsterkill (five kills in a row), then you died and after respawning the next frags are ALL a monsterkill?!?! it seems, that "g_FragsOnDeath" wont be saved!!
m4st3rxy is offline
DFA-Haplo
Junior Member
Join Date: Apr 2004
Location: Illinois
Old 04-21-2004 , 16:37  
Reply With Quote #20

I am a new coder trying to learn myself. What I see here:


Code:
   if ((get_user_frags(pid) - g_FragsOnDeath[pid]) >= get_cvar_num("ismonster"))

Tells me once a player gets 5 or more kills it will always play the Monster Kill. There needs to be some way to reset the players frags to 0 after they die. Or if you only want it to play the first time they get 5 total kills the change the code to this:

Code:
 if ((get_user_frags(pid) - g_FragsOnDeath[pid]) == get_cvar_num("ismonster"))

I think what you really want to do is have it say that when a person gets 5 consecutive kills in a row, but I could be wrong.

As for the problem #1. I'm not sure is there a client_print_all function?


ps. I'm trying to learn and would like to say thank you to the dev's that have been helping this guy. you're actually helping more than just him
DFA-Haplo is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:26.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode