• PointMod - Earn points and buy items with them!
    214 replies, posted
[QUOTE=dpoolas;21804288]im retarded[/QUOTE] There's the answer to your question.
urr can I get points by killing NPCs?
[QUOTE=Zikry;21833606]urr can I get points by killing NPCs?[/QUOTE] It's not meant to be for single player. (You will be told that.) But, being a noob in lua and all that stuph, How CAN you do that?
Owh yea.. but. urr Im not realy a "Multiplayer Guy" so how do I change it to Kill NPCs instead of other players
Does the points save with the server???
[QUOTE=Uzalon;21854744]Does the points save with the server???[/QUOTE] Yes
[QUOTE=Zikry;21854466]Owh yea.. but. urr Im not realy a "Multiplayer Guy" so how do I change it to Kill NPCs instead of other players[/QUOTE] [lua] hook.Add( "OnNPCKilled", "Points", function( ply, victim ) if ValidEntity( victim ) and victim:IsPlayer() then victim:GivePoints( 15 ) end end ) [/lua]
How can I make it add points to the player every 5 minutes?
[QUOTE=seanm07;21903374]How can I make it add points to the player every 5 minutes?[/QUOTE] [lua] local PointsToGive = 10 timer.Create( "GivePoints", 300, 0, function() for k, v in ipairs( player.GetAll() ) do v:GivePoints( PointsToGive ) end end ) [/lua]
[QUOTE=CombineGuru;21904583]local PointsToGive = 10 timer.Create( "GivePoints", 300, 0, function() for k, v in ipairs( player.GetAll() ) do v:GivePoints( PointsToGive ) end end ) [/QUOTE] I love you times infinity :biggrin:
[QUOTE=antid2;21734780]What?, L4D2 doesn't have a "Item Buy system".[/QUOTE]Actually, someone did port my shitty plugin to L4D2, but it is really buggy.
Holy shit, this is awesome. Why don't you make it so you sell it for 2/3 of the price? losing 2/3 seems like alot
Another question, is it possible to make it have some entities in there which when purchased are put into the inventory and players have to open the inventory to spawn the entity? I tried: [lua] PointMod.Items[1] = { "SF-AACannon", "SF-AACannon", "models/Slyfo/flakvierling_blasternorm.mdl", "SF-AACannon", 60, "PlayerLoadout", function( ply ) local ent = ents.Create( "SF-AACannon" ) ent:SetPos( SpawnPos ) ent:Spawn() ent:Activate() ent.SPL = ply return ent end } [/lua] But this didn't work.
Defined SpawnPos?
[QUOTE=CombineGuru;21937199]Defined SpawnPos?[/QUOTE] Huh? How do I do that?
Where would I add [PHP]local PointsToGive = 10 timer.Create( "GivePoints", 300, 0, function() for k, v in ipairs( player.GetAll() ) do v:GivePoints( PointsToGive ) end end ) [/PHP] ?
[QUOTE=BillyMays;21989030]Where would I add [PHP]local PointsToGive = 10 timer.Create( "GivePoints", 300, 0, function() for k, v in ipairs( player.GetAll() ) do v:GivePoints( PointsToGive ) end end ) [/PHP] ?[/QUOTE] lua/autorun/server
Or you can add it to the hooks.lua file like I did.
[QUOTE=seanm07;21990166]Or you can add it to the hooks.lua file like I did.[/QUOTE] Stupid thing to do. When you update your server, your changes will be lost.
[QUOTE=|FlapJack|;21990286]Stupid thing to do. When you update your server, your changes will be lost.[/QUOTE] No? Everything is still here and has been all the time, no point losses or anything.
I'm having another problem, I need to know how to put the menu on the F6 key.
Or you guys could use it like it's intended, as a base for a gamemode, in which case he doesn't need to worry about what ever the fuck he's doing.
What sort of code (and where would you need to put it) do you need to set a person's points to 100 on the first time they join the server? I'd imagine it's along the lines of checking if the points == nil then using ply:ps_setpoints(100?) Sorry, I'm very new to lua.
[QUOTE=King Kambroo;22016435]What sort of code (and where would you need to put it) do you need to set a person's points to 100 on the first time they join the server? I'd imagine it's along the lines of checking if the points == nil then using ply:ps_setpoints(100?) Sorry, I'm very new to lua.[/QUOTE] sv/hooks.lua, line 6. Change: [lua] ply.Points = ply:GetPData( "Points" ) or 0 [/lua] to [lua]ply.Points = ply:GetPData( "Points" ) or 100[/lua]
The HUD and Derma for it is kinda ugly, consider revising it?
Thanks for the help Guru.
Awesome!
Will this also allow me to pickup items to put in the inventory?
[QUOTE=BillyMays;21990586]I'm having another problem, I need to know how to put the menu on the F6 key.[/QUOTE] It would be helpful to find the coding for this in the script... Considering that the gamemode I am using, already has F2 in use. I'm assuming this would be under [I]lua/PointMod/cl/menu[/I], but I couldn't find anything. If anyone finds it, that'd be great!
[QUOTE=Diet Taco;22118135]It would be helpful to find the coding for this in the script... Considering that the gamemode I am using, already has F2 in use. I'm assuming this would be under [I]lua/PointMod/cl/menu[/I], but I couldn't find anything. If anyone finds it, that'd be great![/QUOTE] It's not going to be clientside, since the hook is serverside and will be in sv/hooks.lua. You can't change it to F6 unfortunately.
Sorry, you need to Log In to post a reply to this thread.