Help! Buyables Vehicles
#1

Dear all

I've been looking for some system for vehicles,
with which to add new vehicles available to buy,
but I failed to get any, and all such vehicles
are purchased on my server as I can add new ones
and leave them somewhere for new guys
so they can buy them?

Im using SATDM v9 and in there
is a command /CAR but its for temp vehicles
also its ok if can i mod this code for temp vehicles
then what i need change on this code?
for save the vehicle in a external file

Thanks for your help

Код:
CMD:car(playerid,params[]) {
	if(PlayerInfo[playerid][Level] >= 3) {
	    new tmp[128], tmp2[128], tmp3[128], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index); tmp3 = strtok(params,Index);
	    if(isnull(tmp)) return SendClientMessage(playerid, red, "USAGE: /car [Modelid/Name] [colour1] [colour2]");
		new car, colour1, colour2, string[128];
   		if(!IsNumeric(tmp)) car = GetVehicleModelIDFromName(tmp); else car = strval(tmp);
		if(car < 400 || car > 611) return  SendClientMessage(playerid, red, "ERROR: Invalid Vehicle Model");
		if(isnull(tmp2)) colour1 = random(126); else colour1 = strval(tmp2);
		if(isnull(tmp3)) colour2 = random(126); else colour2 = strval(tmp3);
		new LVehicleID,Float:X,Float:Y,Float:Z, Float:Angle,int1;	GetPlayerPos(playerid, X,Y,Z);	GetPlayerFacingAngle(playerid,Angle);   int1 = GetPlayerInterior(playerid);
		LVehicleID = CreateVehicle(car, X+3,Y,Z, Angle, colour1, colour2, -1); LinkVehicleToInterior(LVehicleID,int1);
		CMDMessageToAdmins(playerid,"CAR");
		format(string, sizeof(string), "%s spawned a \"%s\" (Model:%d) colour (%d, %d), at %0.2f, %0.2f, %0.2f", pName(playerid), VehicleName[car-400], car, colour1, colour2, X, Y, Z);
        SaveToFile("CarSpawns",string);
		format(string, sizeof(string), "You have spawned a \"%s\" (Model:%d) colour (%d, %d)", VehicleName[car-400], car, colour1, colour2);
		PutPlayerInVehicle(playerid, LVehicleID, 0);
		VehicleInfo[LVehicleID][Temp] = 1;
		return SendClientMessage(playerid,lightblue, string);
	} else return SendClientMessage(playerid,red,"ERROR: You need to be level 3 to use this command");
}
Reply
#2

This is a good owership system:

http://forum.sa-mp.com/showthread.ph...icle+ownership
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)