Problem with random massage
#1

Here the problem i get

Код:
C:\Users\Robin\Desktop\New folder\pawno\include\/CRP/Publics/RandomMessages.pwn(4) : error 028: invalid subscript (not an array or too many subscripts): "RandomMessages"
C:\Users\Robin\Desktop\New folder\pawno\include\/CRP/Publics/RandomMessages.pwn(4) : error 072: "sizeof" operator is invalid on "function" symbols
C:\Users\Robin\Desktop\New folder\pawno\include\/CRP/Publics/RandomMessages.pwn(4) : error 029: invalid expression, assumed zero
C:\Users\Robin\Desktop\New folder\pawno\include\/CRP/Publics/RandomMessages.pwn(4) : fatal error 107: too many error messages on one line
this are line 4
Код:
SendClientMessageToAll(COLOR_GROVE, RandomMessages[random(sizeof(RandomMessages))]);
Reply
#2

new RandomInt = Random(sizeof(RandomMessages));
SendClientMessageToAll(COLOR_GROVE, RandomMessages[Random]);

try this.
Reply
#3

pawn Код:
new RandMessages[][] = {
    "WHAT",
    "WE",
    "WANT"
};
new RandTimer;
forward RandomMessages();
under gamemodeinit
pawn Код:
RandTimer = SetTimer("RandomMessages", 300000, true);
pawn Код:
public RandomMessages()
{
    new Rand = random(sizeof(RandMessages));
    SendClientMessageToAll(MYCOLOR, RandMessages[Rand]);
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)