Raised This Month: $ Target: $400
 0% 

bloodthirsty[Fix]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 04-11-2007 , 15:41   bloodthirsty[Fix]
Reply With Quote #1

hi.This is the plugin =>> but...have some problems...
1.I put cvar "bt_healthreduction 2" and my health is reducting with 4 ,if i put cvar 1 my health is reducting with 2...
2.If i hit a player with knife and round is ending...next round he continue to bleeding but i don't want that!

Thanks...
Attached Files
File Type: sma Get Plugin or Get Source (blood_thirsty.sma - 660 views - 3.2 KB)
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
Nican
Veteran Member
Join Date: Jan 2006
Location: NY
Old 04-11-2007 , 17:04   Re: bloodthirsty[Fix]
Reply With Quote #2

I am not sure why the rounding is ending....

But did you check if the game is not calling the Damage event twice?
__________________
http://www.nican132.com
I require reputation!
Nican is offline
Send a message via ICQ to Nican Send a message via MSN to Nican
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 04-11-2007 , 17:20   Re: bloodthirsty[Fix]
Reply With Quote #3

Quote:
Originally Posted by Nican View Post
I am not sure why the rounding is ending....

But did you check if the game is not calling the Damage event twice?
1.Is ending because the time is up...
2.No check but dunno where my problem is!
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
Old 04-11-2007, 23:27
Deviance
This message has been deleted by Deviance. Reason: ...
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 04-11-2007 , 23:30   Re: bloodthirsty[Fix]
Reply With Quote #4

Your going to have to detect round end. Then loop through the players who are connected to the server and do a remove_task. Cause Your using ResetHUD and it way to late.
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 04-12-2007 , 03:07   Re: bloodthirsty[Fix]
Reply With Quote #5

something like this?
PHP Code:
public plugin_init() {
 
  
register_logevent("event_round_end"2"1=Round_End");
  
register_logevent("event_round_end"2"1&Restart_Round_");
}
 
public 
event_round_end(victim) {
 
       
remove_task(victim+35435);

__________________
Still...lovin' . Connor noob! Hello
Alka is offline
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 04-12-2007 , 03:17   Re: bloodthirsty[Fix]
Reply With Quote #6

Code:
public plugin_init() {     register_logevent("event_round_end", 2, "1=Round_End");   register_logevent("event_round_end", 2, "1&Restart_Round_"); }   public event_round_end(victim) {        new players[32], nums;        get_players(players, nums);        for(new i = 0; i < nums; i++)        {               remove_task(players[i]+35435);        } }
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 04-12-2007 , 03:18   Re: bloodthirsty[Fix]
Reply With Quote #7

Thanks... But are 2 problems:
1.When the round is end,i stop bleeding but next round i start again to bleeding!
2.
Code:
L 04/12/2007 - 10:29:08: Invalid player id 0
L 04/12/2007 - 10:29:08: [AMXX] Run time error 10 (plugin "blood_thirsty.amxx") (native "get_user_weapon") - debug not enabled!
__________________
Still...lovin' . Connor noob! Hello

Last edited by Alka; 04-12-2007 at 03:26.
Alka is offline
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 04-12-2007 , 04:06   Re: bloodthirsty[Fix]
Reply With Quote #8

Quote:
Originally Posted by Alka View Post
Thanks... But are 2 problems:
1.When the round is end,i stop bleeding but next round i start again to bleeding!
2.
Code:
L 04/12/2007 - 10:29:08: Invalid player id 0
L 04/12/2007 - 10:29:08: [AMXX] Run time error 10 (plugin "blood_thirsty.amxx") (native "get_user_weapon") - debug not enabled!
you need to check if the attack is connected with is_user_connected. I don't see why it start up again. I see nothing in your code for it to start up again on the next round.
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 04-12-2007 , 04:08   Re: bloodthirsty[Fix]
Reply With Quote #9

1.Thanks...
2.Is strange....dunno why is starting again!

This realy s***s
PHP Code:
public hook_damage(id)
{
 if(
is_user_connected(id))
  return 
PLUGIN_CONTINUE;
 
 new 
attacker get_user_attacker(id)
 new 
tempweapon get_user_weapon(attackertemptemp);
 
 if(
weapon != CSW_KNIFE)
  return; 
//line 64
 
 
if(get_pcvar_num(toggle_plugin) == 1) {  
  
  
set_task(1.0,"victim_stuff"id+35435,"",0"b")
 }
 return 
PLUGIN_CONTINUE//line 70

Error:
*Error: Function uses both "return" and "return <value>" on line 70
*Warning: Function "hook_damage" should return a value on line 64
__________________
Still...lovin' . Connor noob! Hello

Last edited by Alka; 04-12-2007 at 04:13.
Alka is offline
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 04-12-2007 , 05:06   Re: bloodthirsty[Fix]
Reply With Quote #10

Code:
public hook_damage(id) {  if(!is_user_connected(id))   return PLUGIN_CONTINUE;    new attacker = get_user_attacker(id)  if(!is_user_connected(attacker))   return PLUGIN_CONTINUE;  new temp, weapon = get_user_weapon(attacker, temp, temp);    if(weapon != CSW_KNIFE)   return PLUGIN_CONTINUE; //line 64    if(get_pcvar_num(toggle_plugin) == 1) {       set_task(1.0,"victim_stuff", id+35435,"",0, "b")  }  return PLUGIN_CONTINUE; //line 70 }
__________________
No private support via Instant Message
GunGame:SM Released

Last edited by teame06; 04-12-2007 at 13:42.
teame06 is offline
Send a message via AIM to teame06
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 06:42.


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