AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Total Frag count plugin (https://forums.alliedmods.net/showthread.php?t=22018)

DarlD 12-16-2005 19:52

Total Frag count plugin
 
Okay.. i dont get any compile errors. the code prettymuch speaks for itself!

Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #define PLUGIN "Total frag count" #define VERSION "01" #define AUTHOR "Meta" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_event("DeathMsg","OnDeath","bd") } public OnDeath(id)     {     new Text[32]     new Kills = get_user_frags(id)     num_to_str(Kills,Text,31)     set_hudmessage(255, 0, 0, 0.8, 0.86, 0, 6.0, 12.0)     show_hudmessage(id, "Frags:")     set_hudmessage(255, 0, 0, 0.88, 0.86, 0, 6.0, 12.0)     show_hudmessage(id, Text) }

SubFive 12-16-2005 19:54

I don't think
Code:
num_to_str(Kills,Text,31)
is correct.

DarlD 12-16-2005 19:58

Well event the simple Frags: doesnt show up on death

SubFive 12-16-2005 20:00

Quote:

Originally Posted by DarlD
Well event the simple Frags: doesnt show up on death

Is that a typo for even?

Des12 12-16-2005 20:04

Code:
 /* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #define PLUGIN "Total frag count" #define VERSION "01" #define AUTHOR "Meta" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_event("DeathMsg","OnDeath","bd") } public OnDeath(id) {     new Kills = get_user_frags(id)     set_hudmessage(255, 0, 0, 0.8, 0.86, 0, 6.0, 12.0)     show_hudmessage(id, "Frags: %i",Kills) }

DarlD 12-16-2005 20:07

thanks des but it still doesnt show up :S

Cheap_Suit 12-16-2005 20:32

Quote:

register_event( "DeathMsg", "wdeath", "a" ); when you put b there, this function won't be ever executed.
Code:
public plugin_init() {     register_event("DeathMsg","OnDeath","a") } public OnDeath() {     new id = read_data(1)     new Kills = get_user_frags(id)     set_hudmessage(255, 0, 0, 0.8, 0.86, 0, 6.0, 12.0)     show_hudmessage(id, "Frags: %i", Kills) }

XxAvalanchexX 12-16-2005 21:12

DeathMsg is sent to all players at once, therefore it is global. This requires the a flag. The b flag is only used for messages that are sent to one player at a time.

DarlD 12-16-2005 23:17

i see, very helpfull thanks


All times are GMT -4. The time now is 16:09.

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