ULX

Author Topic: Credit Shop !  (Read 2813 times)

0 Members and 1 Guest are viewing this topic.

Offline Schiaffino

  • Jr. Member
  • **
  • Posts: 88
  • Karma: 1
Credit Shop !
« 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:

Code: [Select]

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

Code: [Select]
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

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: Credit Shop !
« Reply #1 on: June 28, 2012, 01:00:39 AM »
Break up the spawn hook.. use this code.. not sure if this is going to fix it.. but it might..

Code: [Select]
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
}

Offline Schiaffino

  • Jr. Member
  • **
  • Posts: 88
  • Karma: 1
Re: Credit Shop !
« Reply #2 on: June 28, 2012, 09:07:30 AM »
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.

Offline Schiaffino

  • Jr. Member
  • **
  • Posts: 88
  • Karma: 1
Re: Credit Shop !
« Reply #3 on: June 28, 2012, 04:34:17 PM »
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

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: Credit Shop !
« Reply #4 on: June 28, 2012, 05:50:33 PM »
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.

Offline Schiaffino

  • Jr. Member
  • **
  • Posts: 88
  • Karma: 1
Re: Credit Shop !
« Reply #5 on: June 29, 2012, 05:44:40 PM »
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 :)
« Last Edit: June 29, 2012, 05:46:23 PM by Schiaffino »