PDA

View Full Version : command only for admin~ help !


kloning1
20/03/2014, 12:53 AM
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 (c) 1997-2006, ITB CompuPhase


5 Errors.

DerickClark
20/03/2014, 12:56 AM
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;
}

MythicalMarauder
20/03/2014, 07:20 AM
You have a missing bracket..

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

CharlieSanchez
20/03/2014, 09:24 AM
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;}

kloning1
20/03/2014, 11:07 AM
thank's sir :)