duvida sobre compra de veiculo - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: Non-English (
https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (
https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (
https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: duvida sobre compra de veiculo (
/showthread.php?tid=400760)
duvida sobre compra de veiculo -
loukofire - 20.12.2012
bom eu uso um gm e estou editando ele para aprender, mas esta acontecendo uma coisa.
o sistema que estou adaptando й de compra de veiculos vips mais o maior problema й que quando eu compro o segundo veiculo vip ele usa a id do veiculo anterior.
esse й os 2 veiculos normais
Код:
else if(strcmp(x_nr,"comprar",true) == 0)
{
new car = 1;
new model = GetVehicleModel(idcar);
if(IsASalesVehicle(idcar))
{
if(PlayerInfo[playerid][pLevel] < 2)
{
SendClientMessage(playerid, COLOR_GREY, "Voce precisa estar no nivel 2 ou acima para comprar um carro!");
return 1;
}
if(PlayerInfo[playerid][pPcarkey] == 9999 || PlayerInfo[playerid][pPcarkey2] == 9999 ) { }
else return SendClientMessage(playerid, COLOR_GREY,"* Voce ja comprou 2 carros!");
if(GetPlayerMoney(playerid) >= GetVehiclePrice(idcar))
{
if(PlayerInfo[playerid][pCarLic] == 1)
{
for(new h = 1; h < sizeof(CarInfo); h++)
{
if(CarInfo[h][cOwned] == 0)
{
car = h;
h = 9999;
}
}
format(string, sizeof(string),"LARP/Vehicles/%d.ini",car)
dini_Create(string);
if(PlayerInfo[playerid][pPcarkey] != 9999) { PlayerInfo[playerid][pPcarkey2] = car; }
else { PlayerInfo[playerid][pPcarkey] = car; }
CarInfo[car][cOwned] = 1;
strmid(CarInfo[car][cOwner], sendername, 0, strlen(sendername), 999);
SafeGivePlayerMoney(playerid,-GetVehiclePrice(idcar));
if(IsModelAPlane(idcar) || IsModelAHeli(idcar))
esse й o veiculo vip 1
Код:
else if(strcmp(x_nr,"comprarvip",true) == 0)
{
new car = 1;
new model = GetVehicleModel(idcar);
if(IsASalesVehicle(idcar))
{
if(PlayerInfo[playerid][pVip]==0)
{
SendClientMessage(playerid, COLOR_GREY, "Voce precisa ser vip para comprar um carro!");
return 1;
}
if(PlayerInfo[playerid][pVip]==1 && PlayerInfo[playerid][pPcarkey3] == 9999 ) { }
else return SendClientMessage(playerid, COLOR_GREY,"* Voce ja comprou 1 carro vip!");
if(GetPlayerMoney(playerid) >= GetVehiclePrice(idcar))
{
if(PlayerInfo[playerid][pCarLic] == 1)
{
for(new h = 1; h < sizeof(CarInfo); h++)
{
if(CarInfo[h][cOwned] == 0)
{
car = h;
h = 9999;
}
}
format(string, sizeof(string),"LARP/Vehicles/%d.ini",car)
dini_Create(string);
if(PlayerInfo[playerid][pPcarkey] != 9999) { PlayerInfo[playerid][pPcarkey3] = car; }
else { PlayerInfo[playerid][pPcarkey] = car; }
strmid(CarInfo[car][cOwner], sendername, 0, strlen(sendername), 999);
SafeGivePlayerMoney(playerid,-GetVehiclePrice(idcar));
if(IsModelAPlane(idcar) || IsModelAHeli(idcar))
esse й o segundo veiculo vip
Код:
else if(strcmp(x_nr,"comprarvip2",true) == 0)
{
new car = 1;
new model = GetVehicleModel(idcar);
if(IsASalesVehicle(idcar))
{
if(PlayerInfo[playerid][pVip]==0)
{
SendClientMessage(playerid, COLOR_GREY, "Voce precisa ser vip para comprar um carro!");
return 1;
}
if(PlayerInfo[playerid][pVip]==2 && PlayerInfo[playerid][pPcarkey4] == 9999 ) { }
else return SendClientMessage(playerid, COLOR_GREY,"* Voce ja comprou 1 carro vip!");
if(GetPlayerMoney(playerid) >= GetVehiclePrice(idcar))
{
if(PlayerInfo[playerid][pCarLic] == 1)
{
for(new h = 1; h < sizeof(CarInfo); h++)
{
if(CarInfo[h][cOwned] == 0)
{
car = h;
h = 9999;
}
}
format(string, sizeof(string),"LARP/Vehicles/%d.ini",car)
dini_Create(string);
if(PlayerInfo[playerid][pPcarkey] != 9999) { PlayerInfo[playerid][pPcarkey4] = car; }
else { PlayerInfo[playerid][pPcarkey] = car; }
strmid(CarInfo[car][cOwner], sendername, 0, strlen(sendername), 999);
SafeGivePlayerMoney(playerid,-GetVehiclePrice(idcar));
if(IsModelAPlane(idcar) || IsModelAHeli(idcar))
o problema й entre o comprarvip e comprarvip2