when admin on duty , warn the attacker
#1

hi
in gamemod i have InAdminMode and AdminLevel i used OnPlayerTakeDamage but its aint working
thanks for helping me



Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid) // take damage
{
  if(issuerid != INVALID_PLAYER_ID)
    {
        new string[128], admin[MAX_PLAYER_NAME], attacker[MAX_PLAYER_NAME];
        
        GetPlayerName(playerid, admin, sizeof (admin));
        GetPlayerName(issuerid, attacker, sizeof (attacker));

        
         if( admin == AdminLevel[playerid] >= 1 == InAdminMode[playerid] == 1)

          {
        format(string, sizeof(string), "dont attack admin on duty");
        SendClientMessage(attacker,0xFFFFFFFF, string); //        can   replace  the warn msg with ApplyAnmation ? how i do it like attacker == applyanmation() ?
        }
    }
    return 1;
}
Reply
#2

if( admin == AdminLevel[playerid] >= 1 && InAdminMode[playerid] == 1)

Try this!
Reply
#3

thx for answering me Scrillex but still gives me error

Quote:

: error 010: invalid function or declaration
error 010: invalid function or declaration
: error 033: array must be indexed (variable "admin")
: error 035: argument type mismatch (argument 1)

can replace the warn msg with ApplyAnmation ? how i do it like attacker == applyanmation() ?
Reply
#4

where is new admin? Can you show me pls! As you can see

error 033: array must be indexed (variable "admin") admin ain't indexed so there is something missing in it!
Adn simplest way is

if(AdminLevel[playerid] >= 1 && InAdminMode[playerid] == 1)
Reply
#5

Код:
         if( admin == AdminLevel[playerid] >= 1 == InAdminMode[playerid] == 1)
admin is just a name


Код:
            if(AdminLevel[playerid] >= 1 && InAdminMode[playerid] == 1)
possibly this cba to read it

edit:too slow, previous poster edited his message delete if want
Reply
#6

So basiclly && = and and as fanction you can see it..
pawn Код:
if( AdminLevel[playerid] >= 1 and InAdminMode[playerid] == 1)
{
 and your cmd.. so it will check bouth sides..
}
Admin is usless there arent nothing indexed to be = with AdminLevel..

So thats the thing!
Reply
#7

thank you guys its wroked just fine
Reply
#8

No problem always welcom
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)