public OnGameModeInit()
{
new vehiclegroup[2]; // Since we need the groupid to add vehicle later, we store it.
vehiclegroup[0] = CreateDynamicVehicleGroup("Cars"); // Create the group "Cars"
vehiclegroup[1] = CreateDynamicVehicleGroup("Bikes"); // Create the group "Bikes"
return 0;
}
public OnGameModeInit()
{
new vehiclegroup[2];
vehiclegroup[0] = CreateDynamicVehicleGroup("Cars");
vehiclegroup[1] = CreateDynamicVehicleGroup("Bikes");
AddDynamicVehicle(vehiclegroup[0],426,1,1); // Add the vehicle "Premier (ID 426)" to the group "Cars" with the first color white, and the second color also white.
AddDynamicVehicle(vehiclegroup[1],522,5,1); // Add the vehicle "NRG-500 (ID 522)" to the group "Bikes" with the first color pink, and the second color white.
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
_OnDialogResponse(playerid, dialogid, response, listitem, inputtext);
return 1;
}
stock CreateDynamicVehicleGroup(groupname[32]) // returns the Group ID (aka the amount of groups created)
stock AddDynamicVehicle(groupid,modelid,color1 = -1,color2 = -1) // returns the amount of dynamic vehicles added
(define) ShowVehicleSpawnDialog(playerid) // Use this in any function to show the vehicle spawn dialog
R1 - First release R2 - Made some strings higher, fixed a bug where the dialogs shouldn't show and removed unnecessary arrays from the enums. Also, uploaded an example filterscript.
How To Create A /veh Command For This Script?
![]() I'm noob in Scripting, Need Help! :S |
#define MAX_VEHICLE_GROUPS 100
new
VehicleGroups[MAX_VEHICLE_GROUPS] = -1;
CMD:veh(playerid, params[]) {
if(IsPlayerAdmin(playerid)) //Works for RCON admin!
{
new
VehicleModelID,
VehicleColorPrimary,
VehicleColorSecondary,
VehicleGroup[32],
UseThisID = -1
;
if(sscanf(params, "iiis[32]", VehicleModelID, VehicleColorPrimary, VehicleColorSecondary, VehicleGroup))
return SendClientMessage(playerid, 0xFFFFFFFF, "/veh [Model ID] [Primary Colour] [Secondary Colour] [Vehicle Group]");
for(new g; g < sizeof(VehicleGroups); g++)
{
if(VehicleGroups[g] == -1)
return UseThisID = g;
}
VehicleGroups[g] = CreateDynamicVehicleGroup(VehicleGroup);
AddDynamicVehicle(VehicleGroups[g], VehicleModelID, VehicleColorPrimary, VehicleColorSecondary);
UseThisID = -1;
}
return true;
}
How To Create A /veh Command For This Script?
![]() I'm noob in Scripting, Need Help! :S |
#define MAX_VEHICLE_GROUPS 100 new VehicleGroups[MAX_VEHICLE_GROUPS] = -1; CMD:veh(playerid, params[]) { if(IsPlayerAdmin(playerid)) //Works for RCON admin! { new VehicleModelID, VehicleColorPrimary, VehicleColorSecondary, VehicleGroup[32], UseThisID = -1 ; if(sscanf(params, "iiis[32]", VehicleModelID, VehicleColorPrimary, VehicleColorSecondary, VehicleGroup)) return SendClientMessage(playerid, 0xFFFFFFFF, "/veh [Model ID] [Primary Colour] [Secondary Colour] [Vehicle Group]"); for(new g; g < sizeof(VehicleGroups); g++) { if(VehicleGroups[g] == -1) return UseThisID = g; } VehicleGroups[g] = CreateDynamicVehicleGroup(VehicleGroup); AddDynamicVehicle(VehicleGroups[g], VehicleModelID, VehicleColorPrimary, VehicleColorSecondary); UseThisID = -1; } return true; } |
Do you mean a way to show the dialog? Because I implemented the function "ShowVehicleSpawnDialog(playerid)".
|
How to Actived this Script
![]() is Not Work Please I am Noob Scripter Please Help Me, I Complie that is Error, For Jochemd Chek PM from me ![]() ![]() ![]() |