07.03.2012, 15:48
pawn Код:
CMD:pr(playerid, params[])
{
if(pInfo[playerid][pRadio] == 0) return SendClientMessage(playerid, COLOR_RED, "[ERROR:] You don't have a portable radio.");
if(pInfo[playerid][pRadioChannel] == 0) return SendClientMessage(playerid, COLOR_RED, "[ERROR:] You need to set the frequency first (/setfreq).");
new msg[512];
if(sscanf(params, "s[512]", msg)) return SendClientMessage(playerid, COLOR_USAGE, "[USAGE:] /pr [text].");
new string[1024];
format(string, 1024, "(%i)(Portable Radio) %s: %s",pInfo[playerid][pRadioChannel], RemoveUnderScore(playerid), msg);
for(new i=0;i<MAX_PLAYERS;i++)
{
if(!IsPlayerConnected(i)) continue
if(pInfo[i][pRadio] == 0) continue
if(pInfo[i][pRadioChannel] == 0) continue
if(pInfo[i][pRadioChannel] == pInfo[playerid][pRadioChannel]){
SendClientMessage(i, COLOR_RADIO, string);
}
}
format(string, 1024, "(Portable Radio) %s: %s",RemoveUnderScore(playerid), msg);
ProxDetector(5.0, playerid, string, COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE);
return 1;
}
At what size should I set the string length? I want the message to be able to fill the whole one line of chat. I used 128 as size before, and the text was cut out at the first third of the screen.