04.03.2012, 20:21
Ok so I am making a car dealership system in my game mode, when a player enters a dealership car it shows them a dialog if they click yes they buy the car and it spawns it for them , everything works but now I am trying to make it so when they log out it destroys their car, and when they log back in it respawns it where they did /park , , I made the /park cmd and it works but what I don't know how to do is DestroyCar because it needs a car id and I got no idea what the car id of the players car when he buys it anyways it just makes a random one.
Here is the code from OnDialogResponse where the player buys the car, maybe somoene can help.
Here is the code from OnDialogResponse where the player buys the car, maybe somoene can help.
pawn Код:
if(dialogid == 1000)
{
if(response)
{
if(PlayerInfo[playerid][pCash] >= 1000)
{
SendClientMessage(playerid, COLOR_GREEN, " You have bought a landstalker for 1000 dollars! ");
PlayerInfo[playerid][pCar] = 400;
CreateVehicle(400, 553.4318,-1200.6570,17.3407, 120, 0, 0, 9999);
RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 1);
GivePlayerCash(playerid, -1000);
}
else
{
SendClientMessage(playerid, COLOR_RED, " You don't even have enough money...");
}
}
else
{
RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 1);
}