====== cPlayer ======
cPlayer describes a human player in the server. cPlayer inherits all functions and members of [[api:cPawn]]
===== Class Definition =====
^ Function ^ Return type ^
| GetEyeHeight**()** | double |
| GetEyePosition**()** | [[Vector3d]] |
| GetFlying**()** | bool |
| GetStance**()** | double |
| GetInventory**()** | [[cInventory]] |
| TeleportTo**(** double X, double Y, double Z **)** | void |
| GetGameMode**()** | [[eGameMode]] |
| GetIP**()** | String |
| GetLastBlockActionTime**()** | float |
| GetLastBlockActionCnt**()** | int |
| SetLastBlockActionCnt**(** int Count **)** | void |
| SetLastBlockActionTime**()** | void |
| SetGameMode**(** [[eGameMode]] GameMode **)** | void |
| MoveTo**(** [[Vector3d]] NewPosition **)** | void |
| GetClientHandle**()** | [[cClientHandle]] |
| SendMessage**(** String Message **)** | void |
| GetName**()** | String |
| SetName**(** String Name **)** | void |
| AddToGroup**(** String GroupName **)** | void |
| CanUseCommand**(** String Command **)** | bool |
| HasPermission**(** String Permission **)** | bool |
| IsInGroup**(** String GroupName **)** | bool |
| GetColor**()** | String |
| TossItem**(** bool DraggingItem, int Amount = 1 **)** | void |
| Heal**(** int Health **)** | void |
| TakeDamage**(** int Damage, [[cEntity]] Instigator **)** | void |
| KilledBy**(** cEntity* Killer **)** | void |
| Respawn**()** | void |
| SetVisible**(** bool Visible **)** | void |
| IsVisible**()** | bool |
| MoveToWorld**(** String WorldName **)** | bool |
| LoadPermissionsFromDisk**()** | void |
| GetGroups**()** | list<[[cGroup]]> |
| GetResolvedPermissions**()** | String |
===== Inherited Functions =====
[[cPawn]]
{{page>api:cpawn#class_definition&noheader&noeditbtn}}
[[cEntity]]
{{page>api:centity#class_definition&noheader&noeditbtn}}
===== Functions =====
==== GetEyeHeight() and GetEyePosition() ====
Returns eye height and eye position.
==== GetFlying() ====
Returns ''bool'' value depending on player touching the ground.
==== GetStance() ====
FIXME what the hell it returns?
==== GetInventory() ====
''GetInventory()'' can be used to get the player's inventory.
==== TeleportTo() ====
Teleports player to given position.
==== GetGameMode() ====
Returns current player's gamemode.
==== GetIP() ====
Returns player's IP.
==== GetLastBlockActionTime(), GetLastBlockActionCnt() and SetLastBlockActionTime(), SetLastBlockActionCnt() ====
Gets/sets last block action time or count. FIXME explaination?
==== SetGameMode() ====
Sets player's gamemode.
==== MoveTo() ====
Tries to move player to given position (with collision check).
==== GetClientHandle() ====
''GetClientHandle()'' returns the [[api:cClientHandle]] of the player.
==== SendMessage() ====
Sends private message to exact player.
==== GetName() ====
''GetName()'' returns the player's name. This may differ from their username.
==== SetName() ====
Sets the player's name.
==== AddToGroup() ====
''AddToGroup()'' will add the player to the group with the specified name. A player can be in multiple groups.
==== CanUseCommand() ====
Use ''CanUseCommand()'' to query whether a player can use a certain command.
==== HasPermission() ====
Checks if player has given permission.
==== IsInGroup() ====
Checks if player is in given group.
==== GetColor() ====
''GetColor()'' returns the color of the player. This is defined per user or defined by the group the player is in. The color defined for the player in ''users.ini'' takes precedence of the group color.
==== TossItem() ====
FIXME I have no idea what that is for, sorry.
==== Heal() ====
Heals player by given ammount of health
==== TakeDamage() ====
Forces player to take dammage.
==== KilledBy() ====
Forces player to be killed by pawn.
==== Respawn() ====
Respawns the player
==== SetVisible() and IsVisible() ====
Sets or checks if player is visible by other players.
==== MoveToWorld() ====
Teleports player to given world.
==== LoadPermissionsFromDisk() ====
reloads all permissions from disk (useful in case you messed player's permissions through commands).
==== GetGroups() ====
Returns player's groups list.
==== GetResolvedPermissions() ====
Returns player's permissions list.