AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [SOLVED]mini problem with deathmsg & weapon (https://forums.alliedmods.net/showthread.php?t=140708)

One 10-15-2010 19:31

[SOLVED]mini problem with deathmsg & weapon
 
hi,

i know you maybe lol @ me but i just 4got manythings :(

my problem :

i want to catch the weapon in deathmsg event & check if the weapon exists in my list...

Code:


new weapons[][]=

    "weapon_p228",
    "weapon_scout",
    "weapon_xm1014",
    "weapon_mac10",
    "weapon_aug",
    "weapon_elite",
    "weapon_fiveseven",
    "weapon_ump45",
    "weapon_sg550",
    "weapon_galil",
    "weapon_famas",
    "weapon_usp",
    "weapon_glock18",
    "weapon_awp",
    "weapon_mp5navy",
    "weapon_m249",
    "weapon_m3",
    "weapon_m4a1",
    "weapon_tmp",
    "weapon_g3sg1",
    "weapon_deagle",
    "weapon_sg552",
    "weapon_ak47",
    "weapon_p90"
}

ublic EventDeathMsg()
{
    new iKiller = read_data( 1 )
   
   
   
    static weapon[7];
    read_data(4,weapon,6);
   
  if(user_is_warned[iKiller])
    {
        client_print(0,print_chat,"Lol TEST ?! WAFFE = %s ",weapon)
    }
}

now the question :

how to check if( weapon == weapons) :D

i know its a very beginner question but i just 4get manythings :(

Bugsy 10-15-2010 20:08

Re: mini problem with deathmsg & weapon
 
PHP Code:

public DeathMsg()
{
    
//You can read the weapon name directly from the message.
    
new szWeapon10 ];
    
read_dataszWeapon charsmaxszWeapon ) );
    
client_printprint_chat "Death using %s" szWeapon );
    
    
//Or you can read the weapon from msg and search the list of weapons until found.
    
for ( new sizeofweapons ) ; i++ )
    {
        if ( 
equalweapons][ ] , szWeapon ) )
        {
            
client_printprint_chat "Death using %s" weapons] );
            break;
        }
    }



One 10-15-2010 20:34

Re: mini problem with deathmsg & weapon
 
:( shame on me :(

thanks bugsy


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

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