AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [SOLVED][Help] Block Kill Frag ? (https://forums.alliedmods.net/showthread.php?t=236081)

dias 02-26-2014 22:07

[SOLVED][Help] Block Kill Frag ?
 
I want to block the kill frag... So that when i kill an enemy, my Kill Score is still +0 instead of +1
Could someone tell me how to do that ?

If i set -1 for pev_frags in DeathMsg Event, it's a poor way right?

Blizzard_87 02-27-2014 04:39

Re: [Help] Block Kill Frag ?
 
Check out this thread.

https://forums.alliedmods.net/showthread.php?t=235561

dias 02-27-2014 06:38

Re: [Help] Block Kill Frag ?
 
I dont want to block... I just want to add/remove frag by myself :)

wickedd 02-27-2014 07:44

Re: [Help] Block Kill Frag ?
 
Quote:

Originally Posted by dias (Post 2104880)
I dont want to block..

Are you sure, because in your first you said..
Quote:

Originally Posted by dias (Post 2104808)
I want to block the kill frag... So that when i kill an enemy, my Kill Score is still +0 instead of +1

Quote:

Originally Posted by dias (Post 2104880)
I just want to add/remove frag by myself :)

Here's one way

PHP Code:

set_user_fragsiDget_user_fragsiD ) + any number

or

PHP Code:

set_user_fragsiDget_user_fragsiD ) - any number


dias 02-27-2014 08:35

Re: [Help] Block Kill Frag ?
 
I used that method... but sometimes my frag is negative (-1)

YamiKaitou 02-27-2014 09:26

Re: [Help] Block Kill Frag ?
 
So then simply add a check to see if the result would be below 0

^SmileY 02-27-2014 09:46

Re: [Help] Block Kill Frag ?
 
PHP Code:

#include <amxmodx>

public plugin_init()
{
    
register_plugin("Block Kill Frag","0.0.1","SmileY");

    
register_event("DeathMsg","Ev_DeathMsg","a");
}

public 
Ev_DeathMsg()
{
    new 
iKiller read_data(1);
    new 
iFrags get_user_frags(iKiller);

    if(
iFrags 0set_user_frags(iKiller,--iFrags); 


Ps. Not otimized

dias 02-27-2014 19:23

Re: [Help] Block Kill Frag ?
 
I see... Thanks for the suggest


All times are GMT -4. The time now is 10:11.

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