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

Some help...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
talents
Member
Join Date: Feb 2011
Location: Romania
Old 04-15-2011 , 04:29   Some help...
Reply With Quote #1

I need some help with a plugin...
i want to put damage x 3 to a knife.. but on server when i kill someone in the top in right it looks that he kiled his self...
i mean he hasn t been killed by me... .. by a knife is killed

Could someone help me?
Attached Files
File Type: sma Get Plugin or Get Source (BaseBuilder_Vip.sma - 524 views - 10.6 KB)
__________________


talents is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-15-2011 , 04:33   Re: Some help...
Reply With Quote #2

Do it this way:

Code:
public plugin_init() {     RegisterHam(Ham_TakeDamage, "player", "FwdPlayerDamage"); } public FwdPlayerDamage(victim, inflictor, attacker, Float:damage, damagebits) {     if(inflictor == attacker     && attacker != victim     && is_user_alive(attacker)     && get_user_weapon(attacker) == CSW_KNIFE)     {         SetHamParamFloat(4, damage * 3.0);     } }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
talents
Member
Join Date: Feb 2011
Location: Romania
Old 04-15-2011 , 06:16   Re: Some help...
Reply With Quote #3

oh thx a lot but i want to have damage x 3 only at Bloody knife not at all knifes.. can you do this?
__________________


talents is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-15-2011 , 08:57   Re: Some help...
Reply With Quote #4

Assuming g_bHasKnife[] is the bool for if the player has bloody knife.
PHP Code:
public FwdPlayerDamage(victiminflictorattackerFloat:damagedamagebits)
{
    if(
inflictor == attacker
    
&& attacker != victim
    
&& g_bHasKnifeattacker 
    && 
is_user_alive(attacker)
    && 
get_user_weapon(attacker) == CSW_KNIFE )
    {
        
SetHamParamFloat(4damage 3.0);
    }

__________________
Bugsy is offline
talents
Member
Join Date: Feb 2011
Location: Romania
Old 04-15-2011 , 13:48   Re: Some help...
Reply With Quote #5

oh thx very much

how can i put invisibility on who have the knife? please
__________________


talents is offline
kotinha
Senior Member
Join Date: Jun 2009
Location: Alentejo, Portugal :)
Old 04-15-2011 , 15:21   Re: Some help...
Reply With Quote #6

use this function
PHP Code:
set_user_rendering(idkRenderFxNone000kRenderTransAlphaINVISIBILITY_HERE
Max is 255
__________________
"If God exists, I hope he has a good excuse." - Woody Allen
kotinha is offline
talents
Member
Join Date: Feb 2011
Location: Romania
Old 04-16-2011 , 02:00   Re: Some help...
Reply With Quote #7

i have some errors in the logs:
with debug:
HTML Code:
L 04/16/2011 - 08:58:28: [HAMSANDWICH] Function fwHamPlayerSpawnPost not found.
L 04/16/2011 - 08:58:28: [AMXX] Displaying debug trace (plugin "BaseBuilder_Vip.amxx")
L 04/16/2011 - 08:58:28: [AMXX] Run time error 10: native error (native "RegisterHam")
L 04/16/2011 - 08:58:28: [AMXX]    [0] BaseBuilder_Vip.sma::plugin_init (line 59)
with out debug:
HTML Code:
L 04/16/2011 - 08:33:16: [HAMSANDWICH] Function fwHamPlayerSpawnPost not found.
L 04/16/2011 - 08:33:16: [AMXX] Run time error 10 (plugin "BaseBuilder_Vip.amxx") (native "RegisterHam") - debug not enabled!
L 04/16/2011 - 08:33:16: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 04/16/2011 - 08:58:28: Start of error session.
edit:
never mind i solved it

thanks all
Attached Files
File Type: sma Get Plugin or Get Source (BaseBuilder_Vip.sma - 470 views - 11.7 KB)
__________________



Last edited by talents; 04-16-2011 at 03:21. Reason: solved
talents is offline
vato loco [GE-S]
Veteran Member
Join Date: Oct 2006
Location: Germany
Old 04-16-2011 , 03:43   Re: Some help...
Reply With Quote #8

here now it compiler fine
Attached Files
File Type: sma Get Plugin or Get Source (BaseBuilder_Vip.sma - 505 views - 10.4 KB)
__________________

Last edited by vato loco [GE-S]; 04-16-2011 at 03:47.
vato loco [GE-S] is offline
Nyuszy
Senior Member
Join Date: Apr 2009
Old 04-16-2011 , 03:44   Re: Some help...
Reply With Quote #9

PHP Code:
RegisterHam(Ham_Spawn"player""fwHamPlayerSpawnPost"1); 
you have this line 2x, but you don't create the fwHamPlayerSpawnPos forward
Nyuszy 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:09.


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