SA-MP Forums Archive
Invalid Expression[REP+] - 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: Invalid Expression[REP+] (/showthread.php?tid=375624)



Invalid Expression[REP+] - Strech - 07.09.2012

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;
}



Re: Invalid Expression[REP+] - mobiliz - 07.09.2012

Have you done new AutoMessages?


Re: Invalid Expression[REP+] - Strech - 07.09.2012

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."

};



Re: Invalid Expression[REP+] - XGh0stz - 07.09.2012

Код:
-->   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


Re: Invalid Expression[REP+] - Strech - 07.09.2012

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?


Re: Invalid Expression[REP+] - Windrush - 07.09.2012

Download A new Version Of Pawn


Re: Invalid Expression[REP+] - Strech - 07.09.2012

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


Re: Invalid Expression[REP+] - XGh0stz - 07.09.2012

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?


Re: Invalid Expression[REP+] - Windrush - 07.09.2012

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))]); }