05.10.2011, 20:03
alguem tem o codigo do /anuncio para me passar nao acho aki no forum!!!
if(strcmp(cmdtext,"/anuncio",true) == 0 || strcmp(cmdtext,"/an",true) == 0)
{
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[256];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
if(!strlen(result))
{
SendClientMessage(playerid,BRANCO,"Use /(AN)uncio [Texto]");
return 1;
}
new string[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string,sizeof(string),"[Anъncio]: %s: %s",name,result);
SendClientMessageToAll(0xFFFFFFAA,string);
return 1;
}
if(!strcmp(cmd,"/anuncio",true))
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp)) return SendClientMessage(playerid, -1, "(erro): /anuncio [text]");
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;
new sStr[120],nome[MAX_PLAYER_NAME];GetPlayerName(playerid,nome,sizeof(nome));
format(sStr,sizeof(sStr),"Anъncio %s: %s",nome,(result));
SendClientMessageToAll(-1,sStr);
return 1;
}