07.02.2011, 11:50
This is my code
And this is my warning.
pawn Код:
dcmd_cm(playerid, params[])
{
if(gTeam[playerid] == TEAM_COPP)
{
new message[128];
if(sscanf(params, "s", message)) SendClientMessage(playerid, COLOR_USAGE, "USAGE: /cm (message)");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && gTeam[playerid] == TEAM_COP)
{
new playername[MAX_PLAYER_NAME], string[128];
GetPlayerName(i, playername, sizeof(playername));
format(string, sizeof(string), "cop radio: %s(%d) %s", playername, i, message);
SendClientMessage(i, COLOR_TEAMCHAT, string);
format(string, sizeof(string), "cop radio: %s(%d) %s", playername, i, message);
printf("%s", string);
return 1;
}
}
return 1;
}
return 0;
}
Код:
sscanf warning: Strings without a length are deprecated, please add a destination size.