Invalid Expression[REP+]
#1

pawn Код:
: error 017: undefined symbol "AutoMessages"
: error 017: undefined symbol "AutoMessages"
: error 029: invalid expression, assumed zero
: fatal error 107: too many error messages on one line
I get those errors on my AutoMessages.Letme show you the line that contains all three errors


pawn Код:
forward AutoMessage();
public AutoMessage() {
    new string[128];
-->   format(string, sizeof(string), "New Dimension Says: %s", AutoMessages[random(sizeof(AutoMessages))]);
    SendClientMessageToAll(COLOR_ORANGE, string);
    return 1;
}
Reply
#2

Have you done new AutoMessages?
Reply
#3

Quote:
Originally Posted by mobiliz
Посмотреть сообщение
Have you done new AutoMessages?
pawn Код:
new AutoMessages[][] = {
    "Welcome to New Dimension Roleplay.I hope you enjoy our server",
    "Our Development team is working hard and making updates DAILY",
    "If you want to join a faction make apply at forums[/forums] and wait for leader's approval",
    "If you see a rulebreaker in action,take a SS using F8 and report on forums[/forums]",
    "Our admin team is trained and experienced.Do not teach them how to work!",
    "Do not ask for admin status.Earn it as all others did!",
    "Server is running 24/7 and it goes down only when announced!",
    "You can join our Teamspeak 3 server.You can get the IP by typing [/ts].",
    "Thank you for choosing us!You won't regret your decision."

};
Reply
#4

Код:
-->   format(string, sizeof(string), "New Dimension Says: %s", AutoMessages[random(sizeof(AutoMessages[]))]);
All that was changed here was the [] after AutoMessages, this defines which array of AutoMessages to randomize.
Had to actually think about this one and even test it, but it did compile, however, didn't test if it worked...

However, just go ahead and give it a shot, then post the results
Reply
#5

Well nothing.I still receive those 4 errors.I don't get whats the wrong since it works on the other script...Any other ideas?
Reply
#6

Download A new Version Of Pawn
Reply
#7

I downloaded the latest server package from the samp website,which contains the newest pawno.
Reply
#8

AutoMessages[9][50]=

9 Lines, 50 letters (Or change 50 to fit longest message as I didn't count, just estimated)

EDIT: This would only display one random sentence though, why randomize it?
Reply
#9

Try Mine

pawn Код:
#include <a_samp>

forward sendmessage();

new automessage[][] =
{
    "message1",
    "message2",
    "message3",
    "message4",
    "message5"
};


public OnFilterScriptInit(){ return SetTimer("sendmessage",3000,1); } //Send time
public sendmessage() { return SendClientMessageToAll(0x9EC73DAA, automessage[random(sizeof(automessage))]); }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)