Raised This Month: $ Target: $400
 0% 

Global Message + Ammo


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
MeNtAL MaNiAC
Junior Member
Join Date: Nov 2006
Old 06-25-2007 , 19:27   Global Message + Ammo
Reply With Quote #1

I have tried for over 4 hours to get this to work. What I'm trying to do is that when the person is randomly selected to be given a weapon, they get a certain ammount of ammo and a message is shown to all players. The person recieves the weapon, but no message is shown and they have a full clip. Help please!

PHP Code:
public SeekerItems(id) {
new 
rand random_num(1,10)
 
strip_user_weapons(id)
 
give_item(id"weapon_knife")
 switch(
rand) {
  case 
1giveusp(id)
  case 
3: { 
    
give_item(id"weapon_hegrenade")
    
client_print(idprint_chat"You got a HE Grenade!"
    }
  case 
4: { 
    
give_item(id"weapon_shield"
    
client_print(idprint_chat"You got a Shield!"
    }
  case 
7giveawp(id)
 }
 
cs_set_user_nvg(id)
 
set_user_footsteps(id,0)
}
//------------------------------------------------------------------------------------------------------------
public HiderItems(id) {
new 
rand random_num(1,10)
 
strip_user_weapons(id)
 
give_item(id"weapon_flashbang")
 
give_item(id"weapon_flashbang")
 
give_item(id"weapon_smokegrenade")
 
csset_user_armor(id100.02)
 switch(
rand) {
  case 
1giveusp(id)
  case 
3: { 
    
give_item(id"weapon_hegrenade")
    
client_print(idprint_chat"You got a HE Grenade!");
    }
  case 
4: { 
    
give_item(id"weapon_shield"
    
client_print(idprint_chat"You got a Shield!");
    }
  case 
7giveawp(id)
 }
 
cs_set_user_nvg(id0)
 
set_user_footsteps(id,1)
}
//------------------------------------------------------------------------------------------------------------
public giveusp(id) {
 new 
WeapEntIndex find_ent_by_owner(-1"weapon_usp"id0);
 
give_item(id"weapon_usp")
     
cs_set_weapon_ammo(WeapEntIndex2);
 
glbprint(id1)
}
//------------------------------------------------------------------------------------------------------------
public giveawp(id) {
 new 
WeapEntIndex find_ent_by_owner(-1"weapon_awp"id0);
 
give_item(id"weapon_awp")
     
cs_set_weapon_ammo(WeapEntIndex3);
 
glbprint(id2)
}
//------------------------------------------------------------------------------------------------------------
public csset_user_armor(idFloat:amounttype) {
 
entity_set_float(id,EV_FL_armorvalueamount)
 
set_pdata_int(id,ARMORTYPE_OFFSET,type
}
//------------------------------------------------------------------------------------------------------------
glbprint(idwep) {
 if(
wep == 1) {
  new 
name[32]
  
get_user_name(idname31)
  
client_print(0print_chat"%s now has a USP!"name)
 }
 if(
wep == 2) {
  new 
name[32]
  
get_user_name(idname31)
  
client_print(0print_chat"%s now has an AWP!"name)
 }


Last edited by MeNtAL MaNiAC; 06-25-2007 at 20:05.
MeNtAL MaNiAC is offline
 



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 21:26.


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