Onplayerupdate
#1

Aight,I got playerupdate checking for miniguns,but I have done a cmd that makes the players HasMG =1 and gives a minigun,which will exclude from the ban spree. I know its about if clause and "and"s but couldn't get in to it. I asked a friend he told me a bunch of stuff but still dunno how to do it.

I just want it not to ban if the player is HasMG[playerid] = 1; and If player is an admin lvl 4.

Код:
public OnPlayerUpdate(playerid)
{
   new weapon=GetPlayerWeapon(playerid);
   if(weapon==38||weapon==1||weapon==2||weapon==3||weapon==5||weapon==6||weapon==7||weapon==8||weapon==9||weapon==10||weapon==11||weapon==12||weapon==13||weapon==14||weapon==15||weapon==35||weapon==39)
   if(PlayerInfo[playerid][pAdmin] < 4)
   HasMG[playerid] = 0;
   {
Reply
#2

The first time you set it, it stays the same as you are setting the variable to 1.

Having this many checks for something which has already been defined is kinda pointless. So if you have HasMG[playerid] = 1; on your command, you don't need to set it again

Also, on your Ban check, just add the line
if(PlayerInfo[playerid][pAdmin] != 4) return 0;
Reply
#3

It is working well with Padmin=4 aldready, I want it NOT to ban if the player HasMG= 1;
Reply
#4

if(PlayerInfo[playerid][pAdmin] < 4 && HasMG[playerid] != 1)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)