29.03.2012, 18:46
Boas malta,eu tinha o comando /anuncio,que era quando o player entrasse numa business,ele usava /anuncio e fazia o seu anuncio,so que alterei,para nгo ser anuncio. Comando do Anuncio.
eu queria que,quando o player tivesse dentro de um interior numas certas coordenadas,podesse fazer o anuncio,se tivesse fora do interior nгo desse. Exemplo: Player ta na rua,usa /anuncio e apareзia,"Tens que estar no estabelecimento da news". Se o player tivesse dentro do interior numas coordenadas,ja podesse fazer o /anuncio. Ajudem-me malta :S
pawn Код:
if(strcmp(cmd, "/anuncio", true) == 0 || strcmp(cmd, "/an", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_DARKRED, "[ERRO:] Nгo estбs logado.");
return 1;
}
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_LIGHTORANGE, "[Comando:] (/an)uncio [texto]");
return 1;
}
{
if(GetPlayerVirtualWorld(playerid) == -1)
{
if ((!adds) && (PlayerInfo[playerid][mstrvbcAdmin] < 1))
{
format(string, sizeof(string), "Aguarda %d segundos para fazeres outro anъncio.", (addtimer/1000));
SendClientMessage(playerid, COLOR_WHITE, string);
return 1;
}
new payout = idx * 15;
if(GetPlayerEuros(playerid) < payout)
{
SendClientMessage(playerid, COLOR_DARKRED, "[ERRO:]Nгo tens dinheiro suficiente para fazeres publicidade.");
return 1;
}
GivePlayerEuros(playerid, - payout);
format(string, sizeof(string), "___________________________[Publicidade]___________________________");
SendClientMessageToAll(COLOR_LIGHTGREEN,string);
format(string, sizeof(string), "[Anъncio:] %s", result);
SendClientMessageToAll(COLOR_WHITE,string);
format(string, sizeof(string), "[Anъncio:] Publicidade por: %s - Nъmero De Telemуvel: %d.", GetPlayerNameEx(playerid),PlayerInfo[playerid][msPhoneNumber]);
SendClientMessageToAll(COLOR_WHITE,string);
SendClientMessageToAll(COLOR_LIGHTGREEN,"________________________________________________________________________________________________________________________");
if (PlayerInfo[playerid][mstrvbcAdmin] < 1){SetTimer("AddsOn", addtimer, 0);adds = 0;}
format(string, sizeof(string), " Caracteres contidos: %d - Preзo: %dЂ - Obrigado pelo seu anъncio.");
SendClientMessage(playerid,COLOR_WHITE,string);
PlayerActionMessage(playerid,15.0,"Deu algum dinheiro ao jornalista e fez o seu anuncio");
return 1;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Nгo te encontras no Negуcio.");
}
}
}
return 1;
}