Error in RandMSG.
#1

Having problem in scripting, I referred to Wiki, but I still get problem! D:

I forwarded it.
pawn Код:
forward SendMSG();

#include <a_samp>
#include "../include/gl_common.inc"
#include <core>
#include <float>
#include <streamer>
#include <ZCMD>


#if defined FILTERSCRIPT
#define ADMINFS_MESSAGE_COLOR 0xFF444499
#define PM_INCOMING_COLOR     0xFFFF22AA
#define PM_OUTGOING_COLOR     0xFFCC2299
#pragma tabsize 0

new RandomMSG[][] =
{
    "{ffff00}[RE] Message: Bored? Listen to /music, /music2 and /radio!",
    "{ffff00}[RE] Message: Use /car to spawn a car.",
    "{ffff00}[RE] Message: Use /god and /godcar if you don't want to die or your car explodes.",
    "{ffff00}[RE] Message: Need boost in car? Use /boost now!",
    "{ffff00}[RE] Message: Always read /rules, obey to the /rules.",
    "{ffff00}[RE] Message: Check out our /cmds, /teles and /help!",
    "{ffff00}[RE] Message: Spotted a cheater? Use /report [id] [reason]",
    "{ffff00}[RE] Message: Do not ask for admin in chat. This will just reduce your chance.",
    "{ffff00}[RE] Message: Add our server into favorite list! 66.85.141.90:7777",
    "{ffff00}[RE] Message: Our partner, [SR], Stunt Revolution. 66.85.137.90:7777"
}
Here's the public.
pawn Код:
public SendMSG()
{
    new randMSG = random(sizeof(RandomMSG));
    SendClientMessageToAll(0xFFFFAAAA, RandomMSG(randMSG));
}
Errors:
Код:
C:\Users\Kelvin\Desktop\Scripting\gamemodes\racerevolution.pwn(4274) : error 072: "sizeof" operator is invalid on "function" symbols
C:\Users\Kelvin\Desktop\Scripting\gamemodes\racerevolution.pwn(4275) : error 017: undefined symbol "RandomMSG"
C:\Users\Kelvin\Desktop\Scripting\gamemodes\racerevolution.pwn(4274) : warning 204: symbol is assigned a value that is never used: "randMSG"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
What's the problem in this script?
Reply
#2

replace
pawn Код:
SendClientMessageToAll(0xFFFFAAAA, RandomMSG(randMSG));
by
pawn Код:
SendClientMessageToAll(0xFFFFAAAA, RandomMSG[randMSG]);
Reply
#3

More errors. ; _ ;
Код:
C:\Users\Kelvin\Desktop\Scripting\gamemodes\racerevolution.pwn(4274) : error 017: undefined symbol "RandomMSG"
C:\Users\Kelvin\Desktop\Scripting\gamemodes\racerevolution.pwn(4274) : error 029: invalid expression, assumed zero
C:\Users\Kelvin\Desktop\Scripting\gamemodes\racerevolution.pwn(4274) : warning 215: expression has no effect
C:\Users\Kelvin\Desktop\Scripting\gamemodes\racerevolution.pwn(4275) : error 017: undefined symbol "RandomMSG"
C:\Users\Kelvin\Desktop\Scripting\gamemodes\racerevolution.pwn(4275) : warning 215: expression has no effect
C:\Users\Kelvin\Desktop\Scripting\gamemodes\racerevolution.pwn(4275) : error 001: expected token: ";", but found "]"
C:\Users\Kelvin\Desktop\Scripting\gamemodes\racerevolution.pwn(4275) : error 029: invalid expression, assumed zero
C:\Users\Kelvin\Desktop\Scripting\gamemodes\racerevolution.pwn(4275) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


6 Errors.
Reply
#4

I looked at the Wiki and its code is the same as there, do not know what might be giving these errors.
you want to continue trying to fix this code or try another?
http://forum.sa-mp.com/showthread.ph...andom+messages
Almost the same wiki:
http://forum.sa-mp.com/showthread.ph...andom+messages
Reply
#5

Код:
forward SendMSG();

#include <a_samp>
#include <core>
#include <float>
#include <streamer>
#include <ZCMD>


#define ADMINFS_MESSAGE_COLOR 0xFF444499
#define PM_INCOMING_COLOR     0xFFFF22AA
#define PM_OUTGOING_COLOR     0xFFCC2299
#pragma tabsize 0

stock const RandomMSG[][] = // Should be stock const since this data does not get modified
{
    "{ffff00}[RE] Message: Bored? Listen to /music, /music2 and /radio!",
    "{ffff00}[RE] Message: Use /car to spawn a car.",
    "{ffff00}[RE] Message: Use /god and /godcar if you don't want to die or your car explodes.",
    "{ffff00}[RE] Message: Need boost in car? Use /boost now!",
    "{ffff00}[RE] Message: Always read /rules, obey to the /rules.",
    "{ffff00}[RE] Message: Check out our /cmds, /teles and /help!",
    "{ffff00}[RE] Message: Spotted a cheater? Use /report [id] [reason]",
    "{ffff00}[RE] Message: Do not ask for admin in chat. This will just reduce your chance.",
    "{ffff00}[RE] Message: Add our server into favorite list! 66.85.141.90:7777",
    "{ffff00}[RE] Message: Our partner, [SR], Stunt Revolution. 66.85.137.90:7777"
}; // <-------------- You forgot the semi-colon here!


public SendMSG() { SendClientMessageToAll(0xFFFFAAAA, RandomMSG[random(sizeof(RandomMSG))]); }
Reply
#6

Thanks, I don't know about
pawn Код:
new
thingy lol. xD Rep later.
Reply
#7

Cheers.
Reply
#8

LOL .-.
kkk
Ok.
Reply


Forum Jump:


Users browsing this thread: