The Score.
#1

I can't seem to figure out how to make a small coding script.

Say if a players score is below 10 and they have a weapon in their hands they get instantly banned.
Anyone could help me with this? I'll hand you a rep+.
Reply
#2

hii I think this should work.
Код:
forward AntiWeapon();

public AntiWeapon()
{
	for(new playerid; playerid<MAX_PLAYERS; playerid++)
	{
		if(IsPlayerConnected(playerid))
	 	{
	  		if(GetPlayerScore(playerid) < 10 && PlayerSpawned[playerid] == 1)
	    	{
	    	    new wep = GetPlayerWeapon(playerid);
	     		if(wep==1||wep==2||wep==3||wep==4||wep==5||wep==6||wep==7||wep==8||wep==9||wep==10||wep==11||wep==12||wep==13||wep==14||wep==15||wep==16||wep==17||wep==18||wep==22||wep==23||wep==24||wep==25||wep==26||wep==27||wep==28||wep==29||wep==30||wep==31||wep==32||wep==33||wep==34||wep==35||wep==36||wep==37||wep==38||wep==39||wep==40||wep==41||wep==42||wep==43||wep==44||wep==45)
	       		{
	         		BanUser(playerid, "Weapon hacks", "Anti Cheat");//or whatever function you use to ban a player
	           	}
			}
		}
	}
}
then go to OnGameModeInit() and add this line:
Код:
SetTimer("AntiWeapon", 1000, true);
Note: you need to change "BanUser(playerid, "Weapon hacks", "Anti Cheat");" to the function you use ..
Reply
#3

I figured a different system, I will rep+ you in 24hours anyways for trying atleast.
Reply
#4

or, this way :
pawn Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
    if(weapondid == WEAPONS_ID)
    { // remplace it by the weapons he shouldn't have
        if(GetPlayerScore(playerid) > 10) { return 1; } // if he score is > 10, do nothing..
        else Ban(playerid); // else he have < 10, we ban him.
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)