12.03.2011, 05:48
Do not use [256]. Use maximal [128].
And sscanf is called when there are NO params in a string. Here's an example:
And sscanf is called when there are NO params in a string. Here's an example:
pawn Код:
dcmd_a(playerid, params[])
{
new str[128], input[75], pName[MAX_PLAYER_NAME];
if(sscanf(params, "s", input)) return SendClientMessage(playerid, 0xFFFFFFAA, "USAGE: /a [text]");
if(IsPlayerAdmin(playerid) || Spieler[playerid][AdminLevel] > 0){
format(str, 128, "[ADMIN] %s(%d): %s", pName, playerid, input);
for(new i = 0; i < MAX_PLAYERS; i++)
if(IsPlayerAdmin(i) || Spieler[playerid][AdminLevel] > 0)
SendClientMessage(i, 0x00FFFFAA, str);
}
return 1;
}