AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Friendlyfire Score Decrease Help (https://forums.alliedmods.net/showthread.php?t=188707)

MokeN 06-29-2012 15:22

Friendlyfire Score Decrease Help
 
Hello,

Is there any plugin/function that's disabling the -1 decrease in score when teamkilling?

Thanks

MyPc 06-29-2012 15:35

Re: Friendlyfire Score Decrease Help
 
Quote:

Originally Posted by MokeN (Post 1739147)
Hello,

Is there any plugin/function that's disabling the -1 decrease in score when teamkilling?

Thanks

Try this:
Code:
#include <amxmodx> #include <hamsandwich> #include <fun> public plugin_init() {     RegisterHam( Ham_Killed, "player", "function", 1 ); } public function(this, idattacker, shouldgib) {     if( get_user_team( this ) == get_user_team( idattacker ) )     {         set_user_frags( idattacker, get_user_frags( idattacker ) + 1 );     } }

MokeN 06-29-2012 16:05

Re: Friendlyfire Score Decrease Help
 
Thanks, perfect! :D

Another thing, i made an gamemenu for jailbreak and i'm having troubles to give the CTs godmode on specific games.
The fm_set_user_godmode, set_user_godmode didn't work and the Ham_TakeDamage_Pre bugged alot :s

Help?:D

Example Game Action:
PHP Code:

public ZombieBombsGame(id)
{
    
g_iCurrentGame GAME_ZMBOMBS
    
    
new iPlayers[32]
    new 
iNum
    
new id
 
    get_players
iPlayersiNum )
 
    for( new 
0iNumi++ )
    {
        
id iPlayers[i]
        if( !
is_user_aliveid ) )
        {
            continue;
        }
       
        
set_hudmessage 2556464, -1.00.3500.15.00.10.1, -
        
show_hudmessage 0"[SG]: ZombieBomb Game Started!")
       
        
strip_user_weaponsid )
       
        if (
cs_get_user_team(id) == CS_TEAM_CT)
        {
    
give_item(id"weapon_knife")
    
set_user_godmode(id1)
    
           
        }
       
        if (
cs_get_user_team(id) == CS_TEAM_T)
        {
            
give_item(id"weapon_hegrenade")
            
cs_set_user_bpammoidCSW_HEGRENADE200 )
        }
       
    }



ConnorMcLeod 06-29-2012 16:38

Re: Friendlyfire Score Decrease Help
 
You have 2 'id' params.

MokeN 06-29-2012 17:55

Re: Friendlyfire Score Decrease Help
 
u mean i got (id) and new id?

OnePL 06-29-2012 19:29

Re: Friendlyfire Score Decrease Help
 
So probably it should be: D

PHP Code:

public ZombieBombsGame(id) {
    
g_iCurrentGame GAME_ZMBOMBS

    
for(new 1<= 33i++) {
        if(!
is_user_connected(i) || !is_user_alive(i))
            return 
PLUGIN_CONTINUE

        set_hudmessage
(2556464, -1.00.3500.15.00.10.1, -1)
        
show_hudmessage(0"[SG]: ZombieBomb Game Started!")

        
strip_user_weapons(i)
        if(
cs_get_user_team(i) == CS_TEAM_CT) {
            
give_item(i"weapon_knife")
            
set_user_godmode(i1)
        }
        if(
cs_get_user_team(id) == CS_TEAM_T) {
            
give_item(i"weapon_hegrenade")
            
cs_set_user_bpammo(idCSW_HEGRENADE200)
        }
    }
    return 
PLUGIN_CONTINUE



ConnorMcLeod 06-30-2012 05:48

Re: Friendlyfire Score Decrease Help
 
Quote:

Originally Posted by OnePL (Post 1739331)
So probably it should be: D

PHP Code:

public ZombieBombsGame(id) {
    
g_iCurrentGame GAME_ZMBOMBS

    
for(new 1<= 33i++) {
        if(!
is_user_connected(i) || !is_user_alive(i))
            return 
PLUGIN_CONTINUE

        set_hudmessage
(2556464, -1.00.3500.15.00.10.1, -1)
        
show_hudmessage(0"[SG]: ZombieBomb Game Started!")

        
strip_user_weapons(i)
        if(
cs_get_user_team(i) == CS_TEAM_CT) {
            
give_item(i"weapon_knife")
            
set_user_godmode(i1)
        }
        if(
cs_get_user_team(id) == CS_TEAM_T) {
            
give_item(i"weapon_hegrenade")
            
cs_set_user_bpammo(idCSW_HEGRENADE200)
        }
    }
    return 
PLUGIN_CONTINUE



That way of looping is poor, always prefer the use of get_players.


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

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