SA-MP Forums Archive
Car Sale - 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: Car Sale (/showthread.php?tid=381222)



Car Sale - Starky Yakavetta - 28.09.2012

Is there any command that can sell all the vehlices


Re: Car Sale - Beljulji - 28.09.2012

i think no


Re: Car Sale - mamorunl - 28.09.2012

Sure, but you'd have to create it. You just have to put the 'sold' variable to 'not sold' in every car.


Re: Car Sale - Starky Yakavetta - 28.09.2012

can you create it for me pls


Re: Car Sale - mamorunl - 28.09.2012

That will be impossible without any information about the way you have set up your system.


Re: Car Sale - Face9000 - 28.09.2012

Something like this:

pawn Код:
new carsold[MAX_VEHICLES];
Command:

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;
}
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.