02.03.2011, 21:22
comofas?
Quero que o player sу possa fazer um anъncio de 15 em 15 minutos. Jб tentei e fiz merda.
pawn Код:
if(strcmp(cmd, "/anuncio", true) == 0 || strcmp(cmd, "/an", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
new string[256];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_RED, "USE: /av [texto]");
return 1;
}
format(string, sizeof(string), "{00FF00}%s {00FF00}[{FFFFFF}ID: %d{00FF00}]{FFFFFF}: %s", sendername, playerid, result);
SendClientMessageToAll(0xFFFFFFFF, string);
SendClientMessage(playerid, 0xFF0000FF, "O anъncio custou {00FF00}$3800{FF0000}.");
GivePlayerMoney(playerid, -3800);
}
return 1;
}