AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Randomise (https://forums.alliedmods.net/showthread.php?t=130737)

NzGamers 06-27-2010 02:22

Randomise
 
How do i make it randomise from this

PHP Code:

new const sz_ShopItems[][] = 
{
    
"Item 1",
    
"Item 2",
    
"Item 2"
}; 

i want it to random these Item.

normally i can just do


switch (random_num(1, 3))
{
case 1:
{

wrecked_ 06-27-2010 02:24

Re: Randomise
 
Code:
sz_ShopItems[random(sizeof sz_ShopItems)]


All times are GMT -4. The time now is 14:43.

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