Raised This Month: $12 Target: $400
 3% 

Ayuda Random_num solo funciona el ultimo


  
 
 
Thread Tools Display Modes
Author Message
AlgoChikitito
BANNED
Join Date: Feb 2011
Location: España
Old 08-08-2011 , 16:11   Ayuda Random_num solo funciona el ultimo
#1

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

#define PLUGIN " Loteria Furien SPAnet"
#define VERSION " v2.4 "
#define AUTHOR " Chikitin "


public plugin_init ( ) 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_event"HLTV" "comienza_ronda" "a" "1=0" "2=0")
}

public 
comienza_ronda (  )
{
    new 
azar random_num 150 )
    switch ( 
azar )
    {
        case 
1..10 :
        {
            
cs_set_user_money id cs_get_user_money id ) + 1000 )
            
client_print id print_chat ,  "Ganastes 1000 De Dinero En La Loteria" )
        }
        case 
11..20 :
        {
            
cs_set_user_money id cs_get_user_money id ) + )
            
client_print id print_chat ,  "Ganastes 1 De Dinero En La Loteria" )
        }
        case 
21..30 :
        {
            
cs_set_user_money id cs_get_user_money id ) - 5000 )
            
client_print id print_chat ,  "Perdistes 5000 De Dinero En La Loteria" )
        }
        case 
31..40 :
        {
            
cs_set_user_money id cs_get_user_money id ) + )
            
client_print id print_chat ,  "Ganastes 1 De Dinero En La Loteria" )
        }
        case 
41..50 :
        {
            
cs_set_user_money id cs_get_user_money id ) + )
            
client_print id print_chat ,  "No Ganastes Nada De Dinero En La Loteria" )
        }
        case 
51..60 :
        {
            if ( 
cs_get_user_team id ) == CS_TEAM_T )
            {
                
give_itemid "weapon_hegrenade" )
            }
            else
            {
                
cs_set_user_money id cs_get_user_money id ) +  )
                
client_print id print_chat "Ganastes 1 De Dinero En La Loteria" )
            }
        }
        case 
61..150 :
        {
            
client_print id print_chat ,  "Si Te Sale Este Mensaje ... enorabuena ! No Te A Tocado Nada" )
        }
    }
    return 
PLUGIN_HANDLED

Solo funciona el

PHP Code:
case 61..150 :
        {
            
client_print id print_chat ,  "Si Te Sale Este Mensaje ... enorabuena ! No Te A Tocado Nada" )
        } 
Porque?.

Muchas Gracias
AlgoChikitito is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 08-08-2011 , 16:48   Re: Ayuda Random_num solo funciona el ultimo
#2

De donde sacas el index vos?
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
AlgoChikitito
BANNED
Join Date: Feb 2011
Location: España
Old 08-08-2011 , 17:20   Re: Ayuda Random_num solo funciona el ultimo
#3

si te refieres al comienza_ronda lei que no llevava index
AlgoChikitito is offline
_Venganza_
Senior Member
Join Date: Apr 2011
Location: Valparaiso, Chile
Old 08-08-2011 , 17:34   Re: Ayuda Random_num solo funciona el ultimo
#4

PHP Code:
case 41..50 
        { 
            
cs_set_user_money id cs_get_user_money id ) + 
            
client_print id print_chat ,  "No Ganastes Nada De Dinero En La Loteria" 
        } 
En ninguna parte defines o creas al index y en los cases le das las cosas al index que no existe.
_Venganza_ is offline
AlgoChikitito
BANNED
Join Date: Feb 2011
Location: España
Old 08-08-2011 , 17:36   Re: Ayuda Random_num solo funciona el ultimo
#5

y entonces porque solo funciona el ultimo?
AlgoChikitito is offline
Asd'
Senior Member
Join Date: Jun 2009
Location: Argentina
Old 08-08-2011 , 17:58   Re: Ayuda Random_num solo funciona el ultimo
#6

PHP Code:
new MaxPlayers;

// plugin_init( )
MaxPlayers get_maxplayers( );

// En la función:
for( new Index 1Index <= MaxPlayersIndex++ )
{
   if( !
is_user_connectedIndex ) )
      continue;

   
// Tu codigo.

__________________
Asd' is offline
Send a message via MSN to Asd'
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 08-08-2011 , 18:43   Re: Ayuda Random_num solo funciona el ultimo
#7

Quote:
Originally Posted by AlgoChikitito View Post
si te refieres al comienza_ronda lei que no llevava index
Quote:
Originally Posted by _Venganza_ View Post
En ninguna parte defines o creas al index y en los cases le das las cosas al index que no existe.
a eso me referia.
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
AlgoChikitito
BANNED
Join Date: Feb 2011
Location: España
Old 08-08-2011 , 20:13   Re: Ayuda Random_num solo funciona el ultimo
#8

Solucionado. Muchisimas Gracias A Todos.
AlgoChikitito is offline
 


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:59.


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