13.06.2011, 21:09
pawn Код:
if(strcmp(cmd, "/anuncio", true) == 0 || strcmp(cmd, "/an", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " Vocк Nгo Estб Logado !");
return 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(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/an)uncio [Texto]");
return 1;
}
if(PlayerInfo[playerid][pLevel] < 3)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк precisa ser nнvel 3 ou mais para anunciar");
return 1;
format(string, sizeof(string), " Por favor, Tente apуs %d segundos para o proximo anъncio !", (addtimer/1000));
SendClientMessage(playerid, COLOR_GRAD2, string);
return 1;
}
if((!adds) && (PlayerInfo[playerid][pAdmin] < 1))
{
format(string, sizeof(string), " Por favor, Tente apуs %d segundos para o proximo anъncio !", (addtimer/1000));
SendClientMessage(playerid, COLOR_GRAD2, string);
return 1;
}
new payout = idx * 2;
if(GetPlayerGP(playerid) < payout)
{
format(string, sizeof(string), "Vocк usou %d characteres e custou $%d, Vocк nгo tem Esse Dinheiro.", offset, payout);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
return 1;
}
GivePlayerGP(playerid, - payout);
SBizzInfo[7][sbTill] += payout;
ExtortionSBiz(7, payout);
for(new luplay=0;luplay<6;luplay++){
if(strfind(result, IP[luplay], true) != -1){result = "PКGO EM FRБGRANTE!!!Jogador tentando divulgar algum IP.";}}
format(string, sizeof(string), "Anъncio: %s, Contato: %s Tel: %d", result, sendername,PlayerInfo[playerid][pPnumber]);
OOCNews(TEAM_GROVE_COLOR,string);
format(string, sizeof(string), "~r~Pagou $%d~n~~w~Mensagem Contem: %d Characteres", payout, idx);
GameTextForPlayer(playerid, string, 5000, 5);
SetTimer("AddsOn", addtimer, 0);adds = 1;
}
return 1;
}