SA-MP Forums Archive
Random Messages Problems - 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: Random Messages Problems (/showthread.php?tid=344051)



Random Messages Problems - Bread - 19.05.2012

PHP код:
//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"60000true);
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:
PHP код:
C:\Users\Lee\Desktop\E-RPv0.1\gamemodes\E-RPv0.1.pwn(450) : error 029invalid expressionassumed zero
C
:\Users\Lee\Desktop\E-RPv0.1\gamemodes\E-RPv0.1.pwn(457) : error 035argument type mismatch (argument 1)
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
2 Errors

Anyone know why?


Re: Random Messages Problems - deimantas1 - 19.05.2012

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



Re: Random Messages Problems - Bread - 19.05.2012

Please edit it and put it into [php] tags


Re: Random Messages Problems - Bread - 19.05.2012

Thanks , that cured one error , still got:

PHP код:
C:\Users\Lee\Desktop\E-RPv0.1\gamemodes\E-RPv0.1.pwn(450) : error 029invalid expressionassumed zero
C
:\Users\Lee\Desktop\E-RPv0.1\gamemodes\E-RPv0.1.pwn(457) : error 035argument type mismatch (argument 1)
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
2 Errors




Re: Random Messages Problems - deimantas1 - 19.05.2012

Which lines?


Re: Random Messages Problems - Bread - 19.05.2012

PHP код:
450:}

457:   SendClientMessageToAll(COLOR_YELLOW randomMessages[randomMsg]); 



Re: Random Messages Problems - Britas - 19.05.2012

PHP код:
//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"60000true); 
forward RandomMessages(); 
public 
RandomMessages() 

    new 
randomMsg random(sizeof(randomMessages)); 
    
SendClientMessageToAll(COLOR_YELLOW randomMessages[randomMsg]); 




Re: Random Messages Problems - IceCube! - 19.05.2012

REMOVED Incorrect looking again
Just compared the currant code postd above to your orignal code and the fix is above.


Re: Random Messages Problems - Bread - 19.05.2012

Thanks Britas.