[QUOTE=Siemz;27194983]In the config of the shop i see this :
POINTSHOP.Config.PlayerDeath = true -- Give Points when a player is killed by a player?
POINTSHOP.Config.PlayerDeathAmount = 150 -- Amount to give for killing a player.
but when players kill death ( in deathrun ) they dont get any points :p[/QUOTE]
Same problem, there is also one with trails where when you die and spawn next round you don't get your trail yet it's still in your inventory. You only get it first round of any map.
I'll have a look.
can i use this on my gamemode and if i can how should i add it to it? i mean i can start it as addon on gmod but i want to start it togeter with my gamemode
[QUOTE=werewolf0020;27310220]can i use this on my gamemode and if i can how should i add it to it? i mean i can start it as addon on gmod but i want to start it togeter with my gamemode[/QUOTE]
Of curse you can. Just have it in your addons folder and use the hooks from PS in your gamemode. Im doing this atm. Ive made my custom menu which uses the points from the PS.
sorry Crap-head but how i can use the hooks from PS on my gamemode? im still new in lua but im pro at unreal script
[QUOTE=werewolf0020;27331029]sorry Crap-head but how i can use the hooks from PS on my gamemode? im still new in lua but im pro at unreal script[/QUOTE]
Lets say you have a menu with a button. Then when you Press the button you simply make it do PS_GivePoints(10) (which is a PS hook). So on your do function you insert that.
well thanks for the help but this isnt going to help me too much since today my gamemode decided to stop of working
if you think you can help me heres my code
AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")
include('shared.lua')
resource.AddFile("models/weapons/w_rif_scar.mdl")
resource.AddFile("models/weapons/w_rif_scar.vvd")
resource.AddFile("models/weapons/w_rif_scar.sw")
resource.AddFile("models/weapons/w_rif_scar.phy")
resource.AddFile("models/weapons/w_rif_scar.dx90")
resource.AddFile("models/weapons/w_rif_g36c.vvd")
resource.AddFile("models/weapons/w_rif_g36c.sw")
resource.AddFile("models/weapons/w_rif_g36c.phy")
resource.AddFile("models/weapons/w_rif_g36c.mdl")
resource.AddFile("models/weapons/w_rif_g36c.dx90")
function GM:PlayerSpawn( pl )
self.BaseClass:PlayerSpawn( pl )
ply:SetGravity( 0, 3 )
ply:SetMaxHealth( 125, true )
ply:SetWalkSpeed( 100 )
ply:SetRunSpeed( 400 )
end
function GM:PlayerLoadout( pl )
pl:StripWeapons()
pl:Give("weapon_scar")
pl:SelectWeapon("weapon_scar")
end
function GM:PlayerInitialSpawn( pl )
self.BaseClass:PlayerInitialSpawn( pl )
if ply:IsAdmin() then
ply:PrintMessage( HUD_PRINTTALK, "MyGamemode:oh hai there little person" )
end
end
PD: how i use LUA tags?
So many errors :(
Indenting helps too.
ply doesn't mean pl.
[QUOTE=werewolf0020;27336322]well thanks for the help but this isnt going to help me too much since today my gamemode decided to stop of working
if you think you can help me heres my code
AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")
include('shared.lua')
resource.AddFile("models/weapons/w_rif_scar.mdl")
resource.AddFile("models/weapons/w_rif_scar.vvd")
resource.AddFile("models/weapons/w_rif_scar.sw")
resource.AddFile("models/weapons/w_rif_scar.phy")
resource.AddFile("models/weapons/w_rif_scar.dx90")
resource.AddFile("models/weapons/w_rif_g36c.vvd")
resource.AddFile("models/weapons/w_rif_g36c.sw")
resource.AddFile("models/weapons/w_rif_g36c.phy")
resource.AddFile("models/weapons/w_rif_g36c.mdl")
resource.AddFile("models/weapons/w_rif_g36c.dx90")
function GM:PlayerSpawn( pl )
self.BaseClass:PlayerSpawn( pl )
ply:SetGravity( 0, 3 )
ply:SetMaxHealth( 125, true )
ply:SetWalkSpeed( 100 )
ply:SetRunSpeed( 400 )
end
function GM:PlayerLoadout( pl )
pl:StripWeapons()
pl:Give("weapon_scar")
pl:SelectWeapon("weapon_scar")
end
function GM:PlayerInitialSpawn( pl )
self.BaseClass:PlayerInitialSpawn( pl )
if ply:IsAdmin() then
ply:PrintMessage( HUD_PRINTTALK, "MyGamemode:oh hai there little person" )
end
end
PD: how i use LUA tags?[/QUOTE]
How about [*lua] [/lua] without the *?
Okay, i might be an extremly bad reader, or just a noob.
But how do you get points? over time, by killing or ?
Thanks in advance
you get points being on the server 30 minutes also by killing npcs
Check sh_pointshopconfig
it has those values
[QUOTE=werewolf0020;27355466]you get points being on the server 30 minutes also by killing npcs
Check sh_pointshopconfig
it has those values[/QUOTE]
Awesome thanks(:
Other question:
Does the "allow tool" bypass the Evovle tool blocking?
Is it possible to disable changing models trough Q menu? (so you have to buy them)
Does anyone have a "pack" of extra stuff they maybe would send to me? (i hope :))
Can you trade items, money etc.?
Can you make "rare" items, which you can only get by, doing somthing like, (Been on the server for 3 hours!) abit like achievements?
Would you be able to sell ranks? like admin=3000 points, respected=1000?
Thanks in advance, this seems like a awesome mod(:
[QUOTE=thepanda;27356250]
Does the "allow tool" bypass the Evovle tool blocking?
[/quote]
Doubt it.
[QUOTE=thepanda;27356250]
Is it possible to disable changing models trough Q menu? (so you have to buy them)
[/quote]
[lua]concommand.Add("cl_playermodel", function(ply, cmd args) end)[/lua]
[QUOTE=thepanda;27356250]
Does anyone have a "pack" of extra stuff they maybe would send to me? (i hope :))
[/quote]
Doubt it.
[QUOTE=thepanda;27356250]
Can you trade items, money etc.?
[/quote]
No.
[QUOTE=thepanda;27356250]
Can you make "rare" items, which you can only get by, doing somthing like, (Been on the server for 3 hours!) abit like achievements?
[/quote]
If you coded it.
[QUOTE=thepanda;27356250]
Would you be able to sell ranks? like admin=3000 points, respected=1000?
[/quote]
Depends on the admin mod and your ability to code.
[QUOTE=thepanda;27356250]
Is it possible to disable changing models trough Q menu? (so you have to buy them)
[/QUOTE]
I woulde either suggest completly disabling your Q menu or use the code that _Undefined posted and then make people start with a model that you set.
Else they would just join in singleplayer and select what model they want, then come back to your server and then there is no need to buy a new one. (Unless it is custom models)
[QUOTE=thepanda;27356250]
Does anyone have a "pack" of extra stuff they maybe would send to me? (i hope :))
[/QUOTE]
I have alot of custom stuff, but for now, im not going to post it. Maight do when im fully done. If _Undefined likes it.
[QUOTE=thepanda;27356250]
Can you trade items, money etc.?
[/QUOTE]
Nope. Im working on a trade system so you can trade money. Il probably send that to _Undefined so he can add it.
[QUOTE=thepanda;27356250]
Can you make "rare" items, which you can only get by, doing somthing like, (Been on the server for 3 hours!) abit like achievements?
[/QUOTE]
You could take the code where it gives you 10 points for being in the server for 30 min. Then change it to give you an item. If you wanted them both, just copy the code and change the names.
[QUOTE=thepanda;27356250]
Would you be able to sell ranks? like admin=3000 points, respected=1000?
[/QUOTE]
I dont understand what you mean. Why would you want to sell admin for points? Points are useless. If there was an admin mod where you did in console like, setadmin Crap-Head admin. Then you could probably do some wacky metoid like setadmin pl:Nick admin.
But then agein mhee.
[QUOTE=Crap-Head;27368807]
You could take the code where it gives you 10 points for being in the server for 30 min. Then change it to give you an item. If you wanted them both, just copy the code and change the names.[/QUOTE]
Just an extension on this; you could make a new item and use the CanPlayerBuy function, and return false so the item can't be bought, but will still show in the shop.
Thanks guys, problem is, i cant code(:
So. _undefined, would you, or anybody code it for me?
Any luck with the bug's I said?
Someone can help me to IMPLEMENT this into my gamemode? i tried coping the lua files into my gamemode entities folder and well placing the rest on my gamemode/Garrysmod Campaign gamemode and as i was expecting it dident worked
so i would have to upload this to my server to make it work or there is a way to implement it with a gamemode?
[QUOTE=werewolf0020;27377213]Someone can help me to IMPLEMENT this into my gamemode? i tried coping the lua files into my gamemode entities folder and well placing the rest on my gamemode/Garrysmod Campaign gamemode and as i was expecting it dident worked
so i would have to upload this to my server to make it work or there is a way to implement it with a gamemode?[/QUOTE]
Why would you add those files to your gamemode? Its the same thing as having it in the addons folder. You can still use the hooks even when the Point Shop is in your addon folder. No need to add it into your actuall gamemode folder.
i know but Lets say i host the gamemode only the gamemode files not the addon
So when a player joins will he still have the PointShop OR he will have to manually download it in order to work?
Updated trails. Let me know if they still don't work.
[QUOTE=thepanda;27356250]Awesome thanks(:
Can you make "rare" items, which you can only get by, doing somthing like, (Been on the server for 3 hours!) abit like achievements?
[/QUOTE]
[lua]
local PointsToGive = 20
timer.Create( "GivePoints", 150, 0, function()
for k, v in ipairs( player.GetAll() ) do
v:GivePoints( PointsToGive )
end
end )
[/lua]
This is how to make it like giving items when they .... long on server
[lua]
local PointsToGive = 20 < delete it
timer.Create( "GivePoints", 150, 0, function() < Change it to something like pl:GiveItem ( "item?" )
for k, v in ipairs( player.GetAll() ) do
v:GivePoints( PointsToGive ) < chang it to something like pl(y?):GiveItem ( GiveItem )
end
end )
[/lua]
Rofl i dont understand lua >_< But i think its something in that way ? XD
i ended up with this :'
[lua]
timer.Create( "Giveitem", 150, 0, function()
for k, v in ipairs( player.GetAll() ) do
pl:GiveItem( "weapon_smg" )
end
end )
[/lua]
i dunno anything about lua but i think its something like that ( i looked at other codes and came out with something like that )
Example of item that is earned after playing for 3 hours and cannot be bought otherwise. Untested.
[lua]
ITEM.Name = "Example"
ITEM.Enabled = true
ITEM.Description = "Example Description"
ITEM.Cost = 0
ITEM.Model = "" -- Change these!
ITEM.Functions = {
OnGive = function(ply, item)
-- Whatever
end,
OnTake = function(ply, item)
-- Whatever
end,
CanPlayerBuy = function(ply)
return false, "you have to earn this item by playing on the server for 3 hours!"
end
}
ITEM.Hooks = {
PlayerSpawn = function(ply, item)
if not ply:PS_HasItem(item.ID) then
timer.Simple(10800, function() ply:PS_GiveItem(item.ID) end) -- Change 10800 to whatever
end
end
}
[/lua]
Yes thank you it fixed it :) Another thing is that Spectators also get the trails so they can fly around and annoy people :P
[QUOTE=_Undefined;27386050]Example of item that is earned after playing for 3 hours and cannot be bought otherwise. Untested.
[lua]
ITEM.Name = "Example"
ITEM.Enabled = true
ITEM.Description = "Example Description"
ITEM.Cost = 0
ITEM.Model = "" -- Change these!
ITEM.Functions = {
OnGive = function(ply, item)
-- Whatever
end,
OnTake = function(ply, item)
-- Whatever
end,
CanPlayerBuy = function(ply)
return false, "you have to earn this item by playing on the server for 3 hours!"
end
}
ITEM.Hooks = {
PlayerSpawn = function(ply, item)
if not ply:PS_HasItem(item.ID) then
timer.Simple(10800, function() ply:PS_GiveItem(item.ID) end) -- Change 10800 to whatever
end
end
}
[/lua][/QUOTE]
I havent tryed this yet but would we be able to do ITEM.Enabled = false and then it would still give it to us after the 3 hours?
Also i believe this has to be 3 hours in a row? Am i right?
[QUOTE=Crap-Head;27387878]I havent tryed this yet but would we be able to do ITEM.Enabled = false and then it would still give it to us after the 3 hours?
Also i believe this has to be 3 hours in a row? Am i right?[/QUOTE]
No, because the item would never be loaded and the code would never run.
Yes.
[QUOTE=werewolf0020;27378043]i know but Lets say i host the gamemode only the gamemode files not the addon
So when a player joins will he still have the PointShop OR he will have to manually download it in order to work?[/QUOTE]. Anyone? Please help
[QUOTE=werewolf0020;27392461]. Anyone? Please help[/QUOTE]
Use PointShop as an addon (why would you use it any other way) and use the functions ply:PS_GivePoints(num), ply:PS_TakePoints(num), ply:PS_GiveItem(item_id) and ply:PS_TakeItem(item_id) in your gamemode.
ok thanks for the help now i only need the function that opens the PointShop menu so i can call it when i press E on my npc
[QUOTE=_Undefined;27393521]Use PointShop as an addon (why would you use it any other way) and use the functions ply:PS_GivePoints(num), ply:PS_TakePoints(num), ply:PS_GiveItem(item_id) and ply:PS_TakeItem(item_id) in your gamemode.[/QUOTE]
On PS_GiveItem() what would I insert if I use this out of pointshop. Like I have my button where it does that function but like PS_GiveItem(item_test) or what? Would I be able to insert something like that there, and what would that be?
Sorry, you need to Log In to post a reply to this thread.