Raised This Month: $ Target: $400
 0% 

This does nothing, but should do something...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hippo.exe
Junior Member
Join Date: Sep 2006
Old 10-13-2006 , 05:12   This does nothing, but should do something...
Reply With Quote #1

Code:
 
public event_limit(id)
{
 new g_hp
 g_hp = get_user_health(id)
 new y = g_damage_taken[id]
 if (y > (g_hp))
 {
  (y = (g_hp))
 }
 return PLUGIN_CONTINUE;
}
Anyone see anything wrong with this... I've compiled this with the rest of the script and it doesnt limit the damage.. any ideas? Thanks all for helping
hippo.exe is offline
Silencer123
Veteran Member
Join Date: Jul 2006
Old 10-13-2006 , 07:07   Re: This does nothing, but should do something...
Reply With Quote #2

It is an Event, not a Forward, also I do not see where you change g_damage_taken.
__________________
EAT YOUR VEGGIES
Silencer123 is offline
hippo.exe
Junior Member
Join Date: Sep 2006
Old 10-13-2006 , 08:05   Re: This does nothing, but should do something...
Reply With Quote #3

what do you mean?
Quote:
It is an Event, not a Forward, also I do not see where you change g_damage_taken.
hippo.exe is offline
Silencer123
Veteran Member
Join Date: Jul 2006
Old 10-13-2006 , 08:27   Re: This does nothing, but should do something...
Reply With Quote #4

Well it might be wrong what I say. I suggest you ALWAYS give the whole Code.
You got to do so anyways when you are making a Plugin public.
__________________
EAT YOUR VEGGIES
Silencer123 is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 10-13-2006 , 10:50   Re: This does nothing, but should do something...
Reply With Quote #5

Quote:
This does nothing, but should do something...
the only thing this function does is giving the temp variable y a value
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
Rolnaaba
Veteran Member
Join Date: May 2006
Old 10-13-2006 , 10:51   Re: This does nothing, but should do something...
Reply With Quote #6

thats what I thought, since he didnt post all code it seems that y doesn't actually stand for anyhting unless that g_damage_taken[] variable is something he didnt post
__________________
DO NOT PM me about avp mod.
Rolnaaba is offline
Silencer123
Veteran Member
Join Date: Jul 2006
Old 10-13-2006 , 14:25   Re: This does nothing, but should do something...
Reply With Quote #7

Yeah, learn how to get Help, hippo.exe.
If you only give us ten Lines of a big Plugin
we cannot help you, except those Lines
are completely independent. (Those aren't)
We can't help lazy People.
We won't help dumb People.
(There I make a difference
between dumb and unexperienced)
__________________
EAT YOUR VEGGIES

Last edited by Silencer123; 10-13-2006 at 14:27.
Silencer123 is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 10-13-2006 , 16:50   Re: This does nothing, but should do something...
Reply With Quote #8

I don't think you really understand how this works.

Basically, AMXX will provide you with the information you need to change things, but in order to formally change them you need to call natives.

In this case, you are just copying the information and then leaving it, thus your calculations are not needed. In order to reduce damage, you would have to change the Damage event's parameters, and also call set_user_health (or equivalent).
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
hippo.exe
Junior Member
Join Date: Sep 2006
Old 10-13-2006 , 17:15   Re: This does nothing, but should do something...
Reply With Quote #9

Well... I am a noob.. so Thank you for all your imput guys/gals.
hippo.exe 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 04:54.


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