Raised This Month: $ Target: $400
 0% 

Random


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
zirualas
Senior Member
Join Date: Jun 2010
Location: Lithuania
Old 08-14-2010 , 08:11   Random
Reply With Quote #1

How i can do a random skin?
zirualas is offline
Send a message via Skype™ to zirualas
naven
Veteran Member
Join Date: Jun 2008
Location: Poland, Cieszyn
Old 08-14-2010 , 08:18   Re: Random
Reply With Quote #2

You mean from default skins?
Do it that way:
PHP Code:
new variable random_num(13);
switch(
variable)
{
case 
//first model
case //second model
case //third model
//etc.

__________________
naven.com.pl
"At the end of the day, there are always going to be mental disorders and people who cause violence for no other reason than the fact that they're fucked up and lost. And all we can do is try to learn from it." Corey Taylor.
naven is offline
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 08-14-2010 , 08:24   Re: Random
Reply With Quote #3

@ Zirualas Just a tipp; When you dont need the Random Integer anywhere out of the Block you can do like that:

PHP Code:
switch(random_num(13)) 

case 
//first model 
case //second model 
case //third model 
//etc. 

__________________
Quote:
#define true ((rand() % 2)? true: false) //Happy debugging suckers
mottzi is offline
Send a message via MSN to mottzi
zirualas
Senior Member
Join Date: Jun 2010
Location: Lithuania
Old 08-14-2010 , 08:26   Re: Random
Reply With Quote #4

Thanks
zirualas is offline
Send a message via Skype™ to zirualas
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 08-14-2010 , 08:31   Re: Random
Reply With Quote #5

Next Time use search
__________________
Quote:
#define true ((rand() % 2)? true: false) //Happy debugging suckers
mottzi is offline
Send a message via MSN to mottzi
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-14-2010 , 09:41   Re: Random
Reply With Quote #6

PHP Code:
new const szModels[][] = 

     
"/model1.abc",
     
"/model2.abc",
     
"/model3.abc",
     
"/model4.abc"
};

SetModelFuncid szModelsrandomsizeofszModels ) ) ] ); 
__________________
Bugsy 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 22:01.


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