Jump to content

Home

Question


Astelraid

Recommended Posts

i get a syntax error: "if" when i place this cmd in g_main.c

 

 

/*
================
My Admin Login cmd
================
*/

if(Q_stricmp (cmd, "login") == 0) {      
char char_password[MAX_STRING_CHARS];
trap_Argv( 1, char_password, sizeof( char_password ) );
char wanted[MAX_STRING_CHARS];

strcpy(wanted,trap_Cvar_VariableValue("VM_Password"));
trap_SendServerCommand( ent-g_entities , va( "print \"^3You need:^7%i ^1You typed:^7 %i \n\"",wanted,char_password));
if(Q_stricmp (wanted, char_password) == 0) {
    if (ent->client->pers.Admin==1) ent->client->pers.Admin=0;
    else ent->client->pers.Admin=1;

    if (ent->client->pers.Admin==1) trap_SendServerCommand( ent-g_entities , va( "print \"^1You login as admin"));
    if (ent->client->pers.Admin==0) trap_SendServerCommand( ent-g_entities , va( "print \"^1You logout as admin"));
    }
    else trap_SendServerCommand( ent-g_entities , va( "print \"^1%i is the incorrect password.",char_password));
    }

 

anyone know why?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...