Raised This Month: $51 Target: $400
 12% 

(Upgrade Mods) Give EXP per x damage...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DSASDFGH
Senior Member
Join Date: Jul 2011
Location: Facebook
Old 07-10-2011 , 06:25   (Upgrade Mods) Give EXP per x damage...
Reply With Quote #1

hi, i'm modifying upgrade mods by cheap_suit for my zp server.
can you help me?

PHP Code:

public forward_takedamage(victiminflictorattackerFloat:damagedamage_type
{
 if(
victim == attacker || !is_user_connected(attacker)) return HAM_IGNORED
 
 
if(30 <= damageadd_experience(attacker3)
 return 
HAM_IGNORED
 
if(50 <= damageadd_experience(attacker5)
 return 
HAM_IGNORED
 
if(80 <= damageadd_experience(attacker8)
 return 
HAM_IGNORED
 
return HAM_IGNORED

i want to give experience per x damages...
DSASDFGH is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 07-10-2011 , 06:56   Re: (Upgrade Mods) Give EXP per x damage...
Reply With Quote #2

Check if the plugin you are modifying has the maximum amount of players stored to a variable. ( In here I call it gMaxPlayers )
Code:
public forward_takedamage(victim, inflictor, attacker, Float:damage, damage_type) {      if( 1 <= attacker <= gMaxPlayers && attacker != victim )           add_experience( attacker, floatround( damage / 10 ) );         return HAM_IGNORED }
SnoW is offline
Send a message via MSN to SnoW
DSASDFGH
Senior Member
Join Date: Jul 2011
Location: Facebook
Old 07-10-2011 , 09:47   Re: (Upgrade Mods) Give EXP per x damage...
Reply With Quote #3

Quote:
Originally Posted by SnoW View Post
Check if the plugin you are modifying has the maximum amount of players stored to a variable. ( In here I call it gMaxPlayers )

Code:
public forward_takedamage(victim, inflictor, attacker, Float:damage, damage_type) </p><p>{</p><p> if( 1 <= attacker <= gMaxPlayers && attacker != victim )</p><p> add_experience( attacker, floatround( damage / 10 ) ); </p><p>&nbsp;</p><p> return HAM_IGNORED</p><p>}
Thank you man!
DSASDFGH 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 19:12.


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