08.04.2012, 08:25
//admin message/////////////////////////////////////////////////////////////
dcmd_a(playerid, params[])
{
if(pAdminLevel[playerid] >= 1 || IsPlayerAdmin(playerid))
{
new amessage[256], stringamessage[512], sendername[64];
if (sscanf(params, "s", amessage)) return SendClientMessage(playerid, 0xff0000aa, "* Usage: /a [message]");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(stringamessage, sizeof(stringamessage), "ADMIN MESSAGE | %s: %s", sendername,amessage);
SendClientMessageToAll(blue, stringamessage);
return 1;
}
else return SendClientMessage(playerid, red, "You do not have permission to use this command");
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
no matter how big the string memory, when the message gets sent, 60% of it gets cut off and I get a message on the server saying
string buffer overflow and strings without a length are deprecated, please add a destination size
dcmd_a(playerid, params[])
{
if(pAdminLevel[playerid] >= 1 || IsPlayerAdmin(playerid))
{
new amessage[256], stringamessage[512], sendername[64];
if (sscanf(params, "s", amessage)) return SendClientMessage(playerid, 0xff0000aa, "* Usage: /a [message]");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(stringamessage, sizeof(stringamessage), "ADMIN MESSAGE | %s: %s", sendername,amessage);
SendClientMessageToAll(blue, stringamessage);
return 1;
}
else return SendClientMessage(playerid, red, "You do not have permission to use this command");
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
no matter how big the string memory, when the message gets sent, 60% of it gets cut off and I get a message on the server saying
string buffer overflow and strings without a length are deprecated, please add a destination size