AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Some help... (https://forums.alliedmods.net/showthread.php?t=154911)

talents 04-15-2011 04:29

Some help...
 
1 Attachment(s)
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? :)

Exolent[jNr] 04-15-2011 04:33

Re: Some help...
 
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);     } }

talents 04-15-2011 06:16

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

Bugsy 04-15-2011 08:57

Re: Some help...
 
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);
    }



talents 04-15-2011 13:48

Re: Some help...
 
oh thx very much :)

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

kotinha 04-15-2011 15:21

Re: Some help...
 
use this function
PHP Code:

set_user_rendering(idkRenderFxNone000kRenderTransAlphaINVISIBILITY_HERE

Max is 255

talents 04-16-2011 02:00

Re: Some help...
 
1 Attachment(s)
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

vato loco [GE-S] 04-16-2011 03:43

Re: Some help...
 
1 Attachment(s)
here now it compiler fine

Nyuszy 04-16-2011 03:44

Re: Some help...
 
PHP Code:

RegisterHam(Ham_Spawn"player""fwHamPlayerSpawnPost"1); 

you have this line 2x, but you don't create the fwHamPlayerSpawnPos forward


All times are GMT -4. The time now is 20:00.

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