SA-MP Forums Archive
Where ? - 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: Where ? (/showthread.php?tid=391510)



Where ? - Red_Dragon. - 10.11.2012

pawn Код:
new AutoMessages[][] = {
Where should i put in the script a "new" state like this ?and should i make a stock or anything for it ?!


Re: Where ? - Red_Dragon. - 10.11.2012

I now get these errors:
pawn Код:
C:\Users\Mody\Desktop\Yea.pwn(13) : error 017: undefined symbol "AutoMessages"
C:\Users\Mody\Desktop\Yea.pwn(13) : error 017: undefined symbol "AutoMessages"
C:\Users\Mody\Desktop\Yea.pwn(13) : error 029: invalid expression, assumed zero
C:\Users\Mody\Desktop\Yea.pwn(13) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
from line 10 to line 16:
pawn Код:
forward AutoMessage();
public AutoMessage() {
    new string[128];
    format(string, sizeof(string), "%s", AutoMessages[random(sizeof(AutoMessages))]);
    SendClientMessageToAll(COLOR_YELLOW2, string);
    return 1;
}



Re: Where ? - tyler12 - 10.11.2012

PHP код:
new AutoMessages[][] = {
    
"Message",
    
"Message",
    
"Message",
    
"Message"
};
public 
OnFilterScriptInit()
{
    
SetTimer("SendAutoMessage",60000,1);
    return 
1;
}
forward public SendAutoMessage();
public 
SendAutoMessage() {
    new 
string[128];
    
format(string,sizeof(string),"%s",AutoMessages[random(sizeof(AutoMessages))]);
    
SendClientMessageToAll(-1,string);
    return 
1;




Re: Where ? - Red_Dragon. - 10.11.2012

Still get these errors:
pawn Код:
C:\Users\Mody\Desktop\Yea.pwn(13) : error 017: undefined symbol "AutoMessages"
C:\Users\Mody\Desktop\Yea.pwn(13) : error 017: undefined symbol "AutoMessages"
C:\Users\Mody\Desktop\Yea.pwn(13) : error 029: invalid expression, assumed zero
C:\Users\Mody\Desktop\Yea.pwn(13) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.



Re: Where ? - MichaelWharton101 - 10.11.2012

try this, it is what i use to use.

Код:
new BugMessage;
forward Bug();
public Bug()
{
	if(!BugMessage)
	{
		SendClientMessageToAll(COLOR_LIME, "Found a bug? Report it using /reportbug and scripters will check it once possible.");
		BugMessage = 1;
	}
	else if(BugMessage == 1)
	{
		SendClientMessageToAll(COLOR_ORANGE, "Can't find the place you're looking for? /search has some useful locations.");
        BugMessage = 2;
	}
	else if(BugMessage == 2)
	{
		SendClientMessageToAll(COLOR_YELLOW, "You can request help from our community helpers using /helpme.");
		BugMessage = 3;
	}
	else if(BugMessage == 3)
	{
		SendClientMessageToAll(COLOR_RED, "Want to get free VIP packages? /refhelp.");
		BugMessage = 4;
	}
	else if(BugMessage == 4)
	{
		SendClientMessageToAll(COLOR_RED, "If you wish to have a stats refund, please visit www.zGaming.org and fill your request there.");
		BugMessage = 0;
	}
	return 1;
}
it says the bug stuff but it really is not.


Re: Where ? - Red_Dragon. - 10.11.2012

Please specify. What do you mean by OnPlayerConnect ? put what under it ?

EDIT: Trying it


Re: Where ? - MichaelWharton101 - 10.11.2012

Quote:
Originally Posted by Red_Dragon.
Посмотреть сообщение
Please specify. What do you mean by OnPlayerConnect ? put what under it ?

EDIT: Trying it
I was wrong, Look at the change i did.


Re: Where ? - tyler12 - 10.11.2012

Where did you place the code? The code is all seperate, not under any callbacks.


Re: Where ? - MichaelWharton101 - 10.11.2012

It depends on how your script is setup.


Re: Where ? - Red_Dragon. - 10.11.2012

Michael, the one you gave me works, thanks but i need mine