AlliedModders

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

extreem 06-16-2011 12:13

Random Message Help
 
Hello all. Help me with making random message please.
I have kode but it not work
PHP Code:

public sayRand(id){
    new 
randFile fopen("/addons/amxmodx/configs/random.ini","r")
    new 
bufer[256]
    while(!
feof(randFile)){
        
fgets(randFilebufer255)
        new 
randomMessage
        randomMessage 
random_num(0,100)
        
client_print(id,print_chat,"%s"bufer[randomMessage])
    }



Exolent[jNr] 06-16-2011 12:26

Re: Random Message Help
 
Code:
public sayRand(id) {     new filename[128]     get_localinfo("amxx_configsdir", filename, charsmax(filename))     add(filename, charsmax(filename), "/random.ini")         new lines = file_size(filename, 1)         new line[256], len     read_file(filename, random(lines), line, charsmax(line), len)         client_print(id, print_chat, "%s", line) }

extreem 06-16-2011 12:52

Re: Random Message Help
 
Thanks Exolent[jNr] , you hapled me.


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

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