Ulysses
General => Developers Corner => Topic started by: Schiaffino on June 27, 2012, 05:52:52 PM
-
Hello guys ! =D
Fast Question. i download pointshop ! but i found something that i cant fix...
i bought gravity and work , i log out -rejoin the game and still with the low gravity upgrade... but when i bought super speed.. i just die once or log out and i loose the super speed :S what can be the problem guys ? thanks
here is the code of the super speed:
ITEM.Name = "Super Speed"
ITEM.Enabled = true
ITEM.Description = "Gives you super speed!"
ITEM.Cost = 200
ITEM.Model = "models/weapons/w_toolgun.mdl"
ITEM.Functions = {
OnGive = function(ply, item)
item.Hooks.PlayerSpawn(ply, item)
end,
OnTake = function(ply, item)
local oldWalk = ply.OldWalkSpeed or 250
local oldRun = ply.OldRunSpeed or 500
ply:SetWalkSpeed(oldWalk)
ply:SetRunSpeed(oldRun)
end
}
ITEM.Hooks = {
PlayerSpawn = function(ply, item)
if not ply.OldWalkSpeed and not ply.OldRunSpeed then
ply.OldWalkSpeed = ply:GetWalkSpeed()
ply.OldRunSpeed = ply:GetRunSpeed()
end
ply:SetWalkSpeed(500)
ply:SetRunSpeed(1000)
end
}
and here is the gravity code
ITEM.Name = "Low Gravity"
ITEM.Enabled = true
ITEM.Description = "Sets low gravity on yourself when you spawn."
ITEM.Cost = 200
ITEM.Model = "models/weapons/w_toolgun.mdl"
ITEM.Functions = {
OnGive = function(ply, item)
item.Hooks.PlayerSpawn(ply, item)
end,
OnTake = function(ply, item)
local grav = ply.OldGravity or 1
ply:SetGravity(grav)
end
}
ITEM.Hooks = {
PlayerSpawn = function(ply, item)
if not ply.OldGravity then
ply.OldGravity = ply:GetGravity()
end
ply:SetGravity(0.3)
end
}
thanks ! =D
-
Break up the spawn hook.. use this code.. not sure if this is going to fix it.. but it might..
ITEM.Name = "Super Speed"
ITEM.Enabled = true
ITEM.Description = "Gives you super speed!"
ITEM.Cost = 200
ITEM.Model = "models/weapons/w_toolgun.mdl"
ITEM.Functions = {
OnGive = function(ply, item)
item.Hooks.PlayerSpawn(ply, item)
end,
OnTake = function(ply, item)
local oldWalk = ply.OldWalkSpeed or 250
local oldRun = ply.OldRunSpeed or 500
ply:SetWalkSpeed(oldWalk)
ply:SetRunSpeed(oldRun)
end
}
ITEM.Hooks = {
PlayerSpawn = function(ply, item)
if not ply.OldWalkSpeed then
ply.OldWalkSpeed = ply:GetWalkSpeed()
end
if not ply.OldRunSpeed then
ply.OldRunSpeed = ply:GetRunSpeed()
end
ply:SetWalkSpeed(500)
ply:SetRunSpeed(1000)
end
}
-
Thanks Mr President for always answering me all my questions,
Im going to test this when i get back to ky home
Now im connectrd from my cphone hehe
Thanks
Schiaffino.
-
Hello Mr.President it works :D , but i want to ask you another little question.
yesterday i download a exp mod ... but something is weird.
my users can't see the ( hud of the exp mod ) but also appear the messages " level up " and all those things its weird
can you take a look of this ?
https://www.box.com/shared/pm5huj2nqt
Thanks ! :D
* this is a really important addon for me :P
-
Sorry, I can't take a look at a complete addon for you. if you post snips of code that you need fixed, that's one thing, but I can't just install and fix an entire mod!
Why don't you consider writing your own mod to do exactly what you want it to do. I can help you with that if you need.
-
i fix the error , now everybody can see everything and its working but when i log out... and re-join to the server its weird , because do not charge my skills ... just said:
15/15 but i have nothing of that skill
and if i have example:
10/15 hp .... when i re-join i have 100 hp but if i add to 11/15 i have 105 ( 5 = 1 point )
weird.
how can i fix that problem ? i check the exp .txt and said that my skill is 15 but is not loading that... its like when i re-join i start with 0 lol
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
and how i can make something on the TEAM_XTeam that if this user is donator , start with weapon_mad_supporter ?
or when the user spawn.
ply:Give ("weapon_mad_supporter")
ply:MaxArmor(200)
ply:MaxHealth(400)
ply:Health(400) idk XD
Thanks :)