29.11.2011, 23:42
Entгo. a Minha 24-7 Estar a dar Toda Hora "FIM DE ESTOQUE"
Ja procurei no search mais nao achei a soluзao.
Ja procurei no search mais nao achei a soluзao.
pawn Код:
if(strcmp(cmd, "/comprar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (!PlayerToPoint(100, playerid,-30.875, -88.9609, 1004.53))//centerpoint 24-7
{
SendClientMessage(playerid, COLOR_GRAD2, " Vocк nгo estб no Mercado insanity !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USO: /comprar [item nъmero]");
SendClientMessage(playerid, COLOR_GREEN, "~~~~~~~~~~~~~~~~~(Mercado Insanity)~~~~~~~~~~~~~~~~~");
SendClientMessage(playerid, COLOR_GRAD1, "| 1: Celular R$500 2: Cartгo R$20|");
SendClientMessage(playerid, COLOR_GRAD2, "| 3: Agenda Telefфnica R$50 4: Dado R$15|");
SendClientMessage(playerid, COLOR_GRAD3, "| 5: Chaves R$100 6: Trava de Veнculo R$100|");
SendClientMessage(playerid, COLOR_GRAD4, "| 7: Velocнmetro R$150 8: Preservativo R$5|");
SendClientMessage(playerid, COLOR_GRAD5, "| 9: CD-Player R$12 10: Frango R$10|");
SendClientMessage(playerid, COLOR_GRAD5, "| 11: Hamburger R$10 12: Pizza Congelada R$10");
SendClientMessage(playerid, COLOR_GRAD5, "| 13: Corda R$50");
return 1;
}
new item = strval(tmp);
if(SBizzInfo[9][sbProducts] == 1)
{
GameTextForPlayer(playerid, "~r~fim de estoque", 5000, 1);
return 1;
}
if (item == 1 && GetPlayerGP(playerid) > 58)
{
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;
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");
return 1;
}
else if (item == 2 && GetPlayerGP(playerid) > 56)
{
if(PlayerInfo[playerid][pTraderPerk] > 0)
{
new skill = 7500 / 100;
new price = (skill)*(PlayerInfo[playerid][pTraderPerk]);
new payout = 7500 - price;
GivePlayerGP(playerid,- payout);
SBizzInfo[9][sbTill] += payout;
ExtortionSBiz(9, payout);
format(string, sizeof(string), "~r~R$ %d", payout);
GameTextForPlayer(playerid, string, 5000, 1);
}
else
{
GivePlayerGP(playerid,-150);
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;
}
GivePlayerGP(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);
return 1;
}
else if (item == 3 && GetPlayerGP(playerid) > 500)
{
if(PlayerInfo[playerid][pTraderPerk] > 0)
{
new skill = 5000 / 100;
new price = (skill)*(PlayerInfo[playerid][pTraderPerk]);
new payout = 5000 - price;
GivePlayerGP(playerid,- payout);
SBizzInfo[9][sbTill] += payout;
ExtortionSBiz(9, payout);
format(string, sizeof(string), "~r~R$ %d", payout);
GameTextForPlayer(playerid, string, 5000, 1);
}
else
{
GivePlayerGP(playerid,-50);
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), " Agenda telefфnica comprada, agora vocк pode ver os nъmeros dos jogadores !");
SendClientMessage(playerid, COLOR_GRAD4, string);
SendClientMessage(playerid, COLOR_WHITE, "DICA: Digite /tel(efone) [playerid/Parte-do-Nick]");
return 1;
}
else if (item == 4 && GetPlayerGP(playerid) > 500)
{
if(PlayerInfo[playerid][pTraderPerk] > 0)
{
new skill = 500 / 100;
new price = (skill)*(PlayerInfo[playerid][pTraderPerk]);
new payout = 500 - price;
GivePlayerGP(playerid,- payout);
SBizzInfo[9][sbTill] += payout;
ExtortionSBiz(9, payout);
format(string, sizeof(string), "~r~R$ %d", payout);
GameTextForPlayer(playerid, string, 5000, 1);
}
else
{
GivePlayerGP(playerid,-5);
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), " Vocк comprou um dado nas lojas 24-7");
SendClientMessage(playerid, COLOR_GRAD4, string);
SendClientMessage(playerid, COLOR_WHITE, "DICA: Digite /dado ");
return 1;
}
else if(item == 5 && GetPlayerGP(playerid) > 50)
{
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;
GivePlayerGP(playerid,- payout);
SBizzInfo[9][sbTill] += payout;
ExtortionSBiz(9, payout);
format(string, sizeof(string), "~r~R$ %d", payout);
GameTextForPlayer(playerid, string, 5000, 1);
}
else
{
GivePlayerGP(playerid,-50);
SBizzInfo[9][sbTill] += 5000;
ExtortionSBiz(9, 5000);
format(string, sizeof(string), "~r~R$ %d", 5000);
GameTextForPlayer(playerid, string, 5000, 1);
}
SBizzInfo[9][sbProducts]--;
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
HireCar[playerid] = gLastCar[playerid];
format(string, sizeof(string), "Chaves Compradas, agora vocк pode trancar seu veнculo.");
SendClientMessage(playerid, COLOR_GRAD4, string);
SendClientMessage(playerid, COLOR_WHITE, "DICA: Digite /trancar ");
}
else
{
SendClientMessage(playerid, COLOR_WHITE, " Vocк nгo tem um veнculo !");
}
return 1;
}
else if (item == 6 && GetPlayerGP(playerid) > 100)
{
if(PlayerInfo[playerid][pPhousekey] != 255)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) == 1 && HireCar[PlayerInfo[playerid][pPhousekey]+1])
{
HireCar[i] = 299;
}
}
if(PlayerInfo[playerid][pTraderPerk] > 0)
{
new skill = 10000 / 100;
new price = (skill)*(PlayerInfo[playerid][pTraderPerk]);
new payout = 10000 - price;
GivePlayerGP(playerid,- payout);
SBizzInfo[9][sbTill] += payout;
ExtortionSBiz(9, payout);
format(string, sizeof(string), "~r~R$ %d", payout);
GameTextForPlayer(playerid, string, 5000, 1);
}
else
{
GivePlayerGP(playerid,-100);
SBizzInfo[9][sbTill] += 10000;
ExtortionSBiz(9, 10000);
format(string, sizeof(string), "~r~R$ %d", 10000);
GameTextForPlayer(playerid, string, 5000, 1);
}
SBizzInfo[9][sbProducts]--;
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "Travas Compradas");
SendClientMessage(playerid, COLOR_GRAD4, string);
SendClientMessage(playerid, COLOR_WHITE, "DICA: Digite /trancar ");
}
else
{
SendClientMessage(playerid, COLOR_WHITE, " Vocк nгo tem um veнculo !");
}
return 1;
}
else if (item == 7 && GetPlayerGP(playerid) > 500)
{
gSpeedo[playerid] = 1;
if(PlayerInfo[playerid][pTraderPerk] > 0)
{
new skill = 5000 / 100;
new price = (skill)*(PlayerInfo[playerid][pTraderPerk]);
new payout = 5000 - price;
GivePlayerGP(playerid,- payout);
SBizzInfo[9][sbTill] += payout;
ExtortionSBiz(9, payout);
format(string, sizeof(string), "~r~R$ %d", payout);
GameTextForPlayer(playerid, string, 5000, 1);
}
else
{
GivePlayerGP(playerid,-150);
SBizzInfo[9][sbTill] += 5000;
ExtortionSBiz(9, 5000);
format(string, sizeof(string), "~r~R$ %d", 5000);
GameTextForPlayer(playerid, string, 5000, 1);
}
SBizzInfo[9][sbProducts]--;
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "Velocнmetro Comprado.");
SendClientMessage(playerid, COLOR_GRAD4, string);
SendClientMessage(playerid, COLOR_WHITE, "DICA: Digite /velocimetro ");
return 1;
}
else if (item == 8 && GetPlayerGP(playerid) > 49)
{
if(PlayerInfo[playerid][pTraderPerk] > 0)
{
new skill = 50 / 100;
new price = (skill)*(PlayerInfo[playerid][pTraderPerk]);
new payout = 50 - price;
GivePlayerGP(playerid,- payout);
format(string, sizeof(string), "~r~R$ %d", payout);
GameTextForPlayer(playerid, string, 5000, 1);
}
else
{
GivePlayerGP(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), "Preservativo comprado.");
SendClientMessage(playerid, COLOR_GRAD4, string);
return 1;
}
else if (item == 9 && GetPlayerGP(playerid) > 2500)
{
if(PlayerInfo[playerid][pTraderPerk] > 0)
{
new skill = 2500 / 100;
new price = (skill)*(PlayerInfo[playerid][pTraderPerk]);
new payout = 2500 - price;
GivePlayerGP(playerid, - payout);
format(string, sizeof(string), "~r~R$ %d", payout);
GameTextForPlayer(playerid, string, 5000, 1);
}
else
{
GivePlayerGP(playerid, - 2500);
format(string, sizeof(string), "~r~R$ %d", 2500);
GameTextForPlayer(playerid, string, 5000, 1);
}
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "Vocк comprou um CD-Player");
SendClientMessage(playerid, COLOR_GRAD4, string);
SendClientMessage(playerid, COLOR_WHITE, "DICA: Digite /musica");
PlayerInfo[playerid][pCDPlayer] = 1;
return 1;
}
else if (item == 10 && GetPlayerGP(playerid) > 10)
{
if(Groceries[playerid][pChickens] >= 3)
{
SendClientMessage(playerid, COLOR_GREY, " Vocк jб tem muitos Frangos, coma-os antes !");
return 1;
}
if(PlayerInfo[playerid][pTraderPerk] > 0)
{
new skill = 10 / 100;
new price = (skill)*(PlayerInfo[playerid][pTraderPerk]);
new payout = 10 - price;
GivePlayerGP(playerid, - payout);
format(string, sizeof(string), "~r~R$ %d", payout);
GameTextForPlayer(playerid, string, 5000, 1);
}
else
{
GivePlayerGP(playerid, - 10);
format(string, sizeof(string), "~r~R$ %d", 10);
GameTextForPlayer(playerid, string, 5000, 1);
}
GivePlayerGP(playerid, - 10);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "Vocк comprou um frango.");
SendClientMessage(playerid, COLOR_GRAD4, string);
format(string, sizeof(string), "~r~R$ %d", 10);
GameTextForPlayer(playerid, string, 5000, 1);
new rand = random(15);
Groceries[playerid][pChickens] += 1;
Groceries[playerid][pChicken] += rand;
return 1;
}
else if (item == 11 && GetPlayerGP(playerid) > 10)
{
if(Groceries[playerid][pHamburgers] >= 3)
{
SendClientMessage(playerid, COLOR_GREY, " Vocк jб tem muitos Hamburgueres, consuma-os primeiro !");
return 1;
}
if(PlayerInfo[playerid][pTraderPerk] > 0)
{
new skill = 10 / 100;
new price = (skill)*(PlayerInfo[playerid][pTraderPerk]);
new payout = 10 - price;
GivePlayerGP(playerid, - payout);
format(string, sizeof(string), "~r~R$ %d", payout);
GameTextForPlayer(playerid, string, 5000, 1);
}
else
{
GivePlayerGP(playerid, - 10);
format(string, sizeof(string), "~r~R$ %d", 10);
GameTextForPlayer(playerid, string, 5000, 1);
}
GivePlayerGP(playerid, - 10);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "Vocк comprou um hamburger.");
SendClientMessage(playerid, COLOR_GRAD4, string);
format(string, sizeof(string), "~r~R$ %d", 10);
GameTextForPlayer(playerid, string, 5000, 1);
new rand = random(15);
Groceries[playerid][pHamburgers] += 1;
Groceries[playerid][pHamburger] += rand;
return 1;
}
else if (item == 12 && GetPlayerGP(playerid) > 10)
{
if(Groceries[playerid][pPizzas] >= 3)
{
SendClientMessage(playerid, COLOR_GREY, " Vocк jб tem muitas pizzas !");
return 1;
}
if(PlayerInfo[playerid][pTraderPerk] > 0)
{
new skill = 10 / 100;
new price = (skill)*(PlayerInfo[playerid][pTraderPerk]);
new payout = 10 - price;
GivePlayerGP(playerid, - payout);
format(string, sizeof(string), "~r~R$ %d", payout);
GameTextForPlayer(playerid, string, 5000, 1);
}
else
{
GivePlayerGP(playerid, - 10);
format(string, sizeof(string), "~r~R$ %d", 10);
GameTextForPlayer(playerid, string, 5000, 1);
}
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "Vocк comprou uma pizza congelada.");
SendClientMessage(playerid, COLOR_GRAD4, string);
new rand = random(15);
Groceries[playerid][pPizzas] += 1;
Groceries[playerid][pPizza] += rand;
return 1;
}
else if (item == 13 && GetPlayerGP(playerid) > 500)
{
if(PlayerInfo[playerid][pTraderPerk] > 0)
{
new skill = 500 / 100;
new price = (skill)*(PlayerInfo[playerid][pTraderPerk]);
new payout = 500 - price;
GivePlayerGP(playerid,- payout);
SBizzInfo[9][sbTill] += payout;
ExtortionSBiz(9, payout);
format(string, sizeof(string), "~r~R$ %d", payout);
GameTextForPlayer(playerid, string, 5000, 1);
}
else
{
GivePlayerGP(playerid,-15);
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);
corda[playerid] = 1;
format(string, sizeof(string), "Vocк comprou uma corda, agora pode sequestrar:");
SendClientMessage(playerid, COLOR_GRAD4, string);
SendClientMessage(playerid, COLOR_WHITE, "DICA: Digite /sequestrar ID");
return 1;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, " Vocк nгo tem dinheiro para isso !");
}
}
return 1;
}