Raised This Month: $ Target: $400
 0% 

[Help] Giving away to CT Shield & Deagle


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 06-11-2011 , 13:55   [Help] Giving away to CT Shield & Deagle
Reply With Quote #1

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 is offline
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 06-11-2011 , 14:29   Re: [Help] Giving away to CT Shield & Deagle
Reply With Quote #2

NVM fixed
Diegorkable is offline
makiza
BANNED
Join Date: Mar 2009
Old 06-11-2011 , 14:39   Re: [Help] Giving away to CT Shield & Deagle
Reply With Quote #3

how did you fixed it?
makiza is offline
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 06-11-2011 , 16:46   Re: [Help] Giving away to CT Shield & Deagle
Reply With Quote #4

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)
      } 
Diegorkable is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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