-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
724cf7c
commit 5a726b5
Showing
4 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#include "stdheader.h" | ||
#include "cg_local.h" | ||
|
||
// example: /cg_abc 1 2.2 three | ||
// output: argc=4 (int, float, string) = (1, 2.2, "three") | ||
|
||
void CG_abc_f() { | ||
int a = atoi(CG_Argv(1)); | ||
float b = atof(CG_Argv(2)); | ||
char *c = CG_Argv(3); | ||
Com_Printf("argc=%d (int, float, string) = (%d, %f, \"%s\")", CG_Argc(), a, b, c); | ||
} | ||
|
||
void CG_InitConsoleCommands(void) { | ||
|
||
Cmd_AddCommand("cg_abc", CG_abc_f); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#pragma once | ||
|
||
// cg_servercmds.cpp | ||
unsigned int CG_Argc(); | ||
char *CG_Argv(int i); | ||
void CG_ServerCommand(void); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#pragma once | ||
|
||
void CG_InitConsoleCommands(void); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters