why doesnt this work? - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: why doesnt this work? (
/showthread.php?tid=220804)
why doesnt this work? -
THE_KNOWN - 04.02.2011
Код:
CMD:ad(playerid, params[])
{
new string[128];
if(sscanf(params,"s",params)) return SendClientMessage(playerid, red, "USAGE:/ad [msg]");
format(string, 128, "((%s)) %s", oname[playerid], params);
SendClientMessageToAll(ocolour[playerid], string);
return 1;
}
argument type mismatch (argument 1) at SendClientMessage line
Re: why doesnt this work? -
xRyder - 04.02.2011
What's the "ocolour[playerid]"? You store color in that or...?
Re: why doesnt this work? -
HyperZ - 04.02.2011
You want this?
pawn Код:
CMD:ad(playerid, params[])
{
new string[128], PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, PlayerName, MAX_PLAYER_NAME);
if(sscanf(params,"s",params)) return SendClientMessage(playerid, red, "USAGE:/ad [msg]");
format(string, 128, "((%s)) %s", PlayerName, params);
SendClientMessageToAll(-1, string);
return 1;
}
Re: why doesnt this work? -
Haydz - 04.02.2011
Try putting a s[128] in the sscanf line.
Re: why doesnt this work? -
xRyder - 04.02.2011
Quote:
Originally Posted by Hayden_Bruin
Try putting a s[128] in the sscanf line.
|
When you use sscanf + ZCMD + params[] - I think you don't need to declare size of the string?
Maybe there's a problem with it's color in SendClientMessageToAll.
Re: why doesnt this work? -
THE_KNOWN - 04.02.2011
yes i stored a hex code in ocolour but it gives me an error
Re: why doesnt this work? -
Steven Paul - 04.02.2011
show us the error