Server Restart..
#1

So i maked simple /gmx command.. and when i type /gmx nothing ...
so the code's ive been using without any luck ..

First Code :
pawn Код:
if(strcmp(cmd, "/gmx", true) == 0)
    {
    if (IsPlayerAdmin(playerid))
    {
            GameModeExit();
        }
        else
        {
            SendClientMessage(playerid, COLOR_GRAD1, "  you are not authorized to use that command!");
        }
        return 1;
    }
Then i tried using it like this :
pawn Код:
//--------------------------------------SERVER REBOOT------------------------------------
        if(strcmp(cmd, "/gmx", true) == 0)
        {
        if (IsPlayerAdmin(playerid)) return SendRconCommand("gmx");
        else return SendClientMessage(playerid, COLOR_GRAD1, " not authorized to use this command!");
        }
Reply
#2

Its 'cmdtext', not 'cmd'.
Reply
#3

im using strtok oke? still not working even with CMDTEXT
Reply
#4

its not i get error's it's all compiling fine but not working ingame
Reply
#5

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[]) {
  if(strcmp(cmdtext, "/gmx", true) == 0 ) {
    if (IsPlayerAdmin(playerid)) {
      SendClientMessage(playerid, "Server Restarting...", 0xFFFFFFFF);
      SendRconCommand("gmx");
      return 1;
    }else {
      SendClientMessage(playerid, COLOR_GRAD1, "  you are not authorized to use that command!");
      return 1;
    }
  }
  return 0;
}
That should work, have not done awno code in a while
Reply
#6

that doesnt work!
Reply
#7

Thank you for your efford but it says Server Unknown Command.. it wasnt saying it before just nothing but now Server Unknown Command...
Reply
#8

What was the unkwown command ?

the SendRconCommand("gmx"); was copy'd from wiki.sa-mp.com ?
Reply
#9

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  if(strcmp(cmdtext, "/gmx", true) == 0 )
  {
    if (IsPlayerAdmin(playerid)) {
     SendClientMessage(playerid, "Server Restarting...", 0xFFFFFFFF);
     GameModeExit();
      return 1;
    }else {
      SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!");
      return 1;
    }
  }
  return 0;
}

Reply
#10

He-he -he guys this is wrong :
Код:
SendClientMessage(playerid, "Server Restarting...", 0xFFFFFFFF);
it must be:
Код:
SendClientMessage( playerid, 0xFFFFFFFF, "Server Restarting..." );
!! little mistake lol
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)