Raised This Month: $ Target: $400
 0% 

client_PreThink Crashing Server...


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
BioHazardousWaste
Senior Member
Join Date: Apr 2005
Location: Ontario, Canada =)
Old 04-25-2005 , 17:03   client_PreThink Crashing Server...
Reply With Quote #1

Hey all

I'm just trying to make someone invulnerable for a single shot (telling them they dodged it)... here's my code, not sure how it works. (I tried calling godmode from damageevent, but problem is they already do damage, then damageevent is not called again cuz they are god)

Code:
public client_PreThink(id) {     if(entity_get_int(id, EV_INT_button) & ~IN_ATTACK)    {         new Enemy = id, Victim         new Float:Distance = get_user_aiming(id, Victim)         new EnemyName[34], VictimName[34]                 get_user_name(Enemy, EnemyName, 33)         get_user_name(Victim, VictimName, 33)                 //evade         new DodgeChance = random_num(0, 100)         new DodgeMod = (PlayerSkill[Victim][SKILL_DODGE] - PlayerSkill[Enemy][SKILL_TRUESHOT])                         if(DodgeMod >= DodgeChance)         {             client_print(Victim, print_chat, "You dodged a shot by %s!", EnemyName)             client_print(0, print_console, "DodgeMod(%i)/DodgeChance(%i) = SUCCESS!", DodgeMod, DodgeChance)             client_print(Enemy, print_chat, "%s dodged your shot!", VictimName)                         set_user_godmode (Victim, 1)             return PLUGIN_HANDLED         }         else         {             client_print(0, print_console, "Skill(%i)/DodgeChance(%i) = FAILURE!", PlayerSkill[Victim][SKILL_DODGE], DodgeChance)             set_user_godmode(Victim)                        return PLUGIN_HANDLED         }     } }

Any idea whats wrong/how i can fix it/ a better way to do this?
__________________
"What then is truth? Truths are illusions which we have forgotten are illusions - they are metaphors that have become worn out... this (truth) is the duty to lie according to a fixed convention.

-Friedrich Nietzsche
BioHazardousWaste is offline
Send a message via MSN to BioHazardousWaste
 



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 16:41.


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