Admin Command List
#1

I have an admin system installed, and all done. What is the PAWN code, so if someone typed "/adcdms" as atleast level 1 admin, they get a list? I would list all the commands, I just need the code. Thanks
Reply
#2

What admin system? For example: gAdmin, xTremeAdmin, Ladmin, etc.

If you tell me which one I'm sure I can help you out
Reply
#3

Seif-Admin

Just I am editing the commands, like instead of /warn, its /adwarn or instead of /view, its /adspec or /adspecoff
Reply
#4

Quote:
Originally Posted by ThaKing
I have an admin system installed, and all done. What is the PAWN code, so if someone typed "/adcdms" as atleast level 1 admin, they get a list? I would list all the commands, I just need the code. Thanks
Something like this?
Quote:

if(strcmp("/acmds", cmdtext, true, 10) == 0)
{
if(pAdminLvl[playerid] > 1) {
SendClientMessage(playerid, 0xFFFFFFFF, "[ADMINCMD]: /bla /bla /bla");
SendClientMessage(playerid, 0xFFFFFFFF, "[ADMINCMD]: /bla /bla /bla");
SendClientMessage(playerid, 0xFFFFFFFF, "[ADMINCMD]: /bla /bla /bla");
SendClientMessage(playerid, 0xFFFFFFFF, "[ADMINCMD]: /bla /bla /bla");
return 1;
}
}
return SendClientMessage(playerid, 0xFFFFFFFF, "You are not a admin!");
}

I hope that this was were you was searching for
Reply
#5

And what do you want exactly?

EDIT:

pawn Код:
if(strcmp("/acmds", cmdtext, true, 10) == 0)
{
   if(pAdminLvl[playerid] >= 1)
   {
      SendClientMessage(playerid, 0xFFFFFFFF, "[ADMINCMD]: /bla /bla /bla");
      SendClientMessage(playerid, 0xFFFFFFFF, "[ADMINCMD]: /bla /bla /bla");
      SendClientMessage(playerid, 0xFFFFFFFF, "[ADMINCMD]: /bla /bla /bla");
      SendClientMessage(playerid, 0xFFFFFFFF, "[ADMINCMD]: /bla /bla /bla");
   }
   else return SendClientMessage(playerid, 0xFFFFFFFF, "You are not a admin!");
}
It needs to be at least level one, what you did would only show if higher than level 1. @Ihsan_Cingisiz, mind to use brackets the right way.
Reply
#6

Quote:
Originally Posted by Ihsan_Cingisiz
Something like this?
Quote:

if(strcmp("/acmds", cmdtext, true, 10) == 0)
{
if(pAdminLvl[playerid] > 1) {
SendClientMessage(playerid, 0xFFFFFFFF, "[ADMINCMD]: /bla /bla /bla");
SendClientMessage(playerid, 0xFFFFFFFF, "[ADMINCMD]: /bla /bla /bla");
SendClientMessage(playerid, 0xFFFFFFFF, "[ADMINCMD]: /bla /bla /bla");
SendClientMessage(playerid, 0xFFFFFFFF, "[ADMINCMD]: /bla /bla /bla");
return 1;
}
}
return SendClientMessage(playerid, 0xFFFFFFFF, "You are not a admin!");
}

I hope that this was were you was searching for
Yes, something like that, except when I added that to my code, and compiled it, pawno crashed :/ tried it 2 times.
Reply
#7

Quote:
Originally Posted by [SAG
$KingCory$ ]
Quote:
Originally Posted by Ihsan_Cingisiz
Something like this?
Quote:

if(strcmp("/acmds", cmdtext, true, 10) == 0)
{
if(pAdminLvl[playerid] > 1) {
SendClientMessage(playerid, 0xFFFFFFFF, "[ADMINCMD]: /bla /bla /bla");
SendClientMessage(playerid, 0xFFFFFFFF, "[ADMINCMD]: /bla /bla /bla");
SendClientMessage(playerid, 0xFFFFFFFF, "[ADMINCMD]: /bla /bla /bla");
SendClientMessage(playerid, 0xFFFFFFFF, "[ADMINCMD]: /bla /bla /bla");
return 1;
}
}
return SendClientMessage(playerid, 0xFFFFFFFF, "You are not a admin!");
}

I hope that this was were you was searching for
Yes, something like that, except when I added that to my code, and compiled it, pawno crashed :/ tried it 2 times.
Use my code. That should work, his one is not created ther right way.
Reply
#8

Tried yours, got like 4 errors...

Код:
\GTA\SAMPSERV\filterscripts\SeifAdmin.pwn(830) : warning 217: loose indentation
\GTA\SAMPSERV\filterscripts\SeifAdmin.pwn(832) : error 017: undefined symbol "pAdminLvl"
\GTA\SAMPSERV\filterscripts\SeifAdmin.pwn(832) : warning 215: expression has no effect
\GTA\SAMPSERV\filterscripts\SeifAdmin.pwn(832) : error 001: expected token: ";", but found "]"
\GTA\SAMPSERV\filterscripts\SeifAdmin.pwn(832) : error 029: invalid expression, assumed zero
\GTA\SAMPSERV\filterscripts\SeifAdmin.pwn(832) : fatal error 107: too many error messages on one line
Here is an example code, for teleporting to a player. Maybe this could help you guys figure out the code for admin commands?

Код:
	if(strcmp(cmd, "/adgoto", true) == 0) // Teleports to a player
	{
		new Float:pX,Float:pY,Float:pZ;
		if (AccountInfo[playerid][AdminLevel] >= 1 || IsPlayerAdmin(playerid))
		{
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, ORANGE, "USAGE: /adgoto [playername/id]");
				SendClientMessage(playerid, ORANGE, "FUNCTION: Will teleport to the specified player.");
				return 1;
			}
			new giveplayerid = ReturnUser(tmp);
			if(giveplayerid != INVALID_PLAYER_ID)
			{
			  if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
			  {
			  	GetPlayerPos(giveplayerid,pX,pY,pZ);
			  	SetVehiclePos(GetPlayerVehicleID(playerid),pX,pY,pZ+2);
		 		}
		 		else
		 		{
			  	GetPlayerPos(giveplayerid,pX,pY,pZ);
			  	SetPlayerPos(playerid,pX,pY,pZ+2);
			  }
			  SetPlayerInterior(playerid,GetPlayerInterior(giveplayerid));
			}
			else if(giveplayerid == INVALID_PLAYER_ID)
			{
				format(string, sizeof(string), "%d is not an active player.", giveplayerid);
				SendClientMessage(playerid, RED, string);
			}
		}
		else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
		return 1;
	}
Reply
#9

Код:
if(strcmp("/acmds", cmdtext, true, 10) == 0)
{
   if(AccountInfo[playerid][AdminLevel] >= 1) {
   SendClientMessage(playerid, 0xFFFFFFFF, "[ADMINCMD]: /bla /bla /bla");
   SendClientMessage(playerid, 0xFFFFFFFF, "[ADMINCMD]: /bla /bla /bla");
   SendClientMessage(playerid, 0xFFFFFFFF, "[ADMINCMD]: /bla /bla /bla");
   SendClientMessage(playerid, 0xFFFFFFFF, "[ADMINCMD]: /bla /bla /bla");
   return 1;
}
}
   return SendClientMessage(playerid, 0xFFFFFFFF, "You are not an admin!");
}
Should work
Reply
#10

Tried that, got the pawn compiler has stopped working thing again :/
Reply
#11

Oh wait sorry, forgot to remove something from before. Got 5 errors when adding that code Chrham.

Код:
\GTA\SAMPSERV\filterscripts\SeifAdmin.pwn(2644) : warning 217: loose indentation
\GTA\SAMPSERV\filterscripts\SeifAdmin.pwn(2654) : warning 217: loose indentation
\GTA\SAMPSERV\filterscripts\SeifAdmin.pwn(2657) : error 010: invalid function or declaration
\GTA\SAMPSERV\filterscripts\SeifAdmin.pwn(2659) : error 010: invalid function or declaration
\GTA\SAMPSERV\filterscripts\SeifAdmin.pwn(2661) : error 010: invalid function or declaration
\GTA\SAMPSERV\filterscripts\SeifAdmin.pwn(2663) : error 010: invalid function or declaration
\GTA\SAMPSERV\filterscripts\SeifAdmin.pwn(2671) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
Reply
#12

On the code:

Код:
if(strcmp("/acmds", cmdtext, true, 10) == 0)
{
   if(AccountInfo[playerid][AdminLevel] >= 1) {
   SendClientMessage(playerid, 0xFFFFFFFF, "[ADMINCMD]: /bla /bla /bla");
   SendClientMessage(playerid, 0xFFFFFFFF, "[ADMINCMD]: /bla /bla /bla");
   SendClientMessage(playerid, 0xFFFFFFFF, "[ADMINCMD]: /bla /bla /bla");
   SendClientMessage(playerid, 0xFFFFFFFF, "[ADMINCMD]: /bla /bla /bla");
   return 1;
}
}
   return SendClientMessage(playerid, 0xFFFFFFFF, "You are not an admin!");
}
Look what I bolded, you put 1 to many { I think. I removed it, compiled it, and got 1 error message. Any help now?

Код:
\GTA\SAMPSERV\filterscripts\SeifAdmin.pwn(2644) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
Reply
#13


pawn Код:
if(strcmp("/acmds", cmdtext, true, 6) == 0) //should be 6 because /acmds is 6 characters
{
   if(pAdminLvl[playerid] >= 1)
   {
      SendClientMessage(playerid, 0xFFFFFFFF, "[ADMINCMD]: /bla /bla /bla");
      SendClientMessage(playerid, 0xFFFFFFFF, "[ADMINCMD]: /bla /bla /bla");
      SendClientMessage(playerid, 0xFFFFFFFF, "[ADMINCMD]: /bla /bla /bla");
      SendClientMessage(playerid, 0xFFFFFFFF, "[ADMINCMD]: /bla /bla /bla");
   }
   else return SendClientMessage(playerid, 0xFFFFFFFF, "You are not a admin!");
}
Reply
#14

Got it! There was no indentation at the firs if strpcmd thing.

Works now, thanks so much guys!!!
Reply


Forum Jump:


Users browsing this thread: 10 Guest(s)