Raised This Month: $ Target: $400
 0% 

Random_num in no specific index forward


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Kotoamatsukami
Member
Join Date: Jan 2017
Location: Malaysia
Old 01-15-2017 , 12:16   Random_num in no specific index forward
Reply With Quote #1

Hello, I am trying to pick 1 single client/player to be chosen and get his name and print to the server like "%s name has been chosen!"
PHP Code:
public plugin_init( ) 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event"HLTV""NewRound""a""1=0""2=0" )
    
    
g_Maxplayer get_maxplayers( )
}

public 
NewRound( )
{
    new 
example[32]
    new 
id random_num1sizeof(example) )
    
    for( new 
id 1id <= g_Maxplayerid++ )
    {
        
get_user_nameidexamplecharsmax(example) )
        
        
client_print0print_chat"%s has been chosen!"example )
    }

It's just that I get warning it said I never used the 'id' index inside the loop... Any improvement?

EDIT : I think I should remove the loop?

Last edited by Kotoamatsukami; 01-15-2017 at 12:21.
Kotoamatsukami 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 20:56.


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