SA-MP Forums Archive
Admin cmd - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Admin cmd (/showthread.php?tid=151019)



Admin cmd - ColdXX - 28.05.2010

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



Re: Admin cmd - (SF)Noobanatior - 28.05.2010

Код:
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?


Re: Admin cmd - Grim_ - 28.05.2010


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



Re: Admin cmd - ColdXX - 28.05.2010

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!



Re: Admin cmd - Grim_ - 28.05.2010

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


Re: Admin cmd - (SF)Noobanatior - 28.05.2010

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



Re: Admin cmd - ColdXX - 28.05.2010

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 ...


Re: Admin cmd - Grim_ - 28.05.2010

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.


Re: Admin cmd - ColdXX - 28.05.2010

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....


Re: Admin cmd - Antonio [G-RP] - 28.05.2010

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