Admin cmd
#1

Ok could someone please give me an example of an easy admin cmd??
I tried so many ways but couldnt find the right one lol!

An example on this?Or just some ideeas?

pawn Код:
if(strcmp(cmd, "/ago", true)==0)
    {
    MoveDynamicObject(Agate, 2298.9436035156, 604.76196289063, 12.568704605103,5);
    return 1;
    }
Reply
#2

Код:
if((strcmp(cmd, "/ago", true) == 0) && PlayerInfo[playerid][AdminLevel] >= 5)
	{
	MoveDynamicObject(Agate, 2298.9436035156, 604.76196289063, 12.568704605103,5);
	return 1;
	}
this better? i should askif this is for rcon or admin FS?
Reply
#3


pawn Код:
if(strcmp(cmdtext, "/hi", true) == 0)
{
  if(IsPlayerAdmin(playerid))
  {
   SendClientMessageToAll(0x0000FF, "Admin Message: Hello there!");
  }
  return 1;
}
Reply
#4

Ok so the first ideea:Ive tried that but it didnt work:O "Unknown Command"

The second one its just for RCON admins. I want for lvl 1 admins for example!

Thanks!
Reply
#5

It all depends on what variables you're using to set/check the players admin level.
Reply
#6

well rcon dont have levels unless you make em and grims will work for all rcon admins
Reply
#7

Quote:
Originally Posted by Grim_
It all depends on what variables you're using to set/check the players admin level.
None...tho i also tried to add it on Ladmin but didnt work ...
Reply
#8

Then you need to make some to hold the admin level of the players. For example:
pawn Код:
new AdminLevel[MAX_PLAYERS];

// then in the command
if(AdminLevel[playerid] >= 1)
{
  // do the command action
}
Etc, etc.
Reply
#9

Quote:
Originally Posted by Grim_
Then you need to make some to hold the admin level of the players. For example:
pawn Код:
new AdminLevel[MAX_PLAYERS];

// then in the command
if(AdminLevel[playerid] >= 1)
{
  // do the command action
}
Etc, etc.
i tried what u told me new AdminLevel[MAX_PLAYERS]; is already defined...

and i have this
pawn Код:
if(strcmp(cmd, "/ago", true)==0 && PlayerInfo[playerid][AdminLevel] >= 5)
    {
    MoveDynamicObject(Agate, 2298.9436035156, 604.76196289063, 12.568704605103,5);
    return 1;
    }
It compiles perfect...but doesnt work....
Reply
#10

Make sure you are a level 5 admin... try my code.

pawn Код:
if(strcmp(cmd, "/ago", true) == 0)
{
if(PlayerInfo[playerid][AdminLevel] >= 5)
{
MoveDynamicObject(Agate, 2298.9436035156, 604.76196289063, 12.568704605103,5);
return 1;
}
else
{
SendClientMessage(playerid, COLOR, "You aren't a level 5 admin!");
}
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)