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 |
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;
}
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;
}
G:\Documents and Settings\Administrator\Desktop\Gta Scripting\DM test\gamemodes\test.pwn(294) : error 027: invalid character constant
G:\Documents and Settings\Administrator\Desktop\Gta Scripting\DM test\gamemodes\test.pwn(294) : error 017: undefined symbol "Only"
G:\Documents and Settings\Administrator\Desktop\Gta Scripting\DM test\gamemodes\test.pwn(294) : error 017: undefined symbol "RCON"
COMMAND:announce(playerid, params[])
{
new text[64], time, style;
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR,"Only RCON Adminstrator can use this!");
else if (sscanf(params, "iis[64]", style, time, text)) return SendClientMessage(playerid,COLOR,"Usage: /announce <style[0-6]> <time in ms> <text>");
else if (strlen(text) > 64) return SendClientMessage(playerid,COLOR,"Message too long, please make it with less than 64 letters!");
else if (style == 2) return SendClientMessage(playerid,COLOR,"Bug with style 2! Do not use it!");
else if (style < 0 || style > 6) return SendClientMessage(playerid,0x854900FF,"Invalid style");
else if (time > 20*1000) return SendClientMessage(playerid, COLOR,"No longer than 20 seconds");
else {
GameTextForAll(text, time, style);
}
return 1;
}
Your fogot the color on sendclientmessage.
pawn Код:
|
#include <zcmd>
#include <sscanf2>
When I put these it says they are Undefined Symbol if I compile..
|
It compiles fine for me, I tested.
Make sure, you didn't add it inside any callback. or that you are using pawn Код:
|