PDA

View Full Version : need a little help here :( cmd /ask didn't work good


AngeloBrand98
02/08/2017, 02:33 PM
Hi, i have made an script with function to ask something about server. The command would be :


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 :D:D:D

Astralis
02/08/2017, 02:39 PM
Increase string sizes. Also "SendMessageToAdmins".

FreAkeD
02/08/2017, 02:41 PM
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.

AngeloBrand98
02/08/2017, 02:44 PM
ok, i"ll try it...sorry i use that string too big cuz maybe it can show more text xD