02.03.2011, 22:14
pawn Код:
Topo:
new bool:Anunciado[500];
if(strcmp(cmd, "/anuncio", true) == 0 || strcmp(cmd, "/an", true) == 0)
{
if(Anunciado[playerid] == true) return true;
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);
Anunciado[playerid] = true;
SetTimerEx("Galoo", 15*6000, 0, "d", playerid);
}
return 1;
}
public Galoo(playerid) {
Anunciado[playerid] == false;
return true;
}