Raised This Month: $ Target: $400
 0% 

set randomly a name to each player


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 08-06-2014 , 18:28   Re: set randomly a name to each player
Reply With Quote #2

Well, worked fine on first view. Had no time to get in details. Just have to replace all the names with your ones.
PHP Code:
#include <amxmodx>

const MAXPLAYERS 33

public plugin_init()
{
    
register_plugin("Some Random Names""1.0""Flicker")
}

new 
NameIndex[MAXPLAYERS]

new const 
g_szNames[MAXPLAYERS 1][]=
{
    
"name1",
    
"name2",
    
"name3",
    
"name4",
    
"name5",
    
"name6",
    
"name7",
    
"name8",
    
"name9",
    
"name10",
    
"name11",
    
"name12",
    
"name13",
    
"name14",
    
"name15",
    
"name16",
    
"name17",
    
"name18",
    
"name19",
    
"name20",
    
"name21",
    
"name22",
    
"name23",
    
"name24",
    
"name25",
    
"name26",
    
"name27",
    
"name28",
    
"name29",
    
"name30",
    
"name31",
    
"name32"
}

new 
bool:NameUsed[sizeof g_szNames]

public 
client_putinserver(id)
{
    new 
iRand random(sizeof g_szNames)
    
    while(
NameUsed[iRand])
        
iRand random(sizeof g_szNames)
    
    
set_user_info(id"name"g_szNames[iRand])
    
    
NameUsed[iRand] = true
    NameIndex
[id] = iRand
}

public 
client_disconnect(id)
    
NameUsed[NameIndex[id]] = false 
__________________
Flick3rR is offline
Send a message via Skype™ to Flick3rR
 



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


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