Raised This Month: $ Target: $400
 0% 

Help Switch Ramdon


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MaNuCs
BANNED
Join Date: Oct 2009
Location: Venezuela
Old 12-21-2009 , 23:29   Help Switch Ramdon
Reply With Quote #1

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#include <fakemeta_util>
#include <hamsandwich>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

public plugin_init() {
 
register_clcmd("say /event""evento_menu");
}
public 
evento_menu(id)
{
 if (
cs_get_user_team(id) != CS_TEAM_T)
 {
  new 
eventomenu menu_create("\yEvents:""sub_evento_menu")
  
  
menu_additem(eventomenu"\w Weapon-Ramdon",         "1"0);
  
  
menu_setprop(eventomenuMPROP_EXITMEXIT_ALL);
  
menu_display(ideventomenu0);
 }
}
public 
sub_evento_menu(ideventomenuitem)
{
 
 if (
item == MENU_EXIT)
 {
  
menu_destroy(eventomenu);
  return 
PLUGIN_HANDLED;
 }
 
 new 
Data[6], Name[64];
 new 
AccessCallback;
 
menu_item_getinfo(eventomenuitemAccessData,5Name63Callback);
 
 new 
Key str_to_num(Data);
 
 switch (
Key)
 {
  case 
1:
  {
   
Vs(id)
  }
 }
 
 
menu_destroy(eventomenu);
 
 return 
PLUGIN_HANDLED;
}
public 
Vs(id)
{
 new 
menu menu_create("\yEscoje A Tu Contrincante:""submenu2");
 
 new 
players[32], pnumtempid;
 new 
szName[32], szTempid[10];
 
 
get_players(playerspnum"a");
 
 for( new 
ii<pnumi++ )
 {
  
tempid players[i];
  
  if (
cs_get_user_team(tempid) != CS_TEAM_CT)
  {
   continue;
  }
  
  
get_user_name(tempidszName31);
  
num_to_str(tempidszTempid9);
  
menu_additem(menuszNameszTempid0);
 }
 
 
menu_display(idmenu);
 return 
PLUGIN_HANDLED;
}
public 
submenu2(idmenuitem)
{
 if( 
item == MENU_EXIT )
 {
  
menu_destroy(menu);
  return 
PLUGIN_HANDLED;
 }
 
 new 
data[6], iName[64];
 new 
accesscallback;
 
menu_item_getinfo(menuitemaccessdata,5iName63callback);
 
 new 
tempid str_to_num(data);
 
 switch(
id)
 {
  case 
1:
  {
   switch (
random_num(13))
   {
    case 
1:{
     
strip_user_weapons(id)
     
strip_user_weapons(tempid)
     
set_user_health(id100)
     
set_user_health(tempid100)
     
give_item(id"weapon_knife")
     
give_item(tempid"weapon_knife")
     
give_item(id"weapon_deagle");
     
cs_set_user_bpammo(idCSW_DEAGLE7)
     
give_item(tempid"weapon_deagle");
     
cs_set_user_bpammo(tempidCSW_DEAGLE7)
    }
    
    case 
2: {
     
strip_user_weapons(id)
     
strip_user_weapons(tempid)
     
set_user_health(id100)
     
set_user_health(tempid100)
     
give_item(id"weapon_knife")
     
give_item(tempid"weapon_knife")
     
give_item(id"weapon_deagle");
     
cs_set_user_bpammo(idCSW_DEAGLE7)
     
give_item(tempid"weapon_deagle");
     
cs_set_user_bpammo(tempidCSW_DEAGLE7)
    }
    
    case 
3:{
     
strip_user_weapons(id)
     
strip_user_weapons(tempid)
     
set_user_health(id100)
     
set_user_health(tempid100)
     
give_item(id"weapon_knife")
     
give_item(tempid"weapon_knife")
     
give_item(id"weapon_deagle");
     
cs_set_user_bpammo(idCSW_DEAGLE7)
     
give_item(tempid"weapon_deagle");
     
cs_set_user_bpammo(tempidCSW_DEAGLE7)
    }
   }
  }
 }
 
 
menu_destroy(menu);
 return 
PLUGIN_HANDLED;

I choose the option, the menu give me the weapon...

and all time is DEAGLE CASE
i try 30 times and 30 times is DEAGLE

help me to fix

thx
+k
MaNuCs is offline
Send a message via MSN to MaNuCs
AntiBots
Veteran Member
Join Date: May 2008
Location: Brazil
Old 12-21-2009 , 23:40   Re: Help Switch Ramdon
Reply With Quote #2

switch( id ) WTF???
__________________
AntiBots is offline
Send a message via ICQ to AntiBots Send a message via MSN to AntiBots Send a message via Skype™ to AntiBots
cikjam
Senior Member
Join Date: Feb 2009
Location: Australia
Old 12-21-2009 , 23:47   Re: Help Switch Ramdon
Reply With Quote #3

Are you blind?

All your cases are deagle. lol
You just copied and pasted the same thing 3 times.
__________________
R.I.P Aziz 'Zyzz' Sergeyevich Shavershian
cikjam is offline
MaNuCs
BANNED
Join Date: Oct 2009
Location: Venezuela
Old 12-22-2009 , 00:02   Re: Help Switch Ramdon
Reply With Quote #4

yeah... for create the plugin fast.. XD

+k
MaNuCs is offline
Send a message via MSN to MaNuCs
nicolazo103
Veteran Member
Join Date: Jan 2009
Location: I have no fu*** idea
Old 12-22-2009 , 00:02   Re: Help Switch Ramdon
Reply With Quote #5

Switch(id) > switch(tempid)

PD:

It always give you a deagle, because all cases are the same
__________________
Why do they send babies to fight me? -Heavy

nicolazo103 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 04:03.


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