SA-MP Forums Archive
need a little help here :( cmd /ask didn't work good - 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: need a little help here :( cmd /ask didn't work good (/showthread.php?tid=638543)



need a little help here :( cmd /ask didn't work good - AngeloBrand98 - 02.08.2017

Hi, i have made an script with function to ask something about server. The command would be :

Code:
CMD:askadmin(playerid, params[])
{
	new text[1080], string[1080], name[MAX_PLAYER_NAME];
	if(sscanf(params, "s", text)) return SendClientMessage(playerid,COLOR_WHITE, "USAGE: /askadmin [text]");
	GetPlayerName(playerid, name, sizeof(name));
	format(string ,5000 ,"%s(Id:%d) has asked: %s [/apm]" ,name, playerid, text);
	SendMessageToAdmins(COLOR_RED, string);
	format(string, sizeof(string), "You asked admin: %s", text);
	SendClientMessage(playerid, COLOR_RED, string);
	printf("%s, has asked Admins: %s.",name, text);
	return 1;
}
The problem is when player ask something in many words, then only show a little bit on mainchat. For example when i aksed " admin, how to buy a house in this server ?" the will show on mainchat only "admin, how to buy a house in th". Idk why this happening, if someone know the solution then please tell me bellow, Thanks


Re: need a little help here :( cmd /ask didn't work good - Astralis - 02.08.2017

Increase string sizes. Also "SendMessageToAdmins".


Re: need a little help here :( cmd /ask didn't work good - FreAkeD - 02.08.2017

Code:
if(sscanf(params, "s[1080]", text)) return SendClientMessage(playerid,COLOR_WHITE, "USAGE: /askadmin [text]");

format(string, sizeof(string), "%s(Id:%d) has asked: %s [/apm]", name, playerid, text);
SendMessageToAdmins(COLOR_RED, string);
Try that, and by the way, you don't need to have the string that big of a size.


Re: need a little help here :( cmd /ask didn't work good - AngeloBrand98 - 02.08.2017

ok, i"ll try it...sorry i use that string too big cuz maybe it can show more text xD