Raised This Month: $ Target: $400
 0% 

Frag wont update scoreboard


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dstopgunner
Senior Member
Join Date: Oct 2007
Old 05-24-2009 , 10:52   Frag wont update scoreboard
Reply With Quote #1

This plugin adds 10000health to a bot when it spawns (10100health)
and kills it when its health go lower than 10000 . (dont ask why =p)
Yes I have 100$ when I kill the bot BUT my frags didnt +1 imediately but only next round.
I think the set_msg_block(get_user_msgid("DeathMsg"),BLOC K_ONCE) is blocking it can someone help pls.

PHP Code:
register_event("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

dstopgunner is offline
--kml--
Senior Member
Join Date: Jan 2009
Old 05-24-2009 , 22:47   Re: Frag wont update scoreboard
Reply With Quote #2

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 #3

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 #4

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 #5

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 #6

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
--kml--
Senior Member
Join Date: Jan 2009
Old 05-25-2009 , 08:09   Re: Frag wont update scoreboard
Reply With Quote #7

yes im a noob scripter .
i also have a strategy of learning .. instead of making more threads about help in scripting, i will try too help people too .

well this is my strategy

1) i try help some1
2) and i have errors in that post
3) so other people see it
4) they help a bit and fix it and solve the post
5) so i learn
6) thats why i am trying to help while learning
__________________
wooT now is asking season
will ask you plenty of things for learning
--kml-- is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-25-2009 , 08:13   Re: Frag wont update scoreboard
Reply With Quote #8

Bad strategy.
Arkshine is offline
--kml--
Senior Member
Join Date: Jan 2009
Old 05-25-2009 , 08:58   Re: Frag wont update scoreboard
Reply With Quote #9

i already expected that kind of reply . oh well this is my strategy ( my way of learning ) so if You think it is bad then ok.
__________________
wooT now is asking season
will ask you plenty of things for learning
--kml-- is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-25-2009 , 10:45   Re: Frag wont update scoreboard
Reply With Quote #10

I mean if you want help ask it. This section is here for that. If you want to help others, make sure you did answer something correct otherwise don't do that. You will confuse people like that and It will not provide any help. You flood others threads by your "suggestions" and that's not good. It's fine to want to learn but do it properly without interfering with others threads like you do. Create as many threads you want if you want to learn something.
Arkshine 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