[HELP] unknown command - 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] unknown command (
/showthread.php?tid=556954)
[HELP] unknown command -
AgusZ - 12.01.2015
i typing /ads test (work)
and i typing /ads test test (not work)
here my code
Код:
CMD:ads( playerid, params[ ] )
{
new pName[MAX_PLAYER_NAME], text[900], string[128];
GetPlayerName(playerid, pName,sizeof(pName));
if(sscanf(params, "s[128]",text)) return SendClientMessage(playerid, -1,"{F300FF}***AdmMsg {0049FF}:{FFFFFF}Usage: /ads [text]");
format(string,sizeof(string),"%s Contact: %s(%i)",text,pName,playerid);
printf(string);
SendClientMessageToAll(COLOR_WHITE,string);
return 1;
}
Re: [HELP] unknown command -
Gammix - 12.01.2015
You have messed up with string size, just use 128 instead of a large 900.
And you need to increase the var string's size because you can't insert a external string of similar size or larger actully and then implement it in format to add text.
Try it and report.
Re: [HELP] unknown command -
CalvinC - 12.01.2015
The max text length in SA-MP is 128-144, there's no reason to put in 900, it'll just slow down your script.