PDA

View Full Version : Random Messages Problems


Bread
19/05/2012, 06:36 PM
//Random Messages
new randomMessages[][] =
{
"[Evolution Gaming] Hello, Welcome to the community! Founded by Evan!",
"[Evolution Gaming] Chat with us on Teamspeak:ts30.gameservers.com:9198",
"[Evolution Gaming] Sign up and register at http://gaming-space.net!",
}
SetTimer("randomMessages", 60000, true);
forward RandomMessages();
public RandomMessages()
{

}
forward RandomMessages();
public RandomMessages()
{
new randomMsg = random(sizeof(randomMessages));
SendClientMessageToAll(COLOR_YELLOW , randomMessages[randomMsg]);
}


Theres the Messages code , I get these errors:

C:\Users\Lee\Desktop\E-RPv0.1\gamemodes\E-RPv0.1.pwn(450) : error 029: invalid expression, assumed zero
C:\Users\Lee\Desktop\E-RPv0.1\gamemodes\E-RPv0.1.pwn(457) : error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.


Anyone know why?:confused:

deimantas1
19/05/2012, 06:42 PM
Because RandomMessages is already ued.
//Random Messages
new randomMessages[][] =
{
"[Evolution Gaming] Hello, Welcome to the community! Founded by Evan!",
"[Evolution Gaming] Chat with us on Teamspeak:ts30.gameservers.com:9198",
"[Evolution Gaming] Sign up and register at http://gaming-space.net!",
}
SetTimer("RandomMessages", 60000, true);

forward RandomMessages();
public RandomMessages()
{
new randomMsg = random(sizeof(randomMessages));
SendClientMessageToAll(COLOR_YELLOW , randomMessages[randomMsg]);
}

Bread
19/05/2012, 06:44 PM
Please edit it and put it into [php] tags

Bread
19/05/2012, 07:06 PM
Thanks , that cured one error , still got:


C:\Users\Lee\Desktop\E-RPv0.1\gamemodes\E-RPv0.1.pwn(450) : error 029: invalid expression, assumed zero
C:\Users\Lee\Desktop\E-RPv0.1\gamemodes\E-RPv0.1.pwn(457) : error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.

deimantas1
19/05/2012, 07:23 PM
Which lines?

Bread
19/05/2012, 07:30 PM
450:}

457: SendClientMessageToAll(COLOR_YELLOW , randomMessages[randomMsg]);

Britas
19/05/2012, 07:34 PM
//Random Messages
new randomMessages[][] =
{
"[Evolution Gaming] Hello, Welcome to the community! Founded by Evan!",
"[Evolution Gaming] Chat with us on Teamspeak:ts30.gameservers.com:9198",
"[Evolution Gaming] Sign up and register at http://gaming-space.net!"
}
SetTimer("RandomMessages", 60000, true);

forward RandomMessages();
public RandomMessages()
{
new randomMsg = random(sizeof(randomMessages));
SendClientMessageToAll(COLOR_YELLOW , randomMessages[randomMsg]);
}

IceCube!
19/05/2012, 07:42 PM
REMOVED Incorrect looking again
Just compared the currant code postd above to your orignal code and the fix is above.

Bread
19/05/2012, 07:55 PM
Thanks Britas.