18.03.2017, 04:05
i have /createcar script, like this:
I'm going after / createcar, then pick a place and / savecar to store formats such vehicles in scriptfile / vehicle / car.txt
with a format like this
can you helpme for create /save commands ?
PHP код:
new VehicleNames[][] =
{
"Landstalker", "Bravura", "Buffalo", "Linerunner", "Perrenial", "Sentinel",
"Dumper", "Firetruck", "Trashmaster", "Stretch", "Manana", "Infernus",
"Voodoo", "Pony", "Mule", "Cheetah", "Ambulance", "Leviathan", "Moonbeam",
"Esperanto", "Taxi", "Washington", "Bobcat", "Whoopee", "BF Injection",
"Hunter", "Premier", "Enforcer", "Securicar", "Banshee", "Predator", "Bus",
"Rhino", "Barracks", "Hotknife", "Trailer", "Previon", "Coach", "Cabbie",
"Stallion", "Rumpo", "RC Bandit", "Romero", "Packer", "Monster", "Admiral",
"Squalo", "Seasparrow", "Pizzaboy", "Tram", "Trailer", "Turismo", "Speeder",
"Reefer", "Tropic", "Flatbed", "Yankee", "Caddy", "Solair", "Berkley's RC Van",
"Skimmer", "PCJ-600", "Faggio", "Freeway", "RC Baron", "RC Raider", "Glendale",
"Oceanic","Sanchez", "Sparrow", "Patriot", "Quad", "Coastguard", "Dinghy",
"Hermes", "Sabre", "Rustler", "ZR-350", "Walton", "Regina", "Comet", "BMX",
"Burrito", "Camper", "Marquis", "Baggage", "Dozer", "Maverick", "News Chopper",
"Rancher", "FBI Rancher", "Virgo", "Greenwood", "Jetmax", "Hotring", "Sandking",
"Blista Compact", "Police Maverick", "Boxville", "Benson", "Mesa", "RC Goblin",
"Hotring Racer A", "Hotring Racer B", "Bloodring Banger", "Rancher", "Super GT",
"Elegant", "Journey", "Bike", "Mountain Bike", "Beagle", "Cropduster", "Stunt",
"Tanker", "Roadtrain", "Nebula", "Majestic", "Buccaneer", "Shamal", "Hydra",
"FCR-900", "NRG-500", "HPV1000", "Cement Truck", "Tow Truck", "Fortune",
"Cadrona", "FBI Truck", "Willard", "Forklift", "Tractor", "Combine", "Feltzer",
"Remington", "Slamvan", "Blade", "Freight", "Streak", "Vortex", "Vincent",
"Bullet", "Clover", "Sadler", "Firetruck", "Hustler", "Intruder", "Primo",
"Cargobob", "Tampa", "Sunrise", "Merit", "Utility", "Nevada", "Yosemite",
"Windsor", "Monster", "Monster", "Uranus", "Jester", "Sultan", "Stratium",
"Elegy", "Raindance", "RC Tiger", "Flash", "Tahoma", "Savanna", "Bandito",
"Freight Flat", "Streak Carriage", "Kart", "Mower", "Dune", "Sweeper",
"Broadway", "Tornado", "AT-400", "DFT-30", "Huntley", "Stafford", "BF-400",
"News Van", "Tug", "Trailer", "Emperor", "Wayfarer", "Euros", "Hotdog", "Club",
"Freight Box", "Trailer", "Andromada", "Dodo", "RC Cam", "Launch", "Police Car",
"Police Car", "Police Car", "Police Ranger", "Picador", "S.W.A.T", "Alpha",
"Phoenix", "Glendale", "Sadler", "Luggage", "Luggage", "Stairs", "Boxville",
"Tiller", "Utility Trailer"
};
GetVehicleModelFromName(vehicle_name[])
{
new vehicleid = -1;
if (sscanf(vehicle_name, "i", vehicleid))
{
for (new i = 0; i < sizeof (VehicleNames); i++)
{
if (strfind(VehicleNames[i], vehicle_name, true) != -1)
{
vehicleid = i + 400;
}
}
}
else if (!(400 <= vehicleid <= 611)) vehicleid = -1;
return vehicleid;
}
CMD:createcar(playerid, params[])
{
if(!IsPlayerAdmin (playerid)) return SendClientMessage(playerid, -1, "{0000CD}[SERVER]: {FFFFFF} You don't have acces to makes this commands");
new carname[50];
if(sscanf(params, "s[50]", carname)) return SendClientMessage(playerid, -1, "{0000CD} [SERVER]: {FFFFFF}/createcar [Vehicle Name]");
new carmodel = GetVehicleModelFromName(carname);
if(carmodel == -1) return SendClientMessage(playerid, -1, "{0000CD} [SERVER]: {FFFFFF}Invalid vehicle name.");
new Float:X, Float:Y, Float:Z, Float:A, mycar;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
mycar = CreateVehicle(carmodel, X, Y, Z+2, A, -1, -1, -1);
PutPlayerInVehicle(playerid, mycar, 0);
return 1;
}
with a format like this
Код:
modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2;