09.05.2011, 16:21
O erro estava aqui no result, deveria ser tmp ou algo do tipo. define no topo do OnPlayerCommandText new tmp[256];
pawn Код:
if (strcmp("/radio", cmdtext, true, 10) == 0 || strcmp("/r", cmdtext, true, 10) == 0)
{
if(TemRadio[playerid] == 1 && PlayerInfo[playerid][pClass] > 1)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(tmp)) // O erro estava aqui no result, deveria ser tmp ou algo do tipo. define no topo do OnPlayerCommandText new tmp[256];
{
SendClientMessage(playerid, COLOR_GRAD, "USE: (/R)adio [texto]");
return 1;
}
format(string, sizeof(string), "Admin %s: %s", sendername, result);
SendRadioMessage(0xFF6400FF,string);
}
return 1;
}