AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   List of word and things (https://forums.alliedmods.net/showthread.php?t=216723)

piepie 05-24-2013 18:44

List of word and things
 
Hey, how can i make 2 lists of words and then choose 1 of each list?

Bugsy 05-24-2013 19:46

Re: List of word and things
 
PHP Code:

new const Words1[][] = 
{
    
"hello",
    
"these",
    
"are",
    
"words"
};

new const 
Words2[][] = 
{
    
"here",
    
"is",
    
"more"
};

server_print"%s %s" Words1randomsizeofWords1 ) ) ] , Words2randomsizeofWords2 ) ) ] ); 


piepie 05-25-2013 08:48

Re: List of word and things
 
Quote:

Originally Posted by Bugsy (Post 1957857)
PHP Code:

new const Words1[][] = 
{
    
"hello",
    
"these",
    
"are",
    
"words"
};

new const 
Words2[][] = 
{
    
"here",
    
"is",
    
"more"
};

server_print"%s %s" Words1randomsizeofWords1 ) ) ] , Words2randomsizeofWords2 ) ) ] ); 


I want like if Word 1 is "hello" it gets the 1st word from words2 that's "here", and so on...

fysiks 05-28-2013 00:23

Re: List of word and things
 
Quote:

Originally Posted by piepie (Post 1958138)
I want like if Word 1 is "hello" it gets the 1st word from words2 that's "here", and so on...

Ok, so what do you need help with?

piepie 05-28-2013 03:34

Re: List of word and things
 
If i have 5 words each list, it gets a random word from the 1st list and if the word is in 3rd place on the list it will get the 3rd word from second list.

11922911 05-28-2013 03:46

Re: List of word and things
 
Quote:

Originally Posted by piepie (Post 1959784)
If i have 5 words each list, it gets a random word from the 1st list and if the word is in 3rd place on the list it will get the 3rd word from second list.

Could you please speak more slowly???:|

YamiKaitou 05-28-2013 04:08

Re: List of word and things
 
Quote:

Originally Posted by piepie (Post 1959784)
If i have 5 words each list, it gets a random word from the 1st list and if the word is in 3rd place on the list it will get the 3rd word from second list.

So then save the random value and use that as the index for both arrays

piepie 05-28-2013 07:25

Re: List of word and things
 
Quote:

Originally Posted by YamiKaitou (Post 1959804)
So then save the random value and use that as the index for both arrays

How can i do that?

fysiks 05-28-2013 14:13

Re: List of word and things
 
Quote:

Originally Posted by piepie (Post 1959870)
How can i do that?

This is something that anybody writing a script or program can do. You assign it to a variable and use the variable . . . maybe you need to learn the basics of programming.

piepie 05-28-2013 17:06

Re: List of word and things
 
Quote:

Originally Posted by fysiks (Post 1960079)
This is something that anybody writing a script or program can do. You assign it to a variable and use the variable . . . maybe you need to learn the basics of programming.

If it's so easy why cant you show me an example?


All times are GMT -4. The time now is 16:17.

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