SA-MP Forums Archive
Random Message Error - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Random Message Error (/showthread.php?tid=314653)



Random Message Error - LuisGraph - 30.01.2012

Код:
C:\Documents and Settings\Luis29\Mis documentos\Downloads\Compressed\samp03dsvr_R2_win32\filterscripts\miFS.pwn(28) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Luis29\Mis documentos\Downloads\Compressed\samp03dsvr_R2_win32\filterscripts\miFS.pwn(28) : error 008: must be a constant expression; assumed zero
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Well, those are the mistakes that gives me the following code.

Код:
new randMSG = random(sizeof(ramdon));
    SendClientMessageToAll(-1, ramdon[randMSG]);
please, I hope yours help.


AW: Random Message Error - Papana - 30.01.2012

are romain
I translated with ******
I hope you understand



Posts enough?
example:
[GodplaY BOT]: Want to know the community forum? / forum and you'll find.
Urmaritii following steps:

Add to forward to the last as not to confuse gamemodu
line

Код:
forward rMessage();
then the new

Код:
new rMessageList[][] = {
"{6EF83C}[GodplaY-BOT]:{FFFFFF}Ai vazut vreun Codat ? /report si-l vom rezolva!",
"{6EF83C}[GodplaY-BOT]:{FFFFFF}Ai nevoie de ajutor ? /needhelp si te ajutam!",
"{6EF83C}[GodplaY-BOT]:{FFFFFF}Vrei niste detalii despre server ? /serverinfo!!"
};
new rCheckList[sizeof(rMessageList)];
Of course here you can change the message ..
then the public

Код:
public rMessage()
{
        new rNumber, Check = 0;
        do{
            for(new i=0; i<sizeof(rCheckList); i++)
                        if(rCheckList[i] != 0)
                                Check++;
                if(Check == sizeof(rCheckList))
                    for(new i=0; i<sizeof(rCheckList); i++)
                        rCheckList[i] = 0;
                rNumber = random(sizeof(rMessageList));
        }while(rCheckList[rNumber]);
    SendClientMessageToAll(-1, rMessageList[rNumber]);
        rCheckList[rNumber] = 1;
}
at onGameModeInit

Код:
SetTimer("rMessage", 300000, 1);
here about safety precautions set of 5 in 5 minutes but it changed
300,000 instead put more ...

I hope it will go is made ​​easy and simple so ...


Re: Random Message Error - LuisGraph - 31.01.2012

Jeje listo, ya lo habнa resuelto pero no lo habia notificбdo por falta de Red el problema era, que agregaba una coma (,) al ultimo contenido del array.