command only for admin~ help !
#1

hey, I have a problem
I want to add a command / cmd
specifically for admin? how?
I tried to create his own, but the result of an error ~

Код:
if(strcmp(cmdtext, "/cmd", true)==0)

        if(pInfo[playerid][Admin] < 1),
		ShowPlayerDialog(playerid,4,DIALOG_STYLE_LIST,"Help menu","Info\nCMD\nCamera\nTime's\nMoves\nFun","Oke","Cancel");
		}
        

	return 1;
	}
Error~
Код:
C:\Users\Mas O\Documents\Server\gamemodes\D.pwn(1617) : error 029: invalid expression, assumed zero
C:\Users\Mas O\Documents\Server\gamemodes\D.pwn(1619) : warning 209: function "OnPlayerCommandText" should return a value
C:\Users\Mas O\Documents\Server\gamemodes\D.pwn(1622) : error 010: invalid function or declaration
C:\Users\Mas O\Documents\Server\gamemodes\D.pwn(1626) : error 010: invalid function or declaration
C:\Users\Mas O\Documents\Server\gamemodes\D.pwn(1629) : error 010: invalid function or declaration
C:\Users\Mas O\Documents\Server\gamemodes\D.pwn(1631) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
Reply
#2

pawn Код:
if(!strcmp("/cmd", cmdtext))
 {
    if(pInfo[playerid][Admin] < 1)
    {
        ShowPlayerDialog(playerid,4,DIALOG_STYLE_LIST,"Help menu","Info\nCMD\nCamera\nTime's\nMoves\nFun","Oke","Cancel");
    }
    return 1;
 }
Reply
#3

You have a missing bracket..
pawn Код:
if(strcmp(cmdtext, "/cmd", true)==0)
{
        if(pInfo[playerid][Admin] < 1)
        {
            ShowPlayerDialog(playerid,4,DIALOG_STYLE_LIST,"Help menu","Info\nCMD\nCamera\nTime's\nMoves\nFun","Oke","Cancel");
        }
        return 1;
}
Reply
#4

Most likely also [pAdmin] dpending on you enum of playerirnfo...

Код:
if(strcmp(cmdtext, "/cmd", true)==0)
         {        
              if(pInfo[playerid][pAdmin] < 1)        
             {            
                 ShowPlayerDialog(playerid,4,DIALOG_STYLE_LIST,"Helpmenu","Info\nCMD\nCamera\nTime's\nMoves\nFun","Oke","Cancel");        
          }        
          return 1;}
Reply
#5

thank's sir
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)