Hello, i have a bug whit this car script for cider
[lua]
--[[
Name: "sh_jeep.lua".
Product: "Cider (Roleplay)".
--]]
if ( !cider.plugin.get("Generic") ) then return; end;
-- Define the item table.
local ITEM = {};
-- Set some information about the item.
ITEM.name = "Murcielago";
ITEM.size = 1;
ITEM.cost = 10;
ITEM.team = TEAM_REBELDEALER;
ITEM.model = "models/sickness/murcielago.mdl";
ITEM.max = 1;
ITEM.batch = 1;
ITEM.store = true;
ITEM.plural = "Murcielago";
ITEM.uniqueID = "Murcielago";
ITEM.description = "A test car.";
-- Called when a player drops the item.
function ITEM:onDrop(player, position)
local Murcielago = ents.Create( "prop_vehicle_murcielago" ) -- Create our jeep
Murcielago:SetModel("models/sickness/murcielago.mdl")
Murcielago:SetKeyValues("vehiclesscript", "scripts/vehicles/Murcielago.txt")
Murcielago:SetPos( player:GetPos() + Vector(0, 0, 64 )); -- Place the Jeep right above the player's head
Murcielago:Spawn() -- Spawn it.
Murcielago:Activate() -- Activate it.
return false;
end;
function ITEM.Use( p, ent )
end
-- Called when a player destroys the item.
function ITEM:onDestroy(player) end;
-- Register the item.
cider.item.register(ITEM);
[/lua]
Or if you have / sell a car script then pm me :)
wanna know why people dont reply?, because this looks really really bad
Well thats why im asking for help.
[QUOTE=TechLoadV1;26329751]Well thats why im asking for help.[/QUOTE]
are you trying to use HTML or php in lua?
2 secs im gonna upload a new file because that one is worng i see it. -> i have edited it
any errors?
You might wanna edit it, so the car doesent spawn right above the players' head.
Yea but my problem is that i get it in the inventory, but after that i cant spawn it when i use the (drop) function.
Errors?
Error = Car cant spawn
It works fine in sale, and its get added to the inventory, but when i try to use / drop the car nothing happends, the car dosnt get spawned.
So its going like this :
[lua]
--[[
Name: "sh_jeep.lua".
Product: "Cider (Roleplay)".
--]]
if ( !cider.plugin.get("Generic") ) then return; end;
-- Define the item table.
local ITEM = {};
-- Set some information about the item.
ITEM.name = "Murcielago";
ITEM.size = 1;
ITEM.cost = 10;
ITEM.team = TEAM_REBELDEALER;
ITEM.model = "models/sickness/murcielago.mdl";
ITEM.max = 1;
ITEM.batch = 1;
ITEM.store = true;
ITEM.plural = "Murcielago";
ITEM.uniqueID = "Murcielago";
ITEM.description = "A test car.";
-- Called when a player drops the item.
function ITEM:onDrop(player, position)
local Murcielago = ents.Create( "prop_vehicle_murcielago" ) -- Create our jeep
Murcielago:SetModel("models/sickness/murcielago.mdl")
Murcielago:SetKeyValues("vehiclesscript", "scripts/vehicles/Murcielago.txt")
Murcielago:SetPos( player:GetPos() + Vector(0, 0, 64 )); -- Place the Jeep right above the player's head
Murcielago:Spawn() -- Spawn it.
Murcielago:Activate() -- Activate it.
return false;
end;
-- Called when a player destroys the item.
function ITEM:onDestroy(player) end;
-- Register the item.
cider.item.register(ITEM);
[/lua]
[QUOTE=TechLoadV1;26361449]So its going like this :
[lua]
--[[
Name: "sh_jeep.lua".
Product: "Cider (Roleplay)".
--]]
if ( !cider.plugin.get("Generic") ) then return; end;
-- Define the item table.
local ITEM = {};
-- Set some information about the item.
ITEM.name = "Murcielago";
ITEM.size = 1;
ITEM.cost = 10;
ITEM.team = TEAM_REBELDEALER;
ITEM.model = "models/sickness/murcielago.mdl";
ITEM.max = 1;
ITEM.batch = 1;
ITEM.store = true;
ITEM.plural = "Murcielago";
ITEM.uniqueID = "Murcielago";
ITEM.description = "A test car.";
-- Called when a player drops the item.
function ITEM:onDrop(player, position)
local Murcielago = ents.Create( "prop_vehicle_murcielago" ) -- Create our jeep
Murcielago:SetModel("models/sickness/murcielago.mdl")
Murcielago:SetKeyValues("vehiclesscript", "scripts/vehicles/Murcielago.txt")
Murcielago:SetPos( player:GetPos() + Vector(0, 0, 64 )); -- Place the Jeep right above the player's head
Murcielago:Spawn() -- Spawn it.
Murcielago:Activate() -- Activate it.
return false;
end;
-- Called when a player destroys the item.
function ITEM:onDestroy(player) end;
-- Register the item.
cider.item.register(ITEM);
[/lua][/QUOTE]
listen , if your gonna ask for help please tell us what happens when you use the item, we kinda have no idea what your point is.
When i use the item nothing happends. that what i have been said for a lot of postes now.
and i can do like this :
Thing there works: It work in store, it get spawned and you can pick it up to your inventory
Bug : When you have it in your inventory you CANT use the item, you press the drop/spawn button nothing happends, and thats the bug and its that i want help to :)
Hope this helped then
prop_vehicle_murcielago ?
Most people spawn a jeep with a different model.
Okay so you just want it to be jeeå and not murcielago?
Like this
[lua]
local Murcielago = ents.Create( "prop_vehicle_jeep" ) -- Create our jeep
Murcielago:SetModel("models/sickness/murcielago.mdl")
[/lua]
Okay i think i found the bug.
[lua]
Murcielago:SetKeyValues("vehiclesscript", "scripts/vehicles/Murcielago.txt")
[/lua]
Whitout that line it works, the car get spawned...
But! its just a prop whit its model, it spawns in the air, its totaly noclolided. and cant be used for anything.
[lua]Murcielago:SetKeyValue("vehiclescript", "scripts/vehicles/Murcielago.txt")[/lua]
You had an extra 's' I believe.
The model is uploaded to my server :) and jamie where should the extra "s" be?
I said you had an extra s in your version. Copy the code from my above reply and use that instead.
Yea i just was asking but whatever im trying it now :)
[editline]1st December 2010[/editline]
Okay it works i think now it just shows the GetPos as a error -.-
[editline]1st December 2010[/editline]
It needs another SetPos, i have tryed some diffrent but they dont work, i would be happy if you know one of them ;)
Sorry, you need to Log In to post a reply to this thread.