Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Main.h"
- #include "Player.h"
- #include <vector>
- #include <string>
- #define TELEPORT_TABLE "Teleport_table"
- #define TELEPORT_BUILD_CONTINUE "continue"
- //Information for our teleport parsing
- enum E_TELE_PARSE
- {
- E_CATEGORY,
- E_NAME,
- E_X,
- E_Y,
- E_Z,
- E_A,
- E_VW,
- E_INT,
- E_REAL_TELE,
- E_VEHICLE,
- E_DM_VEHICLE,
- E_FREEZE,
- E_REMOVE_ARMOUR,
- E_REMOVE_WEAPS,
- E_FILL_HEALTH,
- E_GAME_TEXT
- };
- enum E_TELE_CODES
- {
- E_SUCCESSFUL_TELE
- };
- //Vehicles that can NOT teleport (Even if its a valid vehicle teleport).
- const int g_BadVehicles[] =
- {
- 403,406,407,408,414,417,427,428,433,435, //LineRunner,Dumper,Fire1,TrashMaster,Mule,Leviathan,Enforcer,Security,Barrakcs,Article
- 520,425,430,432,443,444,446,447,452,453,//Hydra,hunter,predator,Rhino,Packer,Monster,Squallo,SeaSparrow,Speeder,Reefer
- 454,455,456,460,469,472,473,476,484,486,//Tropic,Flatbed,Yankee,Skimmer,Sparrow,CoastGuard,Dinghy,Rustler,Marquis
- 487,488,493,497,498,499,508,511,512,513,//Maverick,NewsMav,Jetmax,PoliceMav,Boxville,Benson,Journey,Beagle,CropDuster,StuntPlane
- 514,515,519,524,531,532,537,538,544,548,//PetrolTanker,RoadTrain,Shamal,Cement,Tractor,Combine,Freight,BrownS,Fire,CargoBob
- 553,556,557,563,569,570,577,578,584,590, //Nevada,MonsterA,MonsterB,RainDance,FreightT,StreakT,At400,DFT,PetrolT,FreightB
- 591,592,593,595,606,607,608,609,610,611, //AtricleT,Andro,Dodo,Launch,Baggage,Baggage2,Tug,BoxBerg,Farm,Utility
- 449,450,441,464,465,501,564,594 //Tram,Article3,Bandit,Baron,Raider,Goblin,Tiger,Cam
- };
- const int g_DmVehicles[] =
- {
- 520,425,430,432,464,484 //Hydra,hunter,predator,Rhino,baron,rustler
- };
- //function prototypes
- inline int ParseTeleData(char* str, const char* str2);
- inline int ParseTeleData(int* data, const char* str);
- inline int ParseTeleData(bool* data, const char* str);
- inline int ParseTeleData(float* data, const char* str);
- struct CategoryData
- {
- char* s_Name;
- bool s_MapIcon;
- int s_Icon;
- int s_Color;
- CategoryData(char* name, bool mapicon, int icon, int color)
- {
- int size = NULL;
- if((size = strlen(name)))
- {
- s_Name = new char[ size + 1 ];
- strcpy(s_Name, name);
- s_MapIcon = mapicon;
- s_Icon = icon;
- s_Color = color;
- }
- }
- ~CategoryData()
- {
- if(s_Name) delete[] s_Name;
- }
- };
- //Teleport is a frind of: Player
- class Teleport
- {
- private:
- char
- *m_Name,
- *m_ClientMessage,
- *m_GameText;
- float
- m_X,
- m_Y,
- m_Z,
- m_Anlgle,
- m_VX,
- m_VY,
- m_VZ,
- m_VAnlgle;
- bool
- m_RealTele,
- m_Vehicle,
- m_DmVehicle,
- m_Freeze,
- m_RemoveArmour,
- m_RemoveWeapons,
- m_FillHealth;
- int
- m_VirtualWorld,
- m_Interior,
- m_MessageColor;
- CategoryData m_Category;
- static map<int, Player*> m_Builders;
- static map<int, Teleport> m_BuildTeles;
- static vector<CategoryData> m_Categories;
- public:
- Teleport();
- ~Teleport();
- int TeleportPlayer(Player* player);
- int ListTeleports(Player* player);
- int AddTeleport(Teleport& teleport);
- void SendTeleportMessage(Player* player,int code);
- static void BuildTeleport(Player* player);
- static void RemoveTeleport(Teleport& teleport);
- static int ParseTeleports(map<char*, Teleport>& TeleData);
- static int CheckTeleportTable();
- //callbacks
- static int OnDialogResponse(int playerid, int dialogid, int response, int listitem, char* inputtext);
- static int OnPlayerText(int playerid, char* text);
- };
- extern map<char*, Teleport> g_Teleport;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement