forked from MishaKonsta/jni-samp-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cmdprocs.cpp
52 lines (45 loc) · 1.26 KB
/
cmdprocs.cpp
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
#include "main.h"
#include "cmdprocs.h"
#include "chatwindow.h"
#include "game/game.h"
#include "scoreboard.h"
extern CChatWindow *pChatWindow;
extern CGame *pGame;
extern CScoreBoard *pScoreBoard;
void cmdQuitGame(const char *params)
{
// I guess I should use QuitApp instead of this
std::terminate();
}
void cmdFrameLimit(const char *params)
{
if(strlen(params)) {
int framelimit = atoi(params);
if(framelimit >= 20 && framelimit <= 90){
*((int*)g_libGTASA+0x95B074) = framelimit;
pChatWindow->AddInfoMessage("-> FrameLimiter: %u", framelimit);
}
else
{
pChatWindow->AddInfoMessage("-> FrameLimiter: valid amounts are 20-90");
}
}
}
void cmdGetState(const char *params)
{
pChatWindow->AddDebugMessage("-> Pause State: %d, Game State: %d", pGame->IsGamePaused(), pGame->IsPlayingGame());
}
void cmdScoreBoard(const char *params)
{
pScoreBoard->Toggle();
}
void SetupCommands()
{
pChatWindow->AddCmdProc("q", cmdQuitGame);
pChatWindow->AddCmdProc("quit", cmdQuitGame);
pChatWindow->AddCmdProc("fpslimit", cmdFrameLimit);
pChatWindow->AddCmdProc("all", cmdScoreBoard);
#ifdef RELEASE_BETA
//pChatWindow->AddCmdProc("getstate", cmdGetState);
#endif
}