AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   case 1 and case 2 (https://forums.alliedmods.net/showthread.php?t=104743)

lordshiva 09-27-2009 02:53

case 1 and case 2
 
switch( get_pdata_int(client, 114) )
{
case 1: fm_give_item(client, "weapon_ak47");
case 2: fm_give_item(client, "weapon_m4a1");
}

Is there any Case like case 0 where I can give same weapon when they spawn

Bugsy 09-27-2009 08:46

Re: case 1 and case 2
 
Quote:

Originally Posted by lordshiva (Post 944708)
switch( get_pdata_int(client, 114) )
{
case 1: fm_give_item(client, "weapon_ak47");
case 2: fm_give_item(client, "weapon_m4a1");
}

Is there any Case like case 0 where I can give same weapon when they spawn

Do you understand what is taking place in that switch statement? You are checking what team they are on and giving a weapon accordingly. How would adding a case for 0 give a weapon at spawn?

PHP Code:

RegisterHamHam_Spawn "player" "fwHamSpawn_Post" );

public 
fwHamSpawn_Postid )
{
    if ( 
is_user_aliveid ) )
    {
        
//give spawn weapon
    
}


You said "give same weapon when they spawn", if you want them to get those weapons at spawn:

PHP Code:

public fwHamSpawn_Postid )
{
    if ( 
is_user_aliveid ) )
    {
        switch( 
get_pdata_intid 114 ) )
        {
            case 
1fm_give_itemid "weapon_ak47" );
            case 
2fm_give_itemid "weapon_m4a1" );
        }    
    }



ConnorMcLeod 09-27-2009 09:19

Re: case 1 and case 2
 
Use cstrike and fun modules instead of fakemeta :

PHP Code:

public fwHamSpawn_Postid )
{
    if ( 
is_user_aliveid ) )
    {
        switch( 
cs_get_user_team(id) )
        {
            case 
CS_TEAM_Tgive_itemid "weapon_ak47" );
            case 
CS_TEAM_CTgive_itemid "weapon_m4a1" );
        }    
    }



xPaw 09-27-2009 09:21

Re: case 1 and case 2
 
_give_item hum ?

ConnorMcLeod 09-27-2009 09:22

Re: case 1 and case 2
 
Sorry ?

Arkshine 09-27-2009 09:50

Re: case 1 and case 2
 
Not talking to you, I guess.

lordshiva 09-27-2009 16:25

Re: case 1 and case 2
 
hey 4get past things..Help me if u want...forget all past dude....help meee

fysiks 09-27-2009 16:59

Re: case 1 and case 2
 
Quote:

Originally Posted by lordshiva (Post 945172)
hey 4get past things..Help me if u want...forget all past dude....help meee

They did help you and I don't see where they said anything about the past.


All times are GMT -4. The time now is 22:37.

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