Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- #include "Main.h"
- #include "Player.h"
- #include <vector>
- #include <string>
- #define TELEPORT_TABLE "Teleport_table" //for testing
- #define CATEGORY_TABLE "Category_table"
- #define TELEPORT_BUILD_CONTINUE "continue"
- //Information for our teleport parsing
- enum E_TELE_PARSE
- {
- E_TELE_CATEGORY,
- E_TELE_NAME,
- E_TELE_X,
- E_TELE_Y,
- E_TELE_Z,
- E_TELE_A,
- E_TELE_VW,
- E_TELE_INT,
- E_TELE_REAL_TELE,
- E_TELE_VEHICLE,
- E_TELE_DM_VEHICLE,
- E_TELE_FREEZE,
- E_TELE_REMOVE_TELE_ARMOUR,
- E_TELE_REMOVE_TELE_WEAPS,
- E_TELE_FILL_HEALTH,
- E_TELE_GAME_TELE_TEXT,
- };
- enum E_CAT_PARSE
- {
- E_CAT_NAME,
- E_CAT_MAPICON,
- E_CAT_ICON,
- E_CAT_COLOR
- };
- enum E_TELE_CODES
- {
- E_SUCCESSFUL_TELE
- };
- class TeleConfig;
- //Vehicles that can NOT teleport (Even if its a valid vehicle teleport).
- extern const int g_BadVehicles[];
- extern const int g_DmVehicles[];
- //Information for teleport building.
- extern const string g_MapIconInfo[];
- extern const string g_WeaponInfo[];
- //A config vector for the end of the teleport builder
- extern map<int, vector<TeleConfig> > g_TeleBuildConfig;
- //class for the config stuff at the end of the teleport builder.
- //friend to: Teleport
- class TeleConfig
- {
- private:
- bool* m_Addr;
- string m_Msg;
- public:
- friend class Teleport;
- TeleConfig();
- TeleConfig(const char* msg, bool* addr);
- ~TeleConfig();
- };
- //friend to: Teleport
- class Category
- {
- private:
- string m_Name;
- bool m_MapIcon;
- int
- m_Icon,
- m_Color;
- public:
- friend class Teleport;
- Category();
- Category(const char* name, bool mapicon, int icon, int color);
- ~Category();
- };
- //Teleport is a frind of: Player, Category
- class Teleport
- {
- private:
- string
- m_Name,
- m_ClientMessage,
- m_GameText,
- m_Category;
- float
- m_X,
- m_Y,
- m_Z,
- m_Angle,
- m_VX,
- m_VY,
- m_VZ,
- m_VAngle;
- bool
- m_RealTele,
- m_Vehicle,
- m_DmVehicle,
- m_Freeze,
- m_GiveWeap,
- m_RemoveArmour,
- m_RemoveWeapons,
- m_FillHealth,
- m_AdminTele,
- m_NewCat;
- int
- m_VirtualWorld,
- m_Interior,
- m_MessageColor,
- m_Weapon,
- m_Ammo;
- static map<int, Player*> m_Builders;
- static map<int, Teleport> m_BuildTeles;
- static map<const char*, Category> m_Categories;
- public:
- Teleport();
- ~Teleport();
- template<typename T> static inline int ParseTeleData(T* data, const char* str)
- {
- if(strlen(str))
- {
- stringstream s(str);
- s >> *data;
- return 1;
- }
- return 0;
- }
- int TeleportPlayer(Player* player);
- int ListTeleports(Player* player);
- void SendTeleportMessage(Player* player,int code);
- static int AddTeleport(Player* p);
- static void BuildTeleport(Player* player);
- static void RemoveTeleport(Teleport& teleport);
- static int ParseTeleports(map<const char*, Teleport>& TeleData);
- static int CheckTeleportTable();
- //callbacks
- static int OnDialogResponse(int playerid, int dialogid, int response, int listitem, const char* inputtext);
- static int OnPlayerText(int playerid, const char* text);
- };
- extern map<const char*, Teleport> g_Teleport;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement