25 static char value[512];
33 p = strchr(value,
'/');
37 if ((
int)(
dmflags->value) & DF_MODELTEAMS) {
51 if (!((
int)(
dmflags->value) & (DF_MODELTEAMS | DF_SKINTEAMS)))
57 if (strcmp(ent1Team, ent2Team) == 0)
71 if (
cl->chase_target) {
77 for (i = 1 ; i <= MAX_ITEMS ; i++) {
78 index = (
cl->pers.selected_item + i) % MAX_ITEMS;
84 if (!(it->
flags & itflags))
87 cl->pers.selected_item = index;
91 cl->pers.selected_item = -1;
102 if (
cl->chase_target) {
108 for (i = 1 ; i <= MAX_ITEMS ; i++) {
109 index = (
cl->pers.selected_item + MAX_ITEMS - i) % MAX_ITEMS;
115 if (!(it->
flags & itflags))
118 cl->pers.selected_item = index;
122 cl->pers.selected_item = -1;
157 gi.cprintf(ent, PRINT_HIGH,
"You must run the server with '+set cheats 1' to enable this command.\n");
163 if (Q_stricmp(name,
"all") == 0)
168 if (give_all || Q_stricmp(
gi.argv(1),
"health") == 0) {
170 ent->health = atoi(
gi.argv(2));
172 ent->health = ent->max_health;
177 if (give_all || Q_stricmp(name,
"weapons") == 0) {
184 ent->client->pers.inventory[i] += 1;
190 if (give_all || Q_stricmp(name,
"ammo") == 0) {
203 if (give_all || Q_stricmp(name,
"armor") == 0) {
207 ent->client->pers.inventory[
ITEM_INDEX(it)] = 0;
210 ent->client->pers.inventory[
ITEM_INDEX(it)] = 0;
220 if (give_all || Q_stricmp(name,
"Power Shield") == 0) {
240 ent->client->pers.inventory[i] = 1;
250 gi.cprintf(ent, PRINT_HIGH,
"unknown item\n");
256 gi.cprintf(ent, PRINT_HIGH,
"non-pickup item\n");
264 ent->client->pers.inventory[index] = atoi(
gi.argv(2));
266 ent->client->pers.inventory[index] += it->
quantity;
290 gi.cprintf(ent, PRINT_HIGH,
"You must run the server with '+set cheats 1' to enable this command.\n");
296 gi.cprintf(ent, PRINT_HIGH,
"godmode OFF\n");
298 gi.cprintf(ent, PRINT_HIGH,
"godmode ON\n");
314 gi.cprintf(ent, PRINT_HIGH,
"You must run the server with '+set cheats 1' to enable this command.\n");
320 gi.cprintf(ent, PRINT_HIGH,
"notarget OFF\n");
322 gi.cprintf(ent, PRINT_HIGH,
"notarget ON\n");
336 gi.cprintf(ent, PRINT_HIGH,
"You must run the server with '+set cheats 1' to enable this command.\n");
342 gi.cprintf(ent, PRINT_HIGH,
"noclip OFF\n");
345 gi.cprintf(ent, PRINT_HIGH,
"noclip ON\n");
366 gi.cprintf(ent, PRINT_HIGH,
"unknown item: %s\n", s);
370 gi.cprintf(ent, PRINT_HIGH,
"Item is not usable.\n");
374 if (!ent->client->pers.inventory[index]) {
375 gi.cprintf(ent, PRINT_HIGH,
"Out of item: %s\n", s);
399 gi.cprintf(ent, PRINT_HIGH,
"unknown item: %s\n", s);
403 gi.cprintf(ent, PRINT_HIGH,
"Item is not dropable.\n");
407 if (!ent->client->pers.inventory[index]) {
408 gi.cprintf(ent, PRINT_HIGH,
"Out of item: %s\n", s);
428 cl->showscores = qfalse;
429 cl->showhelp = qfalse;
431 if (
cl->showinventory) {
432 cl->showinventory = qfalse;
436 cl->showinventory = qtrue;
439 for (i = 0 ; i < MAX_ITEMS ; i++) {
442 gi.unicast(ent, qtrue);
456 if (ent->client->pers.selected_item == -1) {
457 gi.cprintf(ent, PRINT_HIGH,
"No item to use.\n");
461 it = &
itemlist[ent->client->pers.selected_item];
463 gi.cprintf(ent, PRINT_HIGH,
"Item is not usable.\n");
483 if (!
cl->pers.weapon)
489 for (i = 1 ; i <= MAX_ITEMS ; i++) {
490 index = (selected_weapon + i) % MAX_ITEMS;
499 if (
cl->pers.weapon == it)
518 if (!
cl->pers.weapon)
524 for (i = 1 ; i <= MAX_ITEMS ; i++) {
525 index = (selected_weapon + MAX_ITEMS - i) % MAX_ITEMS;
534 if (
cl->pers.weapon == it)
552 if (!
cl->pers.weapon || !
cl->pers.lastweapon)
577 if (ent->client->pers.selected_item == -1) {
578 gi.cprintf(ent, PRINT_HIGH,
"No item to drop.\n");
582 it = &
itemlist[ent->client->pers.selected_item];
584 gi.cprintf(ent, PRINT_HIGH,
"Item is not dropable.\n");
597 if ((
level.
time - ent->client->respawn_time) < 5)
612 ent->client->showscores = qfalse;
613 ent->client->showhelp = qfalse;
614 ent->client->showinventory = qfalse;
656 qsort(index, count,
sizeof(index[0]),
PlayerSort);
661 for (i = 0 ; i < count ; i++) {
665 if (strlen(small) + strlen(large) >
sizeof(large) - 100) {
667 strcat(large,
"...\n");
670 strcat(large, small);
673 gi.cprintf(ent, PRINT_HIGH,
"%s\n%i players\n", large, count);
685 i = atoi(
gi.argv(1));
688 if (ent->client->ps.pmove.pm_flags & PMF_DUCKED)
691 if (ent->client->anim_priority >
ANIM_WAVE)
698 gi.cprintf(ent, PRINT_HIGH,
"flipoff\n");
703 gi.cprintf(ent, PRINT_HIGH,
"salute\n");
708 gi.cprintf(ent, PRINT_HIGH,
"taunt\n");
713 gi.cprintf(ent, PRINT_HIGH,
"wave\n");
719 gi.cprintf(ent, PRINT_HIGH,
"point\n");
731 void Cmd_Say_f(edict_t *ent, qboolean team, qboolean arg0)
739 if (
gi.argc() < 2 && !arg0)
742 if (!((
int)(
dmflags->value) & (DF_MODELTEAMS | DF_SKINTEAMS)))
746 Q_snprintf(text,
sizeof(text),
"(%s): ", ent->client->pers.netname);
748 Q_snprintf(text,
sizeof(text),
"%s: ", ent->client->pers.netname);
751 strcat(text,
gi.argv(0));
753 strcat(text,
gi.args());
759 p[strlen(p) - 1] = 0;
765 if (strlen(text) > 150)
774 gi.cprintf(ent, PRINT_HIGH,
"You can't talk for %d more seconds\n",
780 i = (
sizeof(
cl->flood_when) /
sizeof(
cl->flood_when[0])) + i;
781 if (
cl->flood_when[i] &&
784 gi.cprintf(ent, PRINT_CHAT,
"Flood protection: You can't talk for %d seconds.\n",
788 cl->flood_whenhead = (
cl->flood_whenhead + 1) %
789 (
sizeof(
cl->flood_when) /
sizeof(
cl->flood_when[0]));
794 gi.cprintf(NULL, PRINT_CHAT,
"%s", text);
806 gi.cprintf(
other, PRINT_CHAT,
"%s", text);
827 e2->client->resp.score,
828 e2->client->pers.netname,
829 e2->client->resp.spectator ?
" (spectator)" :
"");
830 if (strlen(text) + strlen(
st) >
sizeof(text) - 50) {
831 sprintf(text + strlen(text),
"And more...\n");
832 gi.cprintf(ent, PRINT_HIGH,
"%s", text);
837 gi.cprintf(ent, PRINT_HIGH,
"%s", text);
855 if (Q_stricmp(cmd,
"players") == 0) {
859 if (Q_stricmp(cmd,
"say") == 0) {
863 if (Q_stricmp(cmd,
"say_team") == 0) {
867 if (Q_stricmp(cmd,
"score") == 0) {
871 if (Q_stricmp(cmd,
"help") == 0) {
879 if (Q_stricmp(cmd,
"use") == 0)
881 else if (Q_stricmp(cmd,
"drop") == 0)
883 else if (Q_stricmp(cmd,
"give") == 0)
885 else if (Q_stricmp(cmd,
"god") == 0)
887 else if (Q_stricmp(cmd,
"notarget") == 0)
889 else if (Q_stricmp(cmd,
"noclip") == 0)
891 else if (Q_stricmp(cmd,
"inven") == 0)
893 else if (Q_stricmp(cmd,
"invnext") == 0)
895 else if (Q_stricmp(cmd,
"invprev") == 0)
897 else if (Q_stricmp(cmd,
"invnextw") == 0)
899 else if (Q_stricmp(cmd,
"invprevw") == 0)
901 else if (Q_stricmp(cmd,
"invnextp") == 0)
903 else if (Q_stricmp(cmd,
"invprevp") == 0)
905 else if (Q_stricmp(cmd,
"invuse") == 0)
907 else if (Q_stricmp(cmd,
"invdrop") == 0)
909 else if (Q_stricmp(cmd,
"weapprev") == 0)
911 else if (Q_stricmp(cmd,
"weapnext") == 0)
913 else if (Q_stricmp(cmd,
"weaplast") == 0)
915 else if (Q_stricmp(cmd,
"kill") == 0)
917 else if (Q_stricmp(cmd,
"putaway") == 0)
919 else if (Q_stricmp(cmd,
"wave") == 0)
921 else if (Q_stricmp(cmd,
"playerlist") == 0)