1 // This is a client command in the "g_cmds.c" file ( ClientCommand(int) )
2 else if ( Q_stricmp(cmd, "myOS") == 0 )
3 {
4 mfPlayer ply;
5
6 // If you want your mod to be backwards compatible without JK2MF you need to check if it is available before every
7 // call to a JK2MF specific function.
8 if ( !JK2MFApiAvailable() )
9 {
10 trap_SendServerCommand(clientNum, va("print \"The server needs at least JK2MF %s to make this command available.\n\"", JK2MFMINVERSION));
11 return;
12 }
13
14 if ( !trap_JK2MF_GetPlayerStats(clientNum, &ply) )
15 {
16 trap_SendServerCommand(clientNum, "print \"Something went wrong.\n\"");
17 return;
18 }
19
20 if ( ply.clientOS == OS_WINDOWS )
21 trap_SendServerCommand(clientNum, "print \"You are using Microsoft Windows.\n\"");
22 else if ( ply.clientOS == OS_MAC )
23 trap_SendServerCommand(clientNum, "print \"You are using Apple's Mac.\n\"");
24 else
25 trap_SendServerCommand(clientNum, "print \"I can't tell you what OS you are using.\n\"");
26 }