#include a_samp
public OnPlayerCommandText(playerid, cmdtext[])
if(strcmp (cmdtext, "/test", true) == 0)
{
new iString[400];
strcat(iString, "- test");
strcat(iString, "- {4B4347}test\n");
strcat(iString, "- {4BFF47}test\n");
strcat(iString, "- {FF0303}test\n");
strcat(iString, "- {FFFFFF}test\n");
strcat(iString, "- {0003FF}test\n");
strcat(iString, "- {DD8000}test\n");
strcat(iString, "- {DD00D2}test\n");
strcat(iString, "- {00ECB7}test\n");
strcat(iString, "- {FF06FF}test\n");
strcat(iString, "- {00ECFF}test\n");
strcat(iString, "- {007000}test\n");
ShowPlayerDialog(playerid, DIALOG_STYLE_MSGBOX, "Ok", iString, "Close", "");
return 1;
}
C:\Program Files\Files2\SA-MP Servers\TEST [TESTING SERVER]\filterscripts\11.pwn(19) : error 035: argument type mismatch (argument 3)
C:\Program Files\Files2\SA-MP Servers\Cops And Robbers [TESTING SERVER]\filterscripts\11.pwn(22) : warning 209: function "OnPlayerCommandText" should return a value
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Error.
ShowPlayerDialog(playerid, 5, DIALOG_STYLE_MSGBOX, "ok", iString, "Close", "");
C:\Program Files\Files2\SA-MP Servers\TEST[TESTING SERVER]\filterscripts\11.pwn(22) : warning 209: function "OnPlayerCommandText" should return a value
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Warning.
#include a_samp
public OnPlayerCommandText(playerid, cmdtext[])
if(strcmp (cmdtext, "/test", true) == 0)
{
new iString[400];
strcat(iString, "- test");
strcat(iString, "- {4B4347}test\n");
strcat(iString, "- {4BFF47}test\n");
strcat(iString, "- {FF0303}test\n");
strcat(iString, "- {FFFFFF}test\n");
strcat(iString, "- {0003FF}test\n");
strcat(iString, "- {DD8000}test\n");
strcat(iString, "- {DD00D2}test\n");
strcat(iString, "- {00ECB7}test\n");
strcat(iString, "- {FF06FF}test\n");
strcat(iString, "- {00ECFF}test\n");
strcat(iString, "- {007000}test\n");
ShowPlayerDialog(playerid, 5, DIALOG_STYLE_MSGBOX, "ok", iString, "Close", "");
return 1;
}
You need to return 1/0 outside of all brackeds (basicly above the closing bracked of the callback) under the callback of the warning.
|
#include a_samp
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp (cmdtext, "/test", true) == 0)
{
new iString[400];
strcat(iString, "- test");
strcat(iString, "- {4B4347}test\n");
strcat(iString, "- {4BFF47}test\n");
strcat(iString, "- {FF0303}test\n");
strcat(iString, "- {FFFFFF}test\n");
strcat(iString, "- {0003FF}test\n");
strcat(iString, "- {DD8000}test\n");
strcat(iString, "- {DD00D2}test\n");
strcat(iString, "- {00ECB7}test\n");
strcat(iString, "- {FF06FF}test\n");
strcat(iString, "- {00ECFF}test\n");
strcat(iString, "- {007000}test\n");
ShowPlayerDialog(playerid, 5, DIALOG_STYLE_MSGBOX, "ok", iString, "Close", "");
}
return 1;
}