28.11.2011, 13:27
I am pretty new on scripting, and learning commands with ZMCD.
I have failed my command after a lot of different attempts, and if someone could help me with fixing it I'd really appreciate it!
So, I get these errors;
And this is a code..
What is wrong with it?
I have failed my command after a lot of different attempts, and if someone could help me with fixing it I'd really appreciate it!
So, I get these errors;
Quote:
G:\Documents and Settings\Administrator\Desktop\Gta Scripting\DM test\gamemodes\test.pwn(283) : error 035: argument type mismatch (argument 2) G:\Documents and Settings\Administrator\Desktop\Gta Scripting\DM test\gamemodes\test.pwn(287) : error 035: argument type mismatch (argument 2) G:\Documents and Settings\Administrator\Desktop\Gta Scripting\DM test\gamemodes\test.pwn(289) : error 035: argument type mismatch (argument 2) G:\Documents and Settings\Administrator\Desktop\Gta Scripting\DM test\gamemodes\test.pwn(291) : error 035: argument type mismatch (argument 2) G:\Documents and Settings\Administrator\Desktop\Gta Scripting\DM test\gamemodes\test.pwn(292) : warning 209: function "cmd_announce" should return a value G:\Documents and Settings\Administrator\Desktop\Gta Scripting\DM test\gamemodes\test.pwn(293) : error 010: invalid function or declaration G:\Documents and Settings\Administrator\Desktop\Gta Scripting\DM test\gamemodes\test.pwn(294) : error 010: invalid function or declaration |
pawn Код:
COMMAND:announce(playerid, params[])
{
if(!IsPlayerAdmin(playerid))
{
new text[64], time, style;
if (sscanf(params, "iis[64]", style, time, text))
{
if (strlen(text) > 64)
{
if(style == 2)
{
if (style < 0 || style > 6)
{
if (time > 20*1000)
GameTextForAll(text, time, style);
}
else return SendClientMessage(playerid,"No longer than 20 seconds");
}
else return SendClientMessage(playerid,0x854900FF,"Invalid style");
}
else return SendClientMessage(playerid,"Bug with style 2! Do not use it!");
}
else return SendClientMessage(playerid,"Message too long, please make it with less than 64 letters!");
}
else return SendClientMessage(playerid,"Usage: /announce <style[0-6]> <time in ms> <text>");
}
else return SendClientMessage(playerid,''Only RCON Adminstrator can use this!''
return 1;
}