SA-MP Forums Archive
Help with these errors please. - 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: Help with these errors please. (/showthread.php?tid=542771)



Help with these errors please. - Glossy42O - 22.10.2014

PHP код:
C:\Users\yan\Desktop\Cops And Robbers\gamemodes\LSCNR.pwn(187) : error 001expected token";"but found "-identifier-"
C:\Users\yan\Desktop\Cops And Robbers\gamemodes\LSCNR.pwn(345) : error 001expected token";"but found ":"
C:\Users\yan\Desktop\Cops And Robbers\gamemodes\LSCNR.pwn(348) : error 017undefined symbol "Random"
C:\Users\yan\Desktop\Cops And Robbers\gamemodes\LSCNR.pwn(349) : error 033: array must be indexed (variable "RandomMSG")
C:\Users\yan\Desktop\Cops And Robbers\gamemodes\LSCNR.pwn(348) : warning 204symbol is assigned a value that is never used"randMSG"
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
4 Errors

PHP код:
forward SendMSG():
public 
SendMSG()
{
 new 
randMSG Random,(sizeof(random));
 
SendClientMessageToAll(COLOR_REDRandomMSG[RandomMSG]);

Line 187
PHP код:
main() 



Re: Help with these errors please. - Sabur - 22.10.2014

forward SendMSG();
public SendMSG()
{
new randMSG = random(sizeof(RandomMSG));
SendClientMessageToAll(COLOR_RED, RandomMSG[RandomMSG]);
}


Re: Help with these errors please. - Threshold - 22.10.2014

https://sampwiki.blast.hk/wiki/Scripting_Basics#Arrays
https://sampwiki.blast.hk/wiki/Random
https://sampwiki.blast.hk/wiki/Sizeof


Re: Help with these errors please. - Glossy42O - 22.10.2014

Sabur, i got this after i pasted urs

PHP код:
C:\Users\yan\Desktop\Cops And Robbers\gamemodes\LSCNR.pwn(187) : error 001expected token";"but found "-identifier-"
C:\Users\yan\Desktop\Cops And Robbers\gamemodes\LSCNR.pwn(349) : error 033: array must be indexed (variable "RandomMSG")
C:\Users\yan\Desktop\Cops And Robbers\gamemodes\LSCNR.pwn(348) : warning 204symbol is assigned a value that is never used"randMSG"
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase


2 Errors




Re: Help with these errors please. - AYOUYOU - 22.10.2014

Can you Show me The Random Message ?


Re: Help with these errors please. - gurmani11 - 22.10.2014

pawn Код:
forward SendMSG();
public SendMSG()
{
     new randMSG = random(sizeof(RandomMSG));
     SendClientMessageToAll(COLOR_RED, RandomMSG[randMSG]);
}



Re: Help with these errors please. - Glossy42O - 22.10.2014

Thanks.

1 error.
PHP код:
C:\Users\yan\Desktop\Cops And Robbers\gamemodes\LSCNR.pwn(187) : error 001expected token";"but found "-identifier-" 
PHP код:
main() 



Re: Help with these errors please. - AYOUYOU - 22.10.2014

Do like This
Exemple
"Only Noobs Rule break! Are you a noob ?",
in The Last message
"Only Noobs Rule break! Are you a noob ?"
};


Re: Help with these errors please. - Glossy42O - 22.10.2014

Like that?
PHP код:
new RandomMSG[][] =
{
 
"{FF9966}[BOT]{FFFFFF}: Saw a hacker\rule breaker? feel free to /report",
 
"{FF9966}[BOT]{FFFFFF}: If you need any help or you don't know the commandsm Just use {FFFF33}(/commands and /help)",
 
"{FF9966}[BOT]{FFFFFF}: For more information. Register on our forums, www.lscnr-samp.url.ph"




Re: Help with these errors please. - AYOUYOU - 22.10.2014

PHP код:
new RandomMSG[][] =
{
 
"{FF9966}[BOT]{FFFFFF}: Saw a hacker\rule breaker? feel free to /report",
 
"{FF9966}[BOT]{FFFFFF}: If you need any help or you don't know the commandsm Just use {FFFF33}(/commands and /help)",
 
"{FF9966}[BOT]{FFFFFF}: For more information. Register on our forums, www.lscnr-samp.url.ph"
};