AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Help] Giving away to CT Shield & Deagle (https://forums.alliedmods.net/showthread.php?t=158992)

Diegorkable 06-11-2011 13:55

[Help] Giving away to CT Shield & Deagle
 
Hey guys
I've been scripting a SWITCH function which says if the guy is CS_TEAM_CT or not, in the case when he's CT that's the function:

PHP Code:

case CS_TEAM_CT:
      {
       
strip_user_weapons(i)
       
give_item(i"weapon_knife")
       
give_item(i"weapon_shield")
       
give_item(i"weapon_deagle")
       
set_user_health(i100)
       
cs_set_user_bpammo(iCSW_DEAGLE999)
      } 

The day is called Rebel Day and its a day in JailBreak, and the problem is that when we tested it ingame it gave the CT only his knife back and deagle, but NO shield, what could cause this??


HERE is the whole code of that day if it might help you:

PHP Code:

   case DAY_GRAV:
   {
    if(
IsPlayer(i) && is_user_alive(i))
    {
     switch(
cs_get_user_team(i))
     {
      case 
CS_TEAM_T:
      {
       
set_user_health(i300)
      }
      
      case 
CS_TEAM_CT:
      {
                   
give_item(i"weapon_knife")
       
strip_user_weapons(i)
       
give_item(i"weapon_knife")
       
give_item(i"weapon_deagle")
       
give_item(i"weapon_shield")
       
set_user_health(i100)
       
cs_set_user_bpammo(iCSW_DEAGLE999)
      }
     }
    }
    
client_print(0print_chat"%s Today is ReBeL day"PREFIX)
    
//colored_print(1337, "^x04 %s^x03 Today is a Gravity Day!" , PREFIX)
    
gravityday true
    day_started 
true
   



Diegorkable 06-11-2011 14:29

Re: [Help] Giving away to CT Shield & Deagle
 
NVM fixed

makiza 06-11-2011 14:39

Re: [Help] Giving away to CT Shield & Deagle
 
how did you fixed it?

Diegorkable 06-11-2011 16:46

Re: [Help] Giving away to CT Shield & Deagle
 
I added another stock, strip_weapons, which actually fixed it, here is the stock code:
PHP Code:

stock strip_weapons(index)
{

strip_user_weapons(index)
set_pdata_int(indexOFFSET_PRIMARYWEAPON0)
give_item(index"weapon_knife")


And the code looked after the stock:

PHP Code:

case CS_TEAM_CT:
      {
                   
give_item(i"weapon_knife")
       
strip_weapons(i)
       
strip_user_weapons(i)
       
give_item(i"weapon_knife")
       
give_item(i"weapon_deagle")
       
give_item(i"weapon_shield")
       
set_user_health(i100)
       
cs_set_user_bpammo(iCSW_DEAGLE999)
      } 



All times are GMT -4. The time now is 23:31.

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