Admin Levels? - 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: Admin Levels? (
/showthread.php?tid=336440)
Admin Levels? -
BleverCastard - 22.04.2012
Hello, I was wondering how I would make admin levels, I forgot how you start like
stock AdminLevel
{
// dunno what to put here
}
I honestly can't remember, thanks!
Re: Admin Levels? -
Richie© - 22.04.2012
Just make a variable:
pawn Код:
new AdminLevel[MAX_PLAYERS];
AdminLevel[playerid] = 1; // Lvl 1 admin.
Re: Admin Levels? -
Cjgogo - 22.04.2012
No...
pawn Код:
stock pInfo
{
AdminLevel,
//other useful variables
}
You must have player info lol
Re: Admin Levels? -
RollTi - 22.04.2012
Make a enum if you are going to make saving system
than variables
pawn Код:
enum pInfo
{
AdminLevel
};
new PlayerData[MAX_PLAYERS][pInfo];
USAGE:
pawn Код:
PlayerData[playerid][AdminLevel] = 10; //Level 10 Admin Level
Re: Admin Levels? -
BleverCastard - 22.04.2012
No I mean like
stock AdminLevel
{
case 1: "Trial Administrator"...
}
Re: Admin Levels? -
Snipa - 22.04.2012
Is the stock to make the player a desired admin level or simply state the name?
Quote:
Originally Posted by Cjgogo
You must have player info lol
|
No you don't..
Re: Admin Levels? -
RollTi - 22.04.2012
I get this idea from LuxAdmin
pawn Код:
new RankA[80]; //at the top of script
//at the stock function
switch(PlayerData[playerid][AdminLevel])
{
case 1: RankA = "Trial Admin";
}
Re: Admin Levels? -
Snipa - 22.04.2012
pawn Код:
new AdminLevel[MAX_PLAYERS];
stock SetAdminLevel(playerid, level)
{
AdminLevel[playerid] = level;
return 1;
}
Like this?
Re: Admin Levels? -
BleverCastard - 22.04.2012
Basically what I want is when I'm making an admin command it would be like: say if there level one admin which would be Server Moderator: %s %s has just kicked %s!
Server Moderator *NAME* has just kicked *NAME*!
If you know what I mean!
So I need the stock for the admin levels!
Re: Admin Levels? -
RollTi - 22.04.2012
Quote:
Originally Posted by Snipa
pawn Код:
new AdminLevel[MAX_PLAYERS];
stock SetAdminLevel(playerid, level) { switch(level) { case 1: AdminLevel[playerid] = 1; case 2: AdminLevel[playerid] = 2; case 3: AdminLevel[playerid] = 3; case 4: AdminLevel[playerid] = 4; case 5: AdminLevel[playerid] = 5; } return 1; }
Like this?
|
Like i give above he wants something like Admin Ranks like in LuxAdmin or in other server.
QUOTE (Previous)
pawn Код:
new RankA[80]; //at the top of script
//at the stock function
switch(PlayerData[playerid][AdminLevel])
{
case 1: RankA = "Trial Admin";
}
EDITED:
Example:
pawn Код:
new string[128], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(string, 128, "%s: %s(%d) has kicked %s(%d)", AdminLevel(playerid), pName, playerid, targetname, targetid);
SendClientMessageToAll(-1, string);
AdminLevel(playerid) - Your stock function
pName - AdminName
playerid - your id
targetname - the one was being kicked (not mention in code)
targetid - the id of player who being kicked (not mention in code)
targetname and targetid is not in code so if you copy/paste it you will get a error