I want the player.GetAll in a draw.SimpleText. This will count all the players that are online. But i can't get it to working.
[QUOTE=dx9er;52697083]I think you're looking for [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/player/GetCount]player.GetCount[/url].[/QUOTE]
Ah, yes... Thank you!!!
[editline]19th September 2017[/editline]
[QUOTE=dx9er;52697083]I think you're looking for [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/player/GetCount]player.GetCount[/url].[/QUOTE]
One lil question tho. How would i apply that on a draw.SimpleText?
Yeah, im dumb ^^
[QUOTE=dx9er;52697500]Just put player.GetCount() instead of the text argument you have.[/QUOTE]
Thanks, I just forgot to remove the "" from the text argument.
[QUOTE=dx9er;52697500]Just put player.GetCount() instead of the text argument you have.[/QUOTE]
Do you know the Player count aswell? Because i can't find it? It's the one that counts your kills and resets when your death?
[QUOTE=DevJekko;52701057]Do you know the Player count aswell? Because i can't find it? It's the one that counts your kills and resets when your death?[/QUOTE]
Do you mean how many people a player has killed and how many times the player has died?
If so [URL="http://wiki.garrysmod.com/page/Player/Frags"]here[/URL] and [URL="http://wiki.garrysmod.com/page/Player/Deaths"]here[/URL]
[QUOTE=MelonShooter;52701085]Do you mean how many people a player has killed and how many times the player has died?
If so [URL="http://wiki.garrysmod.com/page/Player/Frags"]here[/URL] and [URL="http://wiki.garrysmod.com/page/Player/Deaths"]here[/URL][/QUOTE]
Perfect thanks!
EDIT:
Got this problem:
[code] [ERROR] lua/autorun/client/cl_hud_load.lua:85: attempt to call method 'Frags' (a nil value)
1. v - lua/autorun/client/cl_hud_load.lua:85
2. unknown - lua/includes/modules/hook.lua:84
[/code]
[code] draw.SimpleText(player:Frags(), "Text3", ScrW() / 1 - 270, ScrH() - 1027, Color(255,255,255,250), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER) [/code]
Without seeing the full code I can only say you want [lua]LocalPlayer():Frags()[/lua]
[QUOTE=DevJekko;52701098]Perfect thanks!
EDIT:
Got this problem:
[code] [ERROR] lua/autorun/client/cl_hud_load.lua:85: attempt to call method 'Frags' (a nil value)
1. v - lua/autorun/client/cl_hud_load.lua:85
2. unknown - lua/includes/modules/hook.lua:84
[/code]
[code] draw.SimpleText(player:Frags(), "Text3", ScrW() / 1 - 270, ScrH() - 1027, Color(255,255,255,250), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER) [/code][/QUOTE]
Strange, I don't see anything wrong. Could you post more of the code maybe 10 lines in both directions. Also, verify the player is valid.
[QUOTE=MelonShooter;52701887]Strange, I don't see anything wrong. Could you post more of the code maybe 10 lines in both directions.[/QUOTE]
player probably isn't defined in the function scope.
[QUOTE=code_gs;52701889]player probably isn't defined.[/QUOTE]
Oo, I was editing my post when you said that lol.
[QUOTE=Luni;52701231]Without seeing the full code I can only say you want [lua]LocalPlayer():Frags()[/lua][/QUOTE]
Thanks!
[editline]21st September 2017[/editline]
[QUOTE=Luni;52701231]Without seeing the full code I can only say you want [lua]LocalPlayer():Frags()[/lua][/QUOTE]
Wait, this counts my deaths to -1?
Frags counts kills.
[QUOTE=MelonShooter;52704579]Frags counts kills.[/QUOTE]
Yeah, i know that. But whenever i die it will go to -1?
[QUOTE=DevJekko;52704638]Yeah, i know that. But whenever i die it will go to -1?[/QUOTE]
Yes. Frags are reset upon death.
[QUOTE=code_gs;52704693]Yes. Frags are reset upon death.[/QUOTE]
Ah, okay. Is there a way that it only counts the LocalPlayer kills
[QUOTE=DevJekko;52706698]Ah, okay. Is there a way that it only counts the LocalPlayer kills[/QUOTE]
Frags aren't shared -- each player's frags are unique to them.
Sorry, you need to Log In to post a reply to this thread.