Raised This Month: $ Target: $400
 0% 

Give C4 Randomly


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
linkosc
Senior Member
Join Date: Apr 2007
Location: Everywhere
Old 06-27-2010 , 18:30   Give C4 Randomly
Reply With Quote #1

Hello all,

Im working on a Call of Duty mod for CS 1.6 I need help with my c4 issue.
When you choose a class it removes all weapons including c4 if you are a Terrorist. Once you select your class it removes your weapons and gives you new weapons. I need it to select a random Player from the Ts and give them c4. Can anyone Help me. Here is the menu code im using so that you can see what i mean

PHP Code:
public ChooseClass(id)
{    
    new 
menu[] = "Call Of Duty 4: Choose Class^n^n1. Assault^n2. Spec Ops^n3. Heavy Gunner^n4. Demolitions^n5. Sniper";
    new 
keys MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5;
    
show_menu(idkeysmenu, -1"menu_ChooseClass")    
    return 
PLUGIN_CONTINUE
}
public 
DoChooseClass(idkey)
{
    if(
key == 0) {
       
         if(
PlayerClass[id] == CLASS_ASSUALT) {
         
              
client_print(idprint_chat"[Call of Duty 4] You are allready a Assault! Choose something else!")
              
ChooseClass(id)           
              return 
PLUGIN_HANDLED
         
}        
  
PlayerClass[id] = CLASS_ASSUALT
  cs_set_user_money
(id0);
  
fm_strip_user_weapons(id);
  
fm_give_item(id"weapon_knife");
  
fm_give_item(id"weapon_m4a1");
  
fm_give_item(id"ammo_556nato");
  
fm_give_item(id"weapon_glock18");
  
fm_give_item(id"ammo_9mm");
  
client_print(idprint_chat"[Call of Duty 4] You are now Assault Class!")
    }        
         
    if(
key == 3) {
         
         if(
PlayerClass[id] == CLASS_DEMO) {
              
              
client_print(idprint_chat"[Call of Duty 4] You are allready Demolitions! Choose something else!")
              
ChooseClass(id)
              return 
PLUGIN_HANDLED
         
}
  
PlayerClass[id] = CLASS_DEMO
  cs_set_user_money
(id0);
  
fm_strip_user_weapons(id);
  
fm_give_item(id"weapon_knife");
  
fm_give_item(id"weapon_m3");
  
fm_give_item(id"ammo_buckshot");
  
fm_give_item(id"weapon_glock18");
  
fm_give_item(id"ammo_9mm");
  
client_print(idprint_chat"[Call of Duty 4] You are now Demolitions!")
    }
    
    if(
key == 2) {
         
         if(
PlayerClass[id] == CLASS_HEAVYG) {
              
              
client_print(idprint_chat"[Call of Duty 4] You are allready a Heavy Gunner! Choose something else!")
              
ChooseClass(id)
              return 
PLUGIN_HANDLED
         
}
                   
  
PlayerClass[id] = CLASS_HEAVYG
  cs_set_user_money
(id0);
  
fm_strip_user_weapons(id);
  
fm_give_item(id"weapon_knife");
  
fm_give_item(id"weapon_m249");
  
fm_give_item(id"ammo_556natobox");
  
fm_give_item(id"weapon_glock18");
  
fm_give_item(id"ammo_9mm");
  
client_print(idprint_chat"[Call of Duty 4] You are now a Heavy Gunner!")
    }    
    if(
key == 4) {
         
         if(
PlayerClass[id] == CLASS_SNIPER) {
              
              
client_print(idprint_chat"[Call of Duty 4] You are allready a Sniper! Choose something else!")
              
ChooseClass(id)
              return 
PLUGIN_HANDLED
         
}
                   
  
PlayerClass[id] = CLASS_SNIPER
  cs_set_user_money
(id0);
  
fm_strip_user_weapons(id);
  
fm_give_item(id"weapon_knife");
  
fm_give_item(id"weapon_scout");
  
fm_give_item(id"ammo_762nato");
  
fm_give_item(id"weapon_glock18");
  
fm_give_item(id"ammo_9mm");
  
client_print(idprint_chat"[Call of Duty 4] You are now a Sniper!")
    }
    
    if(
key == 1) {
     
 if(
PlayerClass[id] == CLASS_SPECOPS) {
  
client_print(idprint_chat"[Call of Duty 4] You are allready Spec Ops! Choose something else!")
  
ChooseClass(id)
  return 
PLUGIN_HANDLED
 
}
 
  
PlayerClass[id] = CLASS_SPECOPS
  cs_set_user_money
(id0);
  
fm_strip_user_weapons(id);
  
fm_give_item(id"weapon_knife");
  
fm_give_item(id"weapon_mp5navy");
  
fm_give_item(id"ammo_9mm");
  
fm_give_item(id"weapon_glock18");
  
fm_give_item(id"ammo_9mm");
  
client_print(idprint_chat"[Call of Duty 4] You are now Spec Ops!")
    }

__________________
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
linkosc is offline
Send a message via AIM to linkosc
 


Thread Tools
Display Modes

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 14:55.


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