SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 02/08/2017, 02:33 PM   #1
AngeloBrand98
Big Clucker
 
Join Date: Sep 2016
Posts: 66
Reputation: 0
Default need a little help here :( cmd /ask didn't work good

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
AngeloBrand98 is offline   Reply With Quote
Old 02/08/2017, 02:39 PM   #2
Astralis
Guest
 
Posts: n/a
Default Re: need a little help here :( cmd /ask didn't work good

Increase string sizes. Also "SendMessageToAdmins".
  Reply With Quote
Old 02/08/2017, 02:41 PM   #3
FreAkeD
Gangsta
 
FreAkeD's Avatar
 
Join Date: May 2012
Location: Australia
Posts: 630
Reputation: 87
Default Re: need a little help here :( cmd /ask didn't work good

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.
FreAkeD is offline   Reply With Quote
Old 02/08/2017, 02:44 PM   #4
AngeloBrand98
Big Clucker
 
Join Date: Sep 2016
Posts: 66
Reputation: 0
Default Re: need a little help here :( cmd /ask didn't work good

ok, i"ll try it...sorry i use that string too big cuz maybe it can show more text xD
AngeloBrand98 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why didn't work ? anonimus22222 Scripting Help 7 03/09/2016 08:06 PM
Why is that didn't work? Gangster-rocks Scripting Help 8 28/06/2012 11:59 AM
Why this CMD didn't work?(+1 REP) Andrew97 Scripting Help 7 16/04/2012 12:42 PM
FS didn't work Lakiya Scripting Help 3 31/03/2012 04:04 AM
any FS didn't work - plz help me lakshikagayal Server Support 12 10/11/2011 07:23 PM


All times are GMT. The time now is 06:51 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.