• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Library] Vehicle Components Library
#1
Vehicle Components Library



[Image: sampctl-samp--vehicle--components--libra...-the-badge]



This library add a new functions, which help find compatible upgrades.



Installation



Simply install to your project:



Code:
sampctl package install pawno-labs/samp-vehicle-components-library



Include in your code and begin using the library:



Code:
#include <components>



Usage



Code:
public OnVehicleMod(playerid, vehicleid, componentid)

{

? ? new modelid = GetVehicleModel(vehicleid);



? ? if (IsVehicleUpgradeCompatible(modelid, componentid))

? ? {

? ? ? ? new

? ? ? ? ? ? name[64],

? ? ? ? ? ? string[144];



? ? ? ? GetVehicleComponentName(componentid, name, sizeof(name));



? ? ? ? format(string, sizeof(string), "You have successfully installed \"%s\"", name);

? ? ? ? SendClientMessage(playerid, -1, string);

? ? }

? ? return 1;

}



Testing



To test, simply run the package:



Code:
sampctl package run
  Reply


Messages In This Thread
Vehicle Components Library - by pawnoholic - 2019-04-15, 06:47 PM
RE: Vehicle Components Library - by kristo - 2019-04-17, 12:52 AM
RE: Vehicle Components Library - by pawnoholic - 2019-04-17, 04:04 AM

Forum Jump: