28.09.2012, 20:51
Something like this:
Command:
But i don't think it's correct,i just gave you an example.You have to get the vehicle id of the driver and put the variable carsold on 1 when you sold the car,and 0 when the car isn't sold.
Remember to reset the variable when a player disconnect or at least put a timer.
pawn Код:
new carsold[MAX_VEHICLES];
pawn Код:
CMD:sellvehicle(playerid[])
{
if(carsold[vehicleid] == 1) return SendClientMessage(playerid,0xFF0000FF,"You have already sold this car.");
SendClientMessage(playerid,orange,"***Car Sold!***");
GivePlayerMoney(playerid,5000);
return 1;
}
Remember to reset the variable when a player disconnect or at least put a timer.