when admin on duty , warn the attacker -
omidi - 14.03.2013
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;
}
Re: when admin on duty , warn the attacker -
Scrillex - 14.03.2013
if( admin == AdminLevel[playerid] >= 1 && InAdminMode[playerid] == 1)
Try this!
Re: when admin on duty , warn the attacker -
omidi - 14.03.2013
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() ?
Re: when admin on duty , warn the attacker -
Scrillex - 14.03.2013
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)
Re: when admin on duty , warn the attacker -
sampreader - 14.03.2013
Код:
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
Re: when admin on duty , warn the attacker -
Scrillex - 14.03.2013
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!
Re: when admin on duty , warn the attacker -
omidi - 14.03.2013
thank you guys its wroked just fine
Re: when admin on duty , warn the attacker -
Scrillex - 14.03.2013
No problem always welcom