05.06.2011, 19:12
Este aqui й o codigo da dialog pra comprar o telefone:
Eu procurei todas referencias а pPnumber e em nenhuma delas foi encontrada verificaзгo de existencia de algum numero igual ao do random.
PHP код:
if(listitem == 0)
{
if(PlayerInfo[playerid][pTraderPerk] > 0)
{
new skill = 500 / 100;
new price = (skill)*(PlayerInfo[playerid][pTraderPerk]);
new payout = 500 - price;
format(string, sizeof(string), "~r~R$ %d", payout);
GameTextForPlayer(playerid, string, 5000, 1);
GivePlayerGP(playerid,- payout);
SBizzInfo[9][sbTill] += payout;
ExtortionSBiz(9, payout);
}
else
{
format(string, sizeof(string), "~r~R$ %d", 500);
GameTextForPlayer(playerid, string, 5000, 1);
GivePlayerGP(playerid,-500);
SBizzInfo[9][sbTill] += 500;
ExtortionSBiz(9, 500);
}
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
new randphone = 1000 + random(8999);//minimum 1000 max 9999
PlayerInfo[playerid][pPnumber] = randphone;
PlayerInfo[playerid][pPhone] = 1;
format(string, sizeof(string), " Vocк comprou um celular com nъmero: %d", randphone);
SendClientMessage(playerid, COLOR_GRAD4, string);
SendClientMessage(playerid, COLOR_GRAD5, "Vocк pode checar o nъmero qualquer hora no /rg");
SendClientMessage(playerid, COLOR_WHITE, "DICA: Vocк pode digitar /ajuda para saber comandos do celular");
TogglePlayerControllable(playerid, 1);
}