pawn Код:
if(strcmp(cmd, "/comprarcasa", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new Float:oldposx, Float:oldposy, Float:oldposz;
GetPlayerName(playerid, playername, sizeof(playername));
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
for(new h = 0; h < sizeof(HouseInfo); h++)
{
if(PlayerToPoint(2.0, playerid, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]) && HouseInfo[h][hOwned] == 0)
{
if(PlayerInfo[playerid][pLevel] < HouseInfo[h][hLevel])
{
format(string, sizeof(string), " Vocк precisa de Nнvel %d para comprar essa Casa !", HouseInfo[h][hLevel]);
SendClientMessage(playerid, COLOR_GRAD5, string);
return 1;
}
if(PlayerInfo[playerid][pPhousekey] != 255 && strcmp(playername, HouseInfo[PlayerInfo[playerid][pPhousekey]][hOwner], true) == 0)
{
SendClientMessage(playerid, COLOR_WHITE, " Vocк jб й o dono desta casa, digite /vendercasa para vender e comprar outra.");
return 1;
}
if(GetPlayerGP(playerid) > HouseInfo[h][hValue])
{
PlayerInfo[playerid][pPhousekey] = h;
HouseInfo[h][hOwned] = 1;
LocalSpawn[playerid] = 1;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(HouseInfo[h][hOwner], sendername, 0, strlen(sendername), 255);
GivePlayerGP(playerid,-HouseInfo[h][hValue]);
PlayerPlayMusic(playerid);
SetPlayerInterior(playerid,HouseInfo[h][hInt]);
SetPlayerVirtualWorld(playerid,HouseInfo[h][hWorld]);
SetPlayerPos(playerid,HouseInfo[h][hExitx],HouseInfo[h][hExity],HouseInfo[h][hExitz]);
GameTextForPlayer(playerid, "~w~bem vindo~n~voce pode sair qualquer hora ~n~por essa porta digite /sair", 5000, 3);
PlayerInfo[playerid][pInt] = HouseInfo[h][hInt];
PlayerInfo[playerid][pLocal] = h;
SendClientMessage(playerid, COLOR_WHITE, "Parabйns, essa casa й sua !");
SendClientMessage(playerid, COLOR_WHITE, "Digita /ajuda e veja a sessгo de ajuda de casas !");
DateProp(playerid);
OnPropUpdate();
OnPlayerSave(playerid);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, " Vocк nгo tem dinheiro para esse produto !");
return 1;
}
}
}
}
return 1;
}
pawn Код:
if(strcmp(cmd, "/comprarempresa", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new Float:oldposx, Float:oldposy, Float:oldposz;
GetPlayerName(playerid, playername, sizeof(playername));
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
if(PlayerInfo[playerid][pPbiskey] != 255)
{
SendClientMessage(playerid, COLOR_WHITE, " Vocк jб tem uma empresa, digite /venderempresa se vocк pretende comprar esta empresa.");
return 1;
}
for(new b = 0; b < sizeof(SBizzInfo); b++)
{
if(PlayerToPoint(2.0, playerid, SBizzInfo[b][sbEntranceX], SBizzInfo[b][sbEntranceY], SBizzInfo[b][sbEntranceZ]) && SBizzInfo[b][sbOwned] == 0)
{
if(PlayerInfo[playerid][pLevel] < SBizzInfo[b][sbLevelNeeded])
{
format(string, sizeof(string), "Vocк precisa ser nнvel %d para comprar a empresa",SBizzInfo[b][sbLevelNeeded]);
SendClientMessage(playerid, COLOR_GRAD5, string);
return 1;
}
if(GetPlayerGP(playerid) > SBizzInfo[b][sbBuyPrice])
{
PlayerInfo[playerid][pPbiskey] = b+100;
SBizzInfo[b][sbOwned] = 1;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(SBizzInfo[b][sbOwner], sendername, 0, strlen(sendername), 255);
GivePlayerGP(playerid,-SBizzInfo[b][sbBuyPrice]);
PlayerPlayMusic(playerid);
SendClientMessage(playerid, COLOR_WHITE, "Parabйns, sua nova compra.");
SendClientMessage(playerid, COLOR_WHITE, "Digite /ajuda e vб na sessгo de empresas");
DateProp(playerid);
OnPropUpdate();
OnPlayerSave(playerid);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Vocк nгo tem dinheiro para isso.");
return 1;
}
}
}
for(new b = 0; b < sizeof(BizzInfo); b++)
{
if(PlayerToPoint(2.0, playerid, BizzInfo[b][bEntranceX], BizzInfo[b][bEntranceY], BizzInfo[b][bEntranceZ]) && BizzInfo[b][bOwned] == 0)
{
if(PlayerInfo[playerid][pLevel] < BizzInfo[b][bLevelNeeded])
{
format(string, sizeof(string), "Vocк precisa de nнvel %d para compra-lб.",BizzInfo[b][bLevelNeeded]);
SendClientMessage(playerid, COLOR_GRAD5, string);
return 1;
}
if(GetPlayerGP(playerid) > BizzInfo[b][bBuyPrice])
{
PlayerInfo[playerid][pPbiskey] = b;
BizzInfo[b][bOwned] = 1;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(BizzInfo[b][bOwner], sendername, 0, strlen(sendername), 255);
GivePlayerGP(playerid,-BizzInfo[b][bBuyPrice]);
PlayerPlayMusic(playerid);
SetPlayerInterior(playerid,BizzInfo[b][bInterior]);
PlayerInfo[playerid][pInt] = BizzInfo[b][bInterior];
SetPlayerPos(playerid,BizzInfo[b][bExitX],BizzInfo[b][bExitY],BizzInfo[b][bExitZ]);
GameTextForPlayer(playerid, "~w~bem vindo~n~voce pode sair qualquer hora por essa porta digite /sair", 5000, 3);
PlayerInfo[playerid][pInt] = BizzInfo[b][bInterior];
PlayerInfo[playerid][pLocal] = b ;
SendClientMessage(playerid, COLOR_WHITE, "Parabйns, vocк comprou esta empresa");
SendClientMessage(playerid, COLOR_WHITE, "Digite /ajuda e veja a sessгo de empresa.");
DateProp(playerid);
OnPropUpdate();
OnPlayerSave(playerid);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Vocк nгo tem dinheiro suficiente.");
return 1;
}
}
}
}
return 1;
}
pawn Код:
if (!strcmp("/comprarcarro", cmdtext, true))
{
if(PlayerToPoint(2.0, playerid, 555.9089,-1289.4904,17.2482))
{
if(SBizzInfo[13][sbProducts] == 0)
{
GameTextForPlayer(playerid, "~r~fim de estoque", 5000, 1);
return 1;
}
for(new i=0;i<MAX_PLAYERS;i++){if(Conce[i]==1){SendClientMessage(playerid, COLOR_OOC, "Alguйm Ja Estб Comprando Um Veiculo Aguarde");TogglePlayerControllable(playerid, 1);return 1;}}
if (GetOwnedVehicleID(playerid) != INVALID_VEHICLE_ID) return SendClientMessage(playerid, RED, "Vocк Ja Possui Um Veiculo!");
if (GetPlayerInterior(playerid) != 0) return SendClientMessage(playerid, RED, "Saia de seu interior"); // To prevent screw ups
GetPlayerPos(playerid, OrgX[playerid], OrgY[playerid], OrgZ[playerid]);
new color1 = CarColor[playerid][0];
new color2 = CarColor[playerid][1];
TogglePlayerControllable(playerid, 0);
SetPlayerCameraPos(playerid, -1980.9927,293.0207,38.9285);
SetPlayerCameraLookAt(playerid, -1971.9277,284.5396,34.8777);
SetPlayerVirtualWorld(playerid, playerid);
ShopCar[playerid] = CreateVehicle(CarModels[0], -1972.5745,284.5845,34.8772, 0.0, color1, color2, 6000000);
SetVehicleVirtualWorld(ShopCar[playerid], playerid);
PutPlayerInVehicle(playerid, ShopCar[playerid], 0);
TogglePlayerControllable(playerid, 0);
CarShopping[playerid] = true;
Conce[playerid] = 1;
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Carros Sport custam R$90.000,00 Motos velozes R$50.000,00 Carros Populares R$32.000,00");
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Motos normais custam R$15.000,00 E veнculos aйreos custam mais de R$ 1.000.000,00");
SendClientMessage(playerid, COLOR_GREY, "Vocк Pode Trocar os Carros Apertando As Setas do Teclado");
SendClientMessage(playerid, COLOR_GREY, "Para Adquirir O Carro Basta Apertar a Tecla CTRL de Seu Teclado");
SendClientMessage(playerid, COLOR_GREY, "Para Sair Da Concessionaria Basta Apertar a Tecla F ou Enter de Seu Teclado");
SendClientMessage(playerid, COLOR_GREEN, "Jб Possui Um Veiculo Em Mente? Use /pularveiculo [Nomedocarro] Obs:Й Mais Recomendado Usar o CMD");
SendClientMessage(playerid, COLOR_YELLOW, "Para mudar a cor do carro antes de comprar digite /corcarro COR1 COR2!");
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Bugou ? Nгo Consegue Sair Use /sairconce!");
SetTimerEx("BrowseCars", 300, 0, "d", playerid);
}
else
{
SendClientMessage(playerid, COLOR_GREEN, "Vocк presisa estar na concessionбria");
}
return 1;
}