SA-MP Forums Archive
Need help with some Errors - 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: Need help with some Errors (/showthread.php?tid=493954)



Need help with some Errors - ultrAslan - 10.02.2014

Hello all

I founded this audio streamin code what i need but when i put it in a new FS i got 8 erros with invalid funtion ore decloration.

Код:
if(!strcmp(cmdtext, "/sarki", true, 6)) {
	if(!IsPlayerAdmin(playerid)) {
		return SendClientMessage(playerid, 0xFF0000FF, "<!> RCON admin degilsin!");
	}
	if(cmdtext[6] != ' ' || !cmdtext[7]) {
		return SendClientMessage(playerid, 0xFF0000FF, "<!> /sarki [url]");
	}
	for(new i = 0; i < MAX_PLAYERS; ++i) {
		if(IsPlayerConnected(i)) {
			PlayAudioStreamForPlayer(i, cmdtext[7]);
		}
	}
	return 1;
}
Must i put this code special anywhere ore what i do false ?


Re: Need help with some Errors - Konstantinos - 10.02.2014

Yes, you should put it inside of OnPlayerCommandText callback because if you place it outside of any callback, you will get the invalid function or declaration.


AW: Re: Need help with some Errors - ultrAslan - 10.02.2014

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Yes, you should put it inside of OnPlayerCommandText callback because if you place it outside of any callback, you will get the invalid function or declaration.
hmm when i put it there i got 26 errors and many warnings.

can you make me the FS please ?


Re: Need help with some Errors - Konstantinos - 10.02.2014

As you wish:

http://www.solidfiles.com/d/5ca6b52654/radio.pwn
http://www.solidfiles.com/d/97d2c21a85/radio.amx