[HELP] unknown command
#1

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;
}
Reply
#2

You have messed up with string size, just use 128 instead of a large 900.
pawn Код:
new text[128];
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.
pawn Код:
new string[156];
Try it and report.
Reply
#3

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.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)