[QUOTE=I Like Cereal;39534490]Are you sure this your script?:
surface.CreateFont("Font", { font = "Arial", size = 200, weight = 50, antialias = false, shadow = false }) [/QUOTE]
Yes this is the script, without the surface.CreateFont part
[QUOTE=Meka;39534504]Yes this is the script, without the surface.CreateFont part[/QUOTE]
Hmmm.... Maybe someone else could answer for you, I must not be paying attention to something there...
He just sets it directly on top of the bone from what i can see there.
Mine does the same, except it uses an attatchment. Then there's vector params to tell where in accordance to the bone the hat should be. What i'm asking is if someone could provide me with a snippet of code that would succesfully take both into account and have it stay on the head properly.
I think I had the same issue when I was in singleplayer as for some reason the angles and attachments were off, but they worked fine in multiplayer.
-snip-
I'm trying to make a chat command but I'm not completely sure how when the command has two modes (utime_enable 0/1)
So far I got this(not sure if correct but trying):
[CODE]
function uTimeEnable1( ply, text, public )
if( string.sub( text, 1, 8 ) == "!utimeon" ) then
ply:utime_enable()
return(false)
end
end
hook.Add( "PlayerSay", "uTimeEnable1", uTimeEnable1 );
[/CODE]
[QUOTE=Archemyde;39534935]He just sets it directly on top of the bone from what i can see there.
Mine does the same, except it uses an attatchment. Then there's vector params to tell where in accordance to the bone the hat should be. What i'm asking is if someone could provide me with a snippet of code that would succesfully take both into account and have it stay on the head properly.[/QUOTE]
You need to modify the position returned by the attachment instead of just adding a vector to it.
[url]https://github.com/adamdburton/pointshop/blob/master/lua/items/headshatsmasks/buckethat.lua#L16[/url]
[QUOTE=_Undefined;39536734]You need to modify the position returned by the attachment instead of just adding a vector to it.
[url]https://github.com/adamdburton/pointshop/blob/master/lua/items/headshatsmasks/buckethat.lua#L16[/url][/QUOTE]
That worked.
Now, for educational purposes, could you explain to me how exactly that works?
[QUOTE=Sam7100;39532334]Progress! The addon is now able to load.
Still, by using this:
RunConsoleCommand("ulx","ban","ply:GetName()","bantime")
I can't get it to ban an player.
My console returns this:
Command "ulx ban", argument #1: No target found or target has imunity.
Hm, i guess i can't use ply:GetName() to find the player.
It's serverside lua.[/QUOTE]
[url=http://ulyssesmod.net/docs/files/lua/ulib/server/player-lua.html#kickban]ULib.kickban( ply[, time, reason, admin] )[/url]
Working on a "ghost mode", is it possible to disable the ladder/fire sounds on a player ?
Hi, i'm currently trying to fix an old entity that i liked using, but i'm getting the error:
[CODE]
[ERROR] /init.lua:400: attempt to perform arithmetic on local 'RIGHT' (a nil value)
[/CODE]
Here is the flight code causing the error. Line 400 will be underlined.
[CODE]function ENT:PhysicsSimulate( phys, deltatime )--############## Flight code@ RononDex
local FWD = self:GetForward()
local UP = ZAxis
local RIGHT = FWD:Cross(UP):Normalize()
self.SpinAccel = math.Approach(self.SpinAccel,num4,0.05)
if IsValid(self) then
if self.In and self.Flightmode then
self:SetAngles(Angle(5, self.PropTardis:GetAngles().Yaw+self.SpinAccel, 0))
-- Accelerate
if(self.Pilot:KeyDown(IN_FORWARD) and not self.Pilot:KeyDown(IN_SPEED)) then
num=1000
num4 = 4
elseif(self.Pilot:KeyDown(IN_FORWARD) and self.Pilot:KeyDown(IN_SPEED)) then
num=1250
num4 = 5
else
num=0
num4=0
end
self.Accel.FWD=math.Approach(self.Accel.FWD,num,8)
-- Strafe
if(self.Pilot:KeyDown(IN_MOVERIGHT)) then
num2 = 650
elseif(self.Pilot:KeyDown(IN_MOVELEFT)) then
num2 = -650
else
num2=0
end
self.Accel.RIGHT=math.Approach(self.Accel.RIGHT,num2,7)
--Up and Down
if(self.Pilot:KeyDown(IN_JUMP)) then
num3 = 650
elseif(self.Pilot:KeyDown(IN_DUCK)) then
num3 = -650
else
num3=0
end
self.Accel.UP=math.Approach(self.Accel.UP,num3,6)
if not self.Hover then
if self.Accel.FWD>-200 and self.Accel.FWD < 200 then return end --with out this you float
if self.Accel.RIGHT>-200 and self.Accel.RIGHT < 200 then return end
if self.Accel.UP>-200 and self.Accel.UP < 200 then return end
end
phys:Wake()
self:GetPhysicsObject():Wake()
self.FlightPhys={
secondstoarrive = 1;
[U][B]pos = self:GetPos()+(FWD*self.Accel.FWD)+(RIGHT*self.Accel.RIGHT)+(UP*self.Accel.UP);[/B][/U]
maxangular = 9000;
maxangulardamp = 1000;
maxspeed = 1000000;
maxspeeddamp = 500000;
dampfactor = 1;
teleportdistance = 5000;
}
local pos = self:GetPos()
local velocity = self:GetVelocity()
local aim = self.Pilot:GetAimVector();
local ang = aim:Angle();
self.FlightPhys.angle = ang --+ Vector(90 0, 0)
self.FlightPhys.deltatime = deltatime
self.Pilot:SetPos(pos);
phys:ComputeShadowControl(self.FlightPhys)
end
end
end
[/CODE]
The idea is that the TARDIS Spins when it flies, but i have tried lots of times and either it flies in circles or spins on the spot. It's something to do with the Normalize() i think.
How does one shutdown a lua script that he's running without reconnecting?
[QUOTE=Crashty;39537371]How does one shutdown a lua script that he's running without reconnecting?[/QUOTE]
hook.Remove or timer.Destroy
How would i go about getting the "Vector" of a DColorMixer, so i can set the color of my DModelPanel based on that vector color.
Edit:
Solved. Using GetColor, and then dividing r,g,b with 255 gives me what I'm looking for.
I have a problem and I can't figure out.
[LUA]
function ModelView()
local Displayed = false
if(Displayed == false) then
local icon = vgui.Create("DModelPanel",CoolHUD)
icon:SetModel( LocalPlayer():GetModel())
function icon:LayoutEntity( Entity ) return end
icon:SetPos(15, ScrH() - 155)
icon:SetAnimated(false)
icon:SetSize(128,128)
icon:SetCamPos( Vector( 14.25, 4, 65.5 ))
icon:SetLookAt( Vector( 0, 0, 66.5 ) )
icon:ParentToHUD()
isDisplayed = true
end
end
usermessage.Hook("ModelViewer", ModelView)
[/LUA]
I create this ModelPanel for a HUD and I called the function in init.lua GM:PlayerInitializeSpawn using umsg.Start("ModelView",ply)
umsg.End()
The problem is I get this error
hud.lua:71: Tried to use a NULL entity! = That error is assigned to this -- function icon:LayoutEntity( Entity ) return end --
If I remove that line I get the same error but to this one. -- icon:SetModel( LocalPlayer():GetModel()) --
Any solution ??
I need a way to make a SWEP play one sound at a time when I press reload. The problem is it plays alot of sounds (random sounds filename1-9.wav) at the same time and I need to have some sort of a pause/play button. I might just get a stop all sounds on another button but atm the priority is to get one button press to play 1 sound. Does the next code work as a start/stop button? :O
[code]if self.Owner:KeyDown( IN_RELOAD ) then
if self.Owner:EmitSound(Sound("weapons/ls/music" .. math.random(1,2) .. ".wav")) then
self.Owner:StopSound(Sound("weapons/ls/music" .. math.random(1,2) .. ".wav"))
else
self.Owner:EmitSound(Sound("weapons/ls/music" .. math.random(1,2) .. ".wav"))
end
end[/code]
[QUOTE=Archemyde;39536881]That worked.
Now, for educational purposes, could you explain to me how exactly that works?[/QUOTE]
offset = attachmentPos + attachmentAng:Up()*10
Would be 10 units up relative to the attachment.
I recently installed a Suicide revolver, But everytime I use it I got the following messages/errors. Any help?
[QUOTE][ERROR] bad argument #1 to '?' (string expected, got no value)
1. unknown - [C]:-1
Timer Failed! [Simple][@lua/weapons/weapon_suicide_revolver/shared.lua (line 70)]
[ERROR] bad argument #1 to '?' (string expected, got no value)
1. unknown - [C]:-1
Timer Failed! [Simple][@lua/weapons/weapon_suicide_revolver/shared.lua (line 73)][CF] The Obese Spy suicided!
[ERROR] bad argument #1 to '?' (string expected, got no value)
1. unknown - [C]:-1
Timer Failed! [Simple][@lua/weapons/weapon_suicide_revolver/shared.lua (line 72)]
[ERROR] bad argument #1 to '?' (string expected, got no value)
1. unknown - [C]:-1
Timer Failed! [Simple][@lua/weapons/weapon_suicide_revolver/shared.lua (line 75)]
[ERROR] bad argument #1 to '?' (string expected, got no value)
1. unknown - [C]:-1
Timer Failed! [Simple][@lua/weapons/weapon_suicide_revolver/shared.lua (line 76)]
[ERROR] bad argument #1 to '?' (string expected, got no value)
1. unknown - [C]:-1
Timer Failed! [Simple][@lua/weapons/weapon_suicide_revolver/shared.lua (line 71)]
[ERROR] bad argument #1 to '?' (string expected, got no value)
1. unknown - [C]:-1
Timer Failed! [Simple][@lua/weapons/weapon_suicide_revolver/shared.lua (line 74)]
[ERROR] bad argument #1 to '?' (string expected, got no value)[/QUOTE]
This is the part of the code it refers to: [QUOTE]timer.Simple(0, game.ConsoleCommand, "host_timescale 0.5\n")
timer.Simple(0.5, game.ConsoleCommand, "host_timescale 0.25\n")
timer.Simple(0.1, game.ConsoleCommand, "host_timescale 0.03\n")
timer.Simple(0.01, game.ConsoleCommand, "pp_motionblur 1\n")
timer.Simple(1.05, game.ConsoleCommand, "pp_motionblur 0\n")
timer.Simple(0.4, game.ConsoleCommand, "host_timescale 0.25\n")
timer.Simple(0.45, game.ConsoleCommand, "host_timescale 0.75\n")
timer.Simple(1.05, game.ConsoleCommand, "host_timescale 1\n")[/QUOTE]
[QUOTE=theobesespy;39538443]I recently installed a Suicide revolver, But everytime I use it I got the following messages/errors. Any help?
This is the part of the code it refers to:[/QUOTE]
[lua]timer.Simple(0, function() game.ConsoleCommand( "host_timescale 0.5\n" ) end)[/lua]
Could anyone help with my post above? :/
[QUOTE=Mr Cookieman;39538886]Could anyone help with my post above? :/[/QUOTE]
RIGHT is nil
[lua] local RIGHT = FWD:Cross(UP):GetNormal()[/lua]
Normalize() returns nil, it modifies the vector directly
[QUOTE=my_hat_stinks;39539207]RIGHT is nil
[lua] local RIGHT = FWD:Cross(UP):GetNormal()[/lua]
Normalize() returns nil, it modifies the vector directly[/QUOTE]
That makes the TARDIS fly in circles, instead of spinning while flying forwards :?
Nevermind, im making a hash of things. Ignore me.
Created a pretty simple SNPC. On the clientside init file, set up a Draw function to draw some things on top of the SNPC's face (have some more hooks in there) but it's not called (as well as ANY other hooks, Think, Initialize). Checked the entity's GetTable and the functions are defined there. Checked the table returned by scripted_ents.Get and they're also defined. Struggling here to find the cause and fix it. No errors are shown up.
Does anyone know why the spawn menu isn't showing in my base gamemode?
I'm deriving from sandbox and I'm not overwriting any hooks.
Which Derma element is for a slider? I forgot.
[QUOTE=Science;39540586]Which Derma element is for a slider? I forgot.[/QUOTE]
DNumSlider
[QUOTE=jaooe;39540665]DNumSlider[/QUOTE]Thanks a tonne.
Has anyone else noticed the old wiki is down?
[url]http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index4875.html[/url]
[QUOTE=Science;39540670]Thanks a tonne.
Has anyone else noticed the old wiki is down?
[url]http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index4875.html[/url][/QUOTE]
If you use google you can look at the cached pages, which will be just the same as viewing the site I guess as I don't think it would have changed since the page was last cached.
[QUOTE=jaooe;39540708]If you use google you can look at the cached pages, which will be just the same as viewing the site I guess as I don't think it would have changed since the page was last cached.[/QUOTE]
they haven't changed in 6 months
Can someone send me a link to a rar of a blank gamemode? So I can compare everything with what I've got?
Sorry, you need to Log In to post a reply to this thread.