SA-MP Forums Archive
command only for admin~ help ! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: command only for admin~ help ! (/showthread.php?tid=501746)



command only for admin~ help ! - kloning1 - 20.03.2014

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.



Re: command only for admin~ help ! - DerickClark - 20.03.2014

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;
 }



Re: command only for admin~ help ! - MythicalMarauder - 20.03.2014

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;
}



Re: command only for admin~ help ! - CharlieSanchez - 20.03.2014

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;}



Re: command only for admin~ help ! - kloning1 - 20.03.2014

thank's sir