Admin Commands =>
#1

Hello i need how to create if player is admin and get minigun dont kick him.Buut if player is not admin kick him.
Reply
#2

Hi.

What kind of admin system do you use ?
RCON Admin or simply PlayerInfo[playerid][pAdmin] (or something like that, a var you created yourself) ?

If it's RCON, simply use IsPlayerAdmin. (Click on the name of the function for more informations)
Else, use
PHP код:
if(PlayerInfo[playerid][pAdmin] >= 1) return 1// Replace PlayerInfo[playerid][pAdmin] by ur personnal var.
else return Kick(playerid); 
Reply
#3

Can to help ?

Bro thnx But tell mee a example if player get weapon id 38
Reply
#4

PHP код:

public OnPlayerUpdate(playerid)
{
   if(
GetPlayerWeapon(playerid) == 38 && !IsAdmin(playerid)) return Kick(playerid); // RCON Admin
   // OR with a personnal var
   
if(GetPlayerWeapon(playerid) == 38 && PlayerInfo[playerid][pAdmin] < 1) return Kick(playerid); //
return 1;

Reply
#5

thnx
Reply
#6

Bro he doesent work in my computer found any next look something when i use any i do if(pInfo[playerid][Adminlevel] < 5 &&....... Help mee plz
Reply
#7

pawn Код:
if(GetPlayerWeapon(playerid) == 38 && pInfo[playerid][Adminlevel] < 5) return Kick(playerid);
Reply
#8

He show this
Quote:

public OnPlayerUpdate(playerid)
{
if(GetPlayerWeapon(playerid) == 38 && pInfo[playerid][Adminlevel] < 5) return Kick(playerid);
return 1;
}

Quote:

C:\Users\Arlind\Desktop\fsdf\filterscripts\Project .pwn(5532) : warning 215: expression has no effect
C:\Users\Arlind\Desktop\fsdf\filterscripts\Project .pwn(5532) : error 001: expected token: ";", but found ")"
C:\Users\Arlind\Desktop\fsdf\filterscripts\Project .pwn(5532) : error 029: invalid expression, assumed zero
C:\Users\Arlind\Desktop\fsdf\filterscripts\Project .pwn(5532) : warning 215: expression has no effect

This is 5532
Quote:

if(GetPlayerWeapon(playerid) == 38 && pInfo[playerid][Adminlevel] < 5) return Kick(playerid);

Reply
#9

Have you just correctly initialized your enum-array ?

such as

PHP код:

enum pInfo
{
   
// Some vars
   
pLevel,
   
Adminlevel,
   
// Other vars
};

new 
pInfo[MAX_PLAYERS][pInfo]; 
Reply
#10

I have this


Quote:

enum PlayerInfo
{
Pass[129], //User's password
Adminlevel, //User's admin level
VIPlevel, //User's vip level
Money, //User's money
Scores, //User's scores
Kills, //User's kills
Deaths, //User's deaths
Adisable,
Banned,
Pills,
Savedskin,
Last,
NoPM,
Drugs
}

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)