22.02.2010, 17:49
Gente, tipo, nгo sei porque, mas nos meus dialogs й tudo certo, funfa certinho tal. Mas tipo, se a pessoa chegar no dialog e apertar "Cancelar" Ela й kikada do server =X. E quando ela escolhe uma opзгo, ela ainda fica congelada no dialog, pq isso?
Cуdigo do Dialog.:
Botei tudo, podem perceber que ele й grande, mas mesmo assim, agradeзo
Grato
Cуdigo do Dialog.:
pawn Код:
if(response)
{
if(dialogid == DIALOGID)
{
if (listitem == 0 && GetPlayerMoneyEx(playerid) > 500)
{
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);
GivePlayerMoneyEx(playerid,- payout);
SBizzInfo[9][sbTill] += payout;
ExtortionSBiz(9, payout);
}
else
{
format(string, sizeof(string), "~r~-R$%d", 500);
GameTextForPlayer(playerid, string, 5000, 1);
GivePlayerMoneyEx(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;
format(string, sizeof(string), " Seu novo numero de celular й %d", randphone);
SendClientMessage(playerid, COLOR_GRAD4, string);
SendClientMessage(playerid, COLOR_GRAD5, "De uma olhada no seus documentos /rg");
SendClientMessage(playerid, COLOR_WHITE, "DICA:Digite /ajuda em caso de duvidas");
}
else if (listitem == 1 && GetPlayerMoneyEx(playerid) > 7500)
{
if(PlayerInfo[playerid][pTraderPerk] > 0)
{
new skill = 7500 / 100;
new price = (skill)*(PlayerInfo[playerid][pTraderPerk]);
new payout = 7500 - price;
GivePlayerMoneyEx(playerid,- payout);
SBizzInfo[9][sbTill] += payout;
ExtortionSBiz(9, payout);
format(string, sizeof(string), "~r~-R$%d", payout);
GameTextForPlayer(playerid, string, 5000, 1);
}
else
{
GivePlayerMoneyEx(playerid,-7500);
SBizzInfo[9][sbTill] += 7500;
ExtortionSBiz(9, 7500);
format(string, sizeof(string), "~r~-R$%d", 1000);
GameTextForPlayer(playerid, string, 5000, 1);
}
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
new prize;
new symb1[32]; new symb2[32]; new symb3[32];
new randcard1 = random(10);//minimum 1000 max 9999
new randcard2 = random(10);//minimum 1000 max 9999
new randcard3 = random(10);//minimum 1000 max 9999
if(randcard1 >= 5)
{
format(symb1, sizeof(symb1), "~b~]");
randcard1 = 1;
}
else if(randcard1 <= 4 && randcard1 >= 2)
{
format(symb1, sizeof(symb1), "~g~]");
randcard1 = 2;
}
else if(randcard1 < 2)
{
format(symb1, sizeof(symb1), "~y~]");
randcard1 = 3;
}
if(randcard2 >= 5)
{
format(symb2, sizeof(symb2), "~b~]");
randcard2 = 1;
}
else if(randcard2 <= 4 && randcard2 >= 2)
{
format(symb2, sizeof(symb2), "~g~]");
randcard2 = 2;
}
else if(randcard2 < 2)
{
format(symb2, sizeof(symb2), "~y~]");
randcard2 = 3;
}
if(randcard3 >= 5)
{
format(symb3, sizeof(symb3), "~b~]");
randcard3 = 1;
}
else if(randcard3 <= 4 && randcard3 >= 2)
{
format(symb3, sizeof(symb3), "~g~]");
randcard3 = 2;
}
else if(randcard3 < 2)
{
format(symb3, sizeof(symb3), "~y~]");
randcard3 = 3;
}
if(randcard1 == randcard2 && randcard1 == randcard3)
{
if(randcard1 > 5)
{
prize = 2500;
}
if(randcard1 <= 4 && randcard1 >= 2)
{
prize = 1500;
}
if(randcard1 < 2)
{
prize = 500;
}
GivePlayerMoneyEx(playerid,prize);
SBizzInfo[9][sbTill] -= prize;
ExtortionSBiz(9, prize);
format(string, sizeof(string), "%s %s %s ~n~~n~~w~~g~R$%d",symb1,symb2,symb3, prize);
}
else
{
format(string, sizeof(string), "%s %s %s ~n~~n~~w~~r~R$0",symb1,symb2,symb3);
}
GameTextForPlayer(playerid, string, 3000, 3);
}
else if (listitem == 2 && GetPlayerMoneyEx(playerid) > 5000)
{
if(PlayerInfo[playerid][pTraderPerk] > 0)
{
new skill = 5000 / 100;
new price = (skill)*(PlayerInfo[playerid][pTraderPerk]);
new payout = 5000 - price;
GivePlayerMoneyEx(playerid,- payout);
SBizzInfo[9][sbTill] += payout;
ExtortionSBiz(9, payout);
format(string, sizeof(string), "~r~-R$%d", payout);
GameTextForPlayer(playerid, string, 5000, 1);
}
else
{
GivePlayerMoneyEx(playerid,-5000);
SBizzInfo[9][sbTill] += 5000;
ExtortionSBiz(9, 5000);
format(string, sizeof(string), "~r~-R$%d", 5000);
GameTextForPlayer(playerid, string, 5000, 1);
}
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
PlayerInfo[playerid][pPhoneBook] = 1;
format(string, sizeof(string), " Nova agenda comprada! !");
SendClientMessage(playerid, COLOR_GRAD4, string);
SendClientMessage(playerid, COLOR_MSG, "[BGP]: Digite /agenda <id/name>.");
}
else if (listitem == 3 && GetPlayerMoneyEx(playerid) > 500)
{
if(PlayerInfo[playerid][pTraderPerk] > 0)
{
new skill = 500 / 100;
new price = (skill)*(PlayerInfo[playerid][pTraderPerk]);
new payout = 500 - price;
GivePlayerMoneyEx(playerid,- payout);
SBizzInfo[9][sbTill] += payout;
ExtortionSBiz(9, payout);
format(string, sizeof(string), "~r~-R$%d", payout);
GameTextForPlayer(playerid, string, 5000, 1);
}
else
{
GivePlayerMoneyEx(playerid,-500);
SBizzInfo[9][sbTill] += 500;
ExtortionSBiz(9, 500);
format(string, sizeof(string), "~r~-R$%d", 500);
GameTextForPlayer(playerid, string, 5000, 1);
}
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
gDice[playerid] = 1;
format(string, sizeof(string), " voce compror os dados! Aproveite ^^.");
SendClientMessage(playerid, COLOR_GRAD4, string);
SendClientMessage(playerid, COLOR_MSG, "[BGP]: Digite /dado ");
}
else if(listitem == 4 && GetPlayerMoneyEx(playerid) > 5000)
{
if (gLastCar[playerid] != 0)
{
if(HireCar[playerid] != 299)
{
gCarLock[HireCar[playerid]] = 0;
UnLockCar(HireCar[playerid]);
HireCar[playerid] = 299;
}
if(PlayerInfo[playerid][pTraderPerk] > 0)
{
new skill = 5000 / 100;
new price = (skill)*(PlayerInfo[playerid][pTraderPerk]);
new payout = 5000 - price;
GivePlayerMoneyEx(playerid,- payout);
SBizzInfo[9][sbTill] += payout;
ExtortionSBiz(9, payout);
format(string, sizeof(string), "~r~-R$%d", payout);
GameTextForPlayer(playerid, string, 5000, 1);
}
else
{
GivePlayerMoneyEx(playerid,-5000);
SBizzInfo[9][sbTill] += 5000;
ExtortionSBiz(9, 5000);
format(string, sizeof(string), "~r~-R$%d", 5000);
GameTextForPlayer(playerid, string, 5000, 1);
}
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
HireCar[playerid] = gLastCar[playerid];
format(string, sizeof(string), "Chave para trancar seu ultimo veiculo usado");
SendClientMessage(playerid, COLOR_MSG, string);
SendClientMessage(playerid, COLOR_MSG, "[BGP]: Digite /trancar ");
}
else
{
SendClientMessage(playerid, COLOR_WHITE, " Vocк nгo tem um veiculo para usar esta trava !");
}
}
else if (listitem == 5 && GetPlayerMoneyEx(playerid) > 10000)
{
if(PlayerInfo[playerid][pPHousekey] != 255)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) == 1 && HireCar[PlayerInfo[playerid][pPHousekey]+totalveiculos])
{
HireCar[i] = 299;
}
}
if(PlayerInfo[playerid][pTraderPerk] > 0)
{
new skill = 10000 / 100;
new price = (skill)*(PlayerInfo[playerid][pTraderPerk]);
new payout = 10000 - price;
GivePlayerMoneyEx(playerid,- payout);
SBizzInfo[9][sbTill] += payout;
ExtortionSBiz(9, payout);
format(string, sizeof(string), "~r~-R$%d", payout);
GameTextForPlayer(playerid, string, 5000, 1);
}
else
{
GivePlayerMoneyEx(playerid,-10000);
SBizzInfo[9][sbTill] += 10000;
ExtortionSBiz(9, 10000);
format(string, sizeof(string), "~r~-R$%d", 10000);
GameTextForPlayer(playerid, string, 5000, 1);
}
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "Nova fechadura comprada.");
SendClientMessage(playerid, COLOR_MSG, string);
SendClientMessage(playerid, COLOR_MSG, "[BGP]: Digite /trancar ");
}
else
{
SendClientMessage(playerid, COLOR_WHITE, " Vocк nгo tem um veiculo para usar esta trava !");
}
}
else if (listitem == 6 && GetPlayerMoneyEx(playerid) > 5000)
{
gSpeedo[playerid] = 1;
if(PlayerInfo[playerid][pTraderPerk] > 0)
{
new skill = 5000 / 100;
new price = (skill)*(PlayerInfo[playerid][pTraderPerk]);
new payout = 5000 - price;
GivePlayerMoneyEx(playerid,- payout);
SBizzInfo[9][sbTill] += payout;
ExtortionSBiz(9, payout);
format(string, sizeof(string), "~r~-R$%d", payout);
GameTextForPlayer(playerid, string, 5000, 1);
}
else
{
GivePlayerMoneyEx(playerid,-5000);
SBizzInfo[9][sbTill] += 5000;
ExtortionSBiz(9, 5000);
format(string, sizeof(string), "~r~-R$%d", 5000);
GameTextForPlayer(playerid, string, 5000, 1);
}
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "Velocimetro instalado.");
SendClientMessage(playerid, COLOR_MSG, string);
SendClientMessage(playerid, COLOR_MSG, "[BGP]: Digite /velocimetro ");
}
else if (listitem == 7 && GetPlayerMoneyEx(playerid) > 49)
{
if(PlayerInfo[playerid][pTraderPerk] > 0)
{
new skill = 50 / 100;
new price = (skill)*(PlayerInfo[playerid][pTraderPerk]);
new payout = 50 - price;
GivePlayerMoneyEx(playerid,- payout);
format(string, sizeof(string), "~r~-R$%d", payout);
GameTextForPlayer(playerid, string, 5000, 1);
}
else
{
GivePlayerMoneyEx(playerid,-50);
format(string, sizeof(string), "~r~-R$%d", 50);
GameTextForPlayer(playerid, string, 5000, 1);
}
Condom[playerid] ++;
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "Camisinha comprada.");
SendClientMessage(playerid, COLOR_GRAD4, string);
}
else if (listitem == 8 && GetPlayerMoneyEx(playerid) > 2500)
{
if (gLastCar[playerid] != 0)
{
if(gLastCar[playerid] != 299)
{
gCarLock[HireCar[playerid]] = 0;
UnLockCar(HireCar[playerid]);
HireCar[playerid] = 299;
}
if(PlayerInfo[playerid][pTraderPerk] > 0)
{
new skill = 5000 / 100;
new price = (skill)*(PlayerInfo[playerid][pTraderPerk]);
new payout = 5000 - price;
GivePlayerMoneyEx(playerid,- payout);
SBizzInfo[9][sbTill] += payout;
ExtortionSBiz(9, payout);
format(string, sizeof(string), "~r~-R$%d", payout);
GameTextForPlayer(playerid, string, 5000, 1);
}
else
{
GivePlayerMoneyEx(playerid,-5000);
SBizzInfo[9][sbTill] += 5000;
ExtortionSBiz(9, 5000);
format(string, sizeof(string), "~r~-R$%d", 5000);
GameTextForPlayer(playerid, string, 5000, 1);
}
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
HireCar[playerid] = gLastCar[playerid];
format(string, sizeof(string), "Chave para trancar seu veiculo da casa");
SendClientMessage(playerid, COLOR_MSG, string);
SendClientMessage(playerid, COLOR_MSG, "[BGP]: Digite /trancar ");
}
else
{
SendClientMessage(playerid, COLOR_WHITE, " Vocк nгo tem veiculo para usar essa trancar !");
}
}
}
}
return 1;
}
Grato