Raised This Month: $ Target: $400
 0% 

Frag wont update scoreboard


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
--kml--
Senior Member
Join Date: Jan 2009
Old 05-24-2009 , 22:47   Re: Frag wont update scoreboard
Reply With Quote #1

not sure this will work xD


PHP Code:
register_message(get_user_msgid("Damage"),"event_damage_pain","be","2!0","3=0"))
public 
event_damage_pain(id// bot id
{
 if(!
is_user_alive(id))
  return 
PLUGIN_HANDLED
  
 
new attacker get_user_attacker(id)
 if(
is_user_bot(id))
 {
  new 
hp get_user_health(id)
  if(
hp 10000)
  {
   
user_kill(id)
   
set_msg_block(get_user_msgid("DeathMsg"),BLOCK_ONCE)
   new 
frags money
   frags 
get_user_frags(attacker)
   
fm_set_user_frags(attackerfrags+1)
   
money cs_get_user_money(attacker)
   
cs_set_user_money(attackermoney+100)
  }
 }
 return 
PLUGIN_CONTINUE

p.s : im a noob scripter

p.ss : why message? because I THINK not sure it is true or not

register_message is for editing the message.
example : You kill some one than your frag is + by 2

register_event
is for calling the event
example: You kill some 1 then prints at chat that says ZOMG
prints doesnt edit the message

But im not realy sure about this xD
__________________
wooT now is asking season
will ask you plenty of things for learning

Last edited by --kml--; 05-24-2009 at 22:58.
--kml-- is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-24-2009 , 23:11   Re: Frag wont update scoreboard
Reply With Quote #2

Quote:
Originally Posted by --kml-- View Post
not sure this will work xD
No, it won't.
You don't even know how to script properly so why are you providing help?

Your solution is that you didn't the scoreboard.
http://wiki.amxmodx.org/Half-Life_1_...ents#ScoreInfo

Send a ScoreInfo event for the killer with the updated frags.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
dstopgunner
Senior Member
Join Date: Oct 2007
Old 05-25-2009 , 01:52   Re: Frag wont update scoreboard
Reply With Quote #3

Sry im not good at messaging , is the link refering to this?
I add this into the script?
Pls explain how thx.

........
........
..set_msg_block(get_user_msgid("DeathMsg"),BLOCK_ONCE)
message_begin(MSG_ALL, get_user_msgid("DeathMsg"), {0, 0, 0}, 0)
write_byte()
write_byte()
write_byte(1) // 1frag?
message_end()
..new frags , money
dstopgunner is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 05-25-2009 , 03:01   Re: Frag wont update scoreboard
Reply With Quote #4

PHP Code:
message_begin(MSG_BROADCASTget_user_msgid("ScoreInfo"))
write_byte(id// the player you're updating score to...
write_short(get_user_frags(id) + 1// get player's frags and increase them by 1
write_short(get_user_deaths(id)) // death count stays the same
write_short(0// ClassID, this is not for CS, but for TFC and so... I think :}
write_short(get_user_team(id)) // team ID he's in
message_end() 
and you would best cache the value of get_user_msgid()
__________________
Hunter-Digital is offline
dstopgunner
Senior Member
Join Date: Oct 2007
Old 05-26-2009 , 23:39   Re: Frag wont update scoreboard
Reply With Quote #5

Quote:
Originally Posted by Hunter-Digital View Post
PHP Code:
message_begin(MSG_BROADCASTget_user_msgid("ScoreInfo"))
write_byte(id// the player you're updating score to...
write_short(get_user_frags(id) + 1// get player's frags and increase them by 1
write_short(get_user_deaths(id)) // death count stays the same
write_short(0// ClassID, this is not for CS, but for TFC and so... I think :}
write_short(get_user_team(id)) // team ID he's in
message_end() 
and you would best cache the value of get_user_msgid()

tried but not working...
does any event interfere with this code?
dstopgunner is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 05-27-2009 , 00:21   Re: Frag wont update scoreboard
Reply With Quote #6

Yes... itself =) the message just updates the scoreboard, BUT, if you don't set the frags also, at the next scoreboard update (when the player gets killed or kills) it will update the real frags count, this is a working example:
PHP Code:
#include <amxmodx>
#include <fun>
 
new g_msgid_scoreinfo
 
public plugin_init()
{
    
g_msgid_scoreinfo get_user_msgid("ScoreInfo")
 
    
register_clcmd("test""cmd_test")
}
 
public 
cmd_test(id)
{
    new 
frags get_user_frags(id) + 1
 
    set_user_frags
(idfrags)
 
    
message_begin(MSG_ALLg_msgid_scoreinfo)
    
write_byte(id)
    
write_short(frags)
    
write_short(get_user_deaths(id))
    
write_short(0)
    
write_short(get_user_team(id))
    
message_end()
 
    return 
PLUGIN_HANDLED

__________________

Last edited by Hunter-Digital; 05-27-2009 at 00:24.
Hunter-Digital 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 01:31.


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