• Give pointshop point when wining a round - Cops n' Runners
    8 replies, posted
How can I give pointshop points when like the warden won, on Cops n' Runners ? i'm using this pointshop: [URL="http://facepunch.com/showthread.php?t=1228438"]LINK[/URL] and I posted a topic before but it doesn't help me much... Help please Thanks -MrHappy
I can write you the script if you give me the name of the hook for determining when the round ends and who won.
I can't really find it, i checked like 15mins reviewing all the files, i really can't find it because the gamemode is using a custom hud so i can't search simply "has won the game" or something... If you really can't find it, just explain me how to do it or something and i'll check... Here's the files: [URL="https://mega.co.nz/#!y5IBUSgI!gFuTrsg9_v0t8Ebp1h-zOZ0vV4G83b12iMmsFyM8uWw"]LINK[/URL] but really, thanks, to take your time for me, I appreciate it ! [editline]23rd July 2014[/editline] And do you need the pointshop files ?
So you just want spoonfeed? Look in the gamemode files and search for onroundstart.
I'm interested in this too. I'll see if I can find the hook now [editline]23rd July 2014[/editline] Here you go you could just use this then check which team is alive/ has players and give points to the players alive. Or just give points to the players that are alive at the end of a round GM:RoundEnd() [url]http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexf975.html[/url] Called at the end of a round [editline]23rd July 2014[/editline] You could try [CODE] for k, v in pairs (player.GetAll) do if v:--player alive here then Ps_GivePoints = 100 end end [/CODE] You should obviously hook it too with RoundEnd and put it in a function Soemthing similar maybe I'm on my phone so I really can't help much
This gamemode is a huge mess, badly coded, unnecessary repetitions of the same code... Whatever, I managed to fit it in somewhere. [url]http://puu.sh/anyOx.lua[/url] Replace your gamemode/shared.lua with this file, change GM.PointsForWin and the GM.WinMessage if you want (at the top of the file) Also, [I]what the hell is a victorian[/I]. [lua] for i = 1, #player.GetAll() do victorians = player.GetAll()[i] if victorians:Team() == 2 or victorians:Team() == 4 then victorians:EmitSound("misc/achievement_earned.wav", 60, 100) end end [/lua] My eyes.
[QUOTE=Internet1001;45474593]This gamemode is a huge mess, badly coded, unnecessary repetitions of the same code... Whatever, I managed to fit it in somewhere. [url]http://puu.sh/anyOx.lua[/url] Replace your gamemode/shared.lua with this file, change GM.PointsForWin and the GM.WinMessage if you want (at the top of the file) Also, [I]what the hell is a victorian[/I]. [lua] for i = 1, #player.GetAll() do victorians = player.GetAll()[i] if victorians:Team() == 2 or victorians:Team() == 4 then victorians:EmitSound("misc/achievement_earned.wav", 60, 100) end end [/lua] My eyes.[/QUOTE] So it's normal if i didn't find it :3 ?
Yes, the person who made the gamemode decided that there should be no hooks in it and repeats the same bit of code for every possible way the round can end.
[QUOTE=Internet1001;45478724]Yes, the person who made the gamemode decided that there should be no hooks in it and repeats the same bit of code for every possible way the round can end.[/QUOTE] Haha :D, I didn't tried your code yet but I'm gonna test it :D But seriously thanks very much to take your time for me.
Sorry, you need to Log In to post a reply to this thread.