Team Spartan Cookies & Milk Forums
  • Issue Tracker
  • Donations
  • Search
  • Member List
  • Help

Register

Team Spartan Cookies & Milk Forums Garry's Mod Starfall v
« Previous 1 2 3 4 5 6 … 18 Next »
Player:PlayerInfo()
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode
Player:PlayerInfo()
09-07-2020, 12:32 AM, (This post was last modified: 09-07-2020, 12:33 AM by TheDeadScythe. Edited 1 time in total.)
#1
TheDeadScythe Offline
TheDead
***
Posts: 14
Threads: 7
Joined: Mar 2018
Player:PlayerInfo()
Hello,
Would it be to have a function to be able to have all the statistics of a person (health,armor,AFk,maxspeed,maxhealth,nick,jumpPower,...) or just a function to see if he is AFK

thx

[Image: giphy-downsized.gif]
Lieutenant of Wolf-Corporation
Find
Reply
09-07-2020, 01:41 AM,
#2
The17thDoctor Offline
TSCM Average Enjoyer
****
Posts: 1,100
Threads: 249
Joined: Oct 2015
RE: Player:PlayerInfo()
Just make a function you can call that returns a table with all the values by adding every single functions results to it.

The17thDoctor: Server take me to the most handsome person
srcds_linux: I cant send people to themselves...
Website Find
Reply
09-07-2020, 10:28 AM,
#3
The17thDoctor Offline
TSCM Average Enjoyer
****
Posts: 1,100
Threads: 249
Joined: Oct 2015
RE: Player:PlayerInfo()
Here is a function that adds all of what you could ever possibly use for a player, there's not everything, but its in fact so much as of now.

local Player = starfall.getTypeDef("Player")

function Player:getAllInfos()
return {
Health = self:health(),
Armor = self:armor(),
Alive = self:alive(),
Crouching = self:crouching(),
Deaths = self:deaths(),
EyeTrace = self:eyeTrace(),
AimEntity = self:aimEntity(),
AimPos = self:aimPos(),
EyePos = self:eyePos(),
EyeAng = self:eyeAngles(),
FOV = self:fov(),
Frags = self:frags(),
Team = {Name=self:getUserGroup(),NiceName=self:teamName(),Color=self:getTeamColor()},
Name = self:name(),
SteamID = selfConfusedteamID(),
SteamID64 = selfConfusedteamID64(),
Ping = self:ping(),
RunSpeed = self:runSpeed(),
IsAdmin = self:isAdmin(),
IsSuperAdmin = self:isSuperAdmin(),
}
end

Quite a useless function though as it is. I'd suggest you filtering much of the information you're using, otherwise it's lost quota for nothing.

The17thDoctor: Server take me to the most handsome person
srcds_linux: I cant send people to themselves...
Website Find
Reply
09-07-2020, 01:26 PM,
#4
TheDeadScythe Offline
TheDead
***
Posts: 14
Threads: 7
Joined: Mar 2018
RE: Player:PlayerInfo()
but it would mostly be to find out if he was afk

[Image: giphy-downsized.gif]
Lieutenant of Wolf-Corporation
Find
Reply
09-07-2020, 01:32 PM,
#5
The17thDoctor Offline
TSCM Average Enjoyer
****
Posts: 1,100
Threads: 249
Joined: Oct 2015
RE: Player:PlayerInfo()
You could just make for each player a timer counting up that resets everytime they press a key.

The17thDoctor: Server take me to the most handsome person
srcds_linux: I cant send people to themselves...
Website Find
Reply
« Next Oldest | Next Newest »


  • View a Printable Version
Forum Jump:


Users browsing this thread: 1 Guest(s)
Contact UsTeam Spartan Cookies & MilkReturn to TopLite (Archive) ModeMark all forums readRSS Syndication

Powered By MyBB, © 2002-2026 MyBB Group.