Tiberian Technologies Scripts Reference Revision: 9000
Loading...
Searching...
No Matches
engine_player.h
1/* Renegade Scripts.dll
2 Copyright 2013 Tiberian Technologies
3
4 This file is part of the Renegade scripts.dll
5 The Renegade scripts.dll is free software; you can redistribute it and/or modify it under
6 the terms of the GNU General Public License as published by the Free
7 Software Foundation; either version 2, or (at your option) any later
8 version. See the file COPYING for more details.
9 In addition, an exemption is given to allow Run Time Dynamic Linking of this code with any closed source module that does not contain code covered by this licence.
10 Only the source code to the module(s) containing the licenced code has to be released.
11*/
12#ifndef SCRIPTS_INCLUDE__ENGINE_PLAYER_H
13#define SCRIPTS_INCLUDE__ENGINE_PLAYER_H
14
15#include "scripts.h"
16
17class cPlayer;
18class WideStringClass;
19
20GameObject SCRIPTS_API *Get_GameObj(int PlayerID); //convert a player ID into a GameObject
21long SCRIPTS_API Get_Player_ID(GameObject *obj); //convert a GameObject into a player ID
22const char SCRIPTS_API *Get_Player_Name(GameObject *obj); //converts a GameObject into a player name
23const char SCRIPTS_API *Get_Player_Name_By_ID(int PlayerID); //gets the player name from a player ID. Will return NULL if that player doesnt exist.
24void SCRIPTS_API Change_Team(GameObject *obj,int Team); //changes the team of a player given their GameObject and also kills the player so they respwan,passing anything other than 0 = Nod,1 = GDI will crash
25void SCRIPTS_API Change_Team_By_ID(int PlayerID,int Team); //changes the team of a player given their ID and also kills the player so they respwan,passing anything other than 0 = Nod,1 = GDI will crash
26int SCRIPTS_API Get_Player_Count(); //gets the count of how many players there are
27int SCRIPTS_API Get_Team_Player_Count(int Team); //gets the count of players for a given team,0 = Nod,1 = GDI)
28int SCRIPTS_API Get_Team(int PlayerID); //get the team of a player
29int SCRIPTS_API Get_Rank(int PlayerID); //get the rank of a player
30int SCRIPTS_API Get_Kills(int PlayerID); //get the kills of a player
31int SCRIPTS_API Get_Deaths(int PlayerID); //get the deaths of a player
32float SCRIPTS_API Get_Score(int PlayerID); //get the score of a player
33float SCRIPTS_API Get_Money(int PlayerID); //get the money of a player
34float SCRIPTS_API Get_Kill_To_Death_Ratio(int PlayerID); //get the kill/death ratio of a player
35GameObject SCRIPTS_API *Get_Part_Name(const char *name1); //Will return the player with this string as part of their name if there is exactly one player with it
36int SCRIPTS_API Get_Part_Names(const char *name1); //Will return the count of players with this string as part of their name
37void SCRIPTS_API Get_Team_Color(unsigned int team, unsigned int *red, unsigned int *green, unsigned int *blue); //get color for a team
38void SCRIPTS_API Get_Player_Color(int PlayerID, unsigned int *red, unsigned int *green, unsigned int *blue); //get color for a player
39bool SCRIPTS_API Purchase_Item(GameObject *obj,int cost); //Pass a soldier object & a cost to deduct that much money from the soldier. Returns true if the transaction suceeded, false otherwise
40void SCRIPTS_API Set_Ladder_Points(int PlayerID,int amount); //Set the ladder points of a player
41void SCRIPTS_API Set_Rung(int PlayerID,int amount); //Set the rung of a player
42void SCRIPTS_API Set_Money(int PlayerID,float amount); //Set the money of a player
43void SCRIPTS_API Set_Score(int PlayerID,float amount); //Set the score of a player
44GameObject SCRIPTS_API *Find_First_Player(int Team); //finds the first player of Team,0 = Nod,1 = GDI,2 = either
45bool SCRIPTS_API Change_Player_Team(GameObject *obj,bool Retain_Score,bool Retain_Money,bool Show_Host_Message); //changes the players team
46int SCRIPTS_API Tally_Team_Size(int team); //gets the team size for a team
47float SCRIPTS_API Get_Team_Score(int team); //gets the score for a team (same as Game_Info uses)
48void SCRIPTS_API Change_Team_2(GameObject *obj,int Team); //changes the team of a player given their GameObject without killing the player,passing anything other than 0 = Nod,1 = GDI will crash
49int SCRIPTS_API Get_Player_Type(GameObject *obj); //Get the player type of a player from the cPlayer
50const wchar_t SCRIPTS_API *Get_Wide_Player_Name(GameObject *obj); //Converts a GameObject into a player name
51Vector3 SCRIPTS_API Get_Color_For_Team(int teamId); //Get the color values for a team
52SCRIPTS_API int Get_Player_Team(int PlayerID); //Get the team type of a player
53SCRIPTS_API cPlayer *Find_Player(int playerId); //Find a player by ID
54SCRIPTS_API cPlayer *Find_Player(const WideStringClass& playerName); //find a player by name
55SCRIPTS_API int Get_Player_ID_By_Name(const char *Name); //Get the ID of a player given a name
56SCRIPTS_API bool Is_Active(int ID); //Is a player active
57SCRIPTS_API void Set_Kills(int ID,int kills); //Set kills for a player
58SCRIPTS_API void Set_Deaths(int ID,int deaths); //Set deaths for a player
59SCRIPTS_API void Set_Team_Score(int ID,float score); //Set score for a team
60SCRIPTS_API void ChangeTeamDeaths(int teamId,int amount);
61#endif