This repository has been archived by the owner on Jan 25, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gamemodes.h
70 lines (66 loc) · 1.8 KB
/
gamemodes.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#ifndef GAMEMODES_H
#define GAMEMODES_H
//This is where we will write all of our "hooks" to push to AMX later *somehow*
//#include "stdafx.h"
#include <stdio.h>
#include <cstdio>
#include <cmath>
#include <math.h>
#include <conio.h>
#include <iostream>
#include <winsock2.h>
#include <time.h>
#include <fstream>
#include <vector>
#include < extdll.h >
#include <string>
#include "string.h"
#include "amx/amx.h"
using namespace std;
//Disconnect Reasons (Moved to player.h)
/*
#define REASON_DISCONNECT 1
#define REASON_TIMEOUT 2
#define REASON_MAPCHANGE 3
*/
class CNetwork {
public:
CNetwork() { };
//Destructor
virtual ~CNetwork() { };
//Player and server related - Scripting
void OnServerChangeMap();
void OnMapLoaded();
void OnClientConnect(cell playerid);
void OnClientReconnect(cell playerid);
void OnClientDisconnect(int playerid, int reason); //Reason means: Timeout or normal disconnect
int OnClientUpdate(cell playerid); //This function gets called continuously..
void OnGameModeInit();
int OnServerThink( void );
void UpdatePlayers( void );
void OnClientCommandText(int playerid, const char* recvcmd);
void OnClientDeath(cell attacker, cell receiver);
void OnClientSpawn(cell playerid);
void OnClientEquip(cell playerid);
//Script / Loading related stuff
void parseConfigFile( void );
void decideParse(char* param1, char* param2);
void initAMXGM( void );
bool LoadScript(char * filename);
void UnloadScript();
void Error(int error);
bool LoadProgram(char* file,void * _program);
void RestartMap();
int ExecMain();
bool registerNatives(const AMX_NATIVE_INFO *list);
AMX* GetGMAMXPointer() { return &inimod_amx; };
private:
static bool GMLoaded;
int loadTime;
//void *program;
static AMX inimod_amx;
int err;
//End of script related stuff
};
int amx_initNatives(AMX *amx);
#endif