AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   bloodthirsty[Fix] (https://forums.alliedmods.net/showthread.php?t=53829)

Alka 04-11-2007 15:41

bloodthirsty[Fix]
 
1 Attachment(s)
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...

Nican 04-11-2007 17:04

Re: bloodthirsty[Fix]
 
I am not sure why the rounding is ending....

But did you check if the game is not calling the Damage event twice?

Alka 04-11-2007 17:20

Re: bloodthirsty[Fix]
 
Quote:

Originally Posted by Nican (Post 463544)
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!

teame06 04-11-2007 23:30

Re: bloodthirsty[Fix]
 
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.

Alka 04-12-2007 03:07

Re: bloodthirsty[Fix]
 
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);



teame06 04-12-2007 03:17

Re: bloodthirsty[Fix]
 
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);        } }

Alka 04-12-2007 03:18

Re: bloodthirsty[Fix]
 
Thanks...:P :wink: 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!


teame06 04-12-2007 04:06

Re: bloodthirsty[Fix]
 
Quote:

Originally Posted by Alka (Post 463802)
Thanks...:P :wink: 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.

Alka 04-12-2007 04:08

Re: bloodthirsty[Fix]
 
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

teame06 04-12-2007 05:06

Re: bloodthirsty[Fix]
 
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 }


All times are GMT -4. The time now is 06:42.

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