SA-MP Forums Archive
Dont Have Any Idea ? - 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: Dont Have Any Idea ? (/showthread.php?tid=316643)



Dont Have Any Idea ? - DonWade - 07.02.2012

Код:
dcmd_a(playerid,params[])
{
    new msg[128];
    if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_RED, "Unknown command. Use /cmds to see our server commands.");
 	if(sscanf(params,"s",msg))
	{
  		SendClientMessage(playerid,COLOR_RED,"USAGE: /a [Message]");
	    return 1;
	}
	format(msg,sizeof(msg),"%s:   %s",PlayerName(playerid),msg);
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(PlayerInfo[i][pAdmin] > 0)
		{
		    SendClientMessage(i,COLOR_PURPLE,msg);
		}
	}
	return 1;
}
Here is my selfmade admin chat , and its working fine , except that it can not display more than aprox 60-80 char.
I tried with new msg[512] but no effect :S

Where is the prob?


Re: Dont Have Any Idea ? - Nonameman - 07.02.2012

Change:
pawn Код:
sscanf(params,"s",msg)
To:
pawn Код:
sscanf(params,"s[128]",msg)
(the max length of the string you are searching for, to put in msg variable)


Re: Dont Have Any Idea ? - DonWade - 07.02.2012

Thank you . I forgot that
+rep


Re: Dont Have Any Idea ? - Nonameman - 08.02.2012

Haha, me too, many times, that's why I could help.
I'm glad to help you.