Problem with /v buy(You loose the money but the car isn't yours) - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Problem with /v buy(You loose the money but the car isn't yours) (
/showthread.php?tid=460594)
Problem with /v buy(You loose the money but the car isn't yours) -
Don_Cage - 29.08.2013
Well like the title say. I'm having a thought about why the problem is there.
I have different variabels for the vehicles you own and for those who are sales vehicles so I can save them in different files.(Don't know if that can cause the problem, it's just a thought)
Anyway, here is the code to buy.
pawn Код:
else if(strcmp(x_nr,"buy",true) == 0)
{
if(IsASalesVehicle(idcar))
{
if(PlayerInfo[playerid][pLevel] < 2)
{
SendClientMessage(playerid, COLOR_GREY, "You need to be level 2 to buy a vehicle!");
return 1;
}
if(PlayerInfo[playerid][pPcarkey] == 9999 || PlayerInfo[playerid][pPcarkey2] == 9999 || PlayerInfo[playerid][pPcarkey3] == 9999) { }
else return SendClientMessage(playerid, COLOR_GREY,"* You already own three cars!");
if(GetPlayerMoney(playerid) >= SalesCarInfo[idcar][scPrice])
{
if(PlayerInfo[playerid][pCarLic] == 1)
{
format(string, sizeof(string),"LARP/Vehicles/%d.ini",idcar)
dini_Create(string);
if(PlayerInfo[playerid][pPcarkey] == 9999) { PlayerInfo[playerid][pPcarkey] = idcar; }
else if(PlayerInfo[playerid][pPcarkey2] == 9999) { PlayerInfo[playerid][pPcarkey2] = idcar; }
else if(PlayerInfo[playerid][pPcarkey3] == 9999) { PlayerInfo[playerid][pPcarkey3] = idcar; }
else { PlayerInfo[playerid][pPcarkey] = idcar; }
CarInfo[idcar][cOwned] = 1;
strmid(CarInfo[idcar][cOwner], sendername, 0, strlen(sendername), 999);
SafeGivePlayerMoney(playerid,-SalesCarInfo[idcar][scPrice]);
PlayerPlayMusic(playerid);
SendClientMessage(playerid, COLOR_GRAD2, "Congratulations on your new purchase!");
SendClientMessage(playerid, COLOR_GRAD2, "Type /vehiclehelp to view the vehicle manual!");
gEngine[playerid] = 0;
engineOn[GetPlayerVehicleID(playerid)] = false;
OnPropUpdate(4,idcar);
OnPlayerUpdateEx(playerid);
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "* For security reasons, a Driving License is needed to buy a car!");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You don't have enough cash with you ! ");
return 1;
}
}
}
EDIT: The vehicle is shown in your stats but when you enter it it says "Owner: Dealership" and you can't /engine it
Re: Problem with /v buy(You loose the money but the car isn't yours) -
Don_Cage - 30.08.2013
Bump
Re: Problem with /v buy(You loose the money but the car isn't yours) -
UnknownGamer - 30.08.2013
Is this Ravens Roleplay?
Re: Problem with /v buy(You loose the money but the car isn't yours) -
Don_Cage - 30.08.2013
Yes but it's a big edit of it. I'm working on removing all the bugs. The vehicle system is the last bugged thing I know about so when I can fix this I'm done! Please help if you know whats wrong