Peršokti į turinį
  • ŽAIDIMAI
  • , ŽAIDIMAI
  • ŽAIDIMAI

Pirkimo/Pardavimo/Mainymo temose nepamirškite nurodyti savo susiekimo kontaktų (Discord,Skype,Telegram).

Ši tema yra neaktyvi. Paskutinis pranešimas šioje temoje buvo prieš 4263 dienas (-ų). Patariame sukurti naują temą, o ne rašyti naują pranešimą.

Už neaktyvių temų prikėlimą galite sulaukti įspėjimo ir pranešimo pašalinimo!

Recommended Posts

  • ,

Imk nemokamai.

Anti-weapons.

#include <a_samp>
#include <foreach>
#include <zcmd>
#include <sscanf2>

#define COLOR_WHITE		 0xFFFFFFFF

#define RELEASED(%0) \
   (((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0)))

/*
13 - slot id
1- weapon id, 2 - ammo

Feature things:

*/

new Weapons[MAX_PLAYERS][13][2], bool:Spawned[MAX_PLAYERS], bool:CanCheck[MAX_PLAYERS];

main() { }

public OnGameModeInit()
{
   AddPlayerClass(0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
   print("Serveris paleistas.");
   return true;
}

public OnPlayerConnect(playerid)
{
   Spawned[playerid] = false;
   CanCheck[playerid] = false;
   AC_ResetPlayerWeapons(playerid, true);
   return true;
}

public OnPlayerSpawn(playerid)
{
   CanCheck[playerid] = false;
   Spawned[playerid] = true;
   return true;
}

public OnPlayerDeath(playerid, killerid, reason)
{
   Spawned[playerid] = false;
   return true;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
   if (RELEASED(KEY_FIRE))
   {
    new slotid = GetWeaponSlotByWepID(GetPlayerWeapon(playerid));
    SetTimerEx("AC_UpdatePlayerWeaponAmmo", 100, false, "ii", playerid, slotid);
   }
   return true;
}

public OnPlayerDisconnect(playerid, reason)
{
   return true;
}

public OnPlayerCommandPerformed( playerid, cmdtext[], success )
{
   if( !success )
   {
    SendClientMessage(playerid, COLOR_WHITE, "Komanda nerasta.");
    return true;
   }
   else
   {
    new pName[ MAX_PLAYER_NAME ];
    GetPlayerName( playerid, pName, MAX_PLAYER_NAME );
    printf( "[iD:%i] %s has called command: %s.", playerid, pName, cmdtext );
    return true;
   }
}

/*COMMAND:kill(playerid, params[])
{
   SetPlayerHealth(playerid, 0.0);
   return true;
}

COMMAND:ginklus(playerid, params[])
{
   ResetPlayerWeapons(playerid);
   return true;
}

COMMAND:ginkla(playerid, params[])
{
   new weaponid, ammo;
   if(sscanf(params, "ii", weaponid, ammo)) SendClientMessage(playerid, COLOR_WHITE, "Komandos naudojimas: /ginkla [weapon id] [ammo]");
   else
   {
    GivePlayerWeapon(playerid, weaponid, ammo);
   }
   return true;
}

COMMAND:iginklus(playerid, params[])
{
   AC_ResetPlayerWeapons(playerid);
   return true;
}

COMMAND:iginkla(playerid, params[])
{
   new weaponid, ammo;
   if(sscanf(params, "ii", weaponid, ammo)) SendClientMessage(playerid, COLOR_WHITE, "Komandos naudojimas: /iginkla [weapon id] [ammo]");
   else
   {
    AC_GivePlayerWeapon(playerid, weaponid, ammo);
   }
   return true;
}

stock DebugWeapons(playerid)
{
   new tempWeapon[1][2];
   print("[AC] Starting weapons debug...");
   for (new i = 0; i < 13; i++)
   {
    GetPlayerWeaponData(playerid, i, tempWeapon[0][0], tempWeapon[0][1]);
    printf("[AC] Weapon slot id: %d, weapon id: %i, weapon ammo: %i", i, tempWeapon[0][0], tempWeapon[0][1]);
   }
   print("[AC] Finished weapons debug.");
}*/

stock AC_ResetPlayerWeapons(playerid, bool:connect = false)
{
   // *** WARNING: Reset weapons when connected ***
   CanCheck[playerid] = false;
   ResetPlayerWeapons(playerid);
   for (new i = 0; i < 13; i++)
   {
    if(connect) Weapons[playerid][i][0] = 0;
    Weapons[playerid][i][1] = 0;
   }
}

stock AC_NullPlayerWeapons(playerid)
{
   // *** WARNING: Null weapons before saving ***
   CanCheck[playerid] = false;
   for (new slotid = 0; slotid < 13; slotid++)
   {
    if(IsWeaponFireable(Weapons[playerid][slotid][0]) && Weapons[playerid][slotid][1] == 0) AC_RemovePlayerWeapon(playerid, slotid);
   }
}

stock AC_GivePlayerWeapon(playerid, weaponid, ammo)
{
   CanCheck[playerid] = false;
   new slotid = GetWeaponSlotByWepID(weaponid), finalAmmo = ammo;
   if(IsWeaponsInSameSlot(AC_GetPlayerWeaponIDFromSlot(playerid, slotid), weaponid)) finalAmmo += AC_GetPlayerWeaponAmmoFromSlot(playerid, slotid);
   if(IsWeaponFireable(weaponid) && finalAmmo == 0) Weapons[playerid][slotid][1] = 0;
   else
   {
    Weapons[playerid][slotid][0] = weaponid;
    Weapons[playerid][slotid][1] = finalAmmo;
   }
   GivePlayerWeapon(playerid, weaponid, ammo);
}

stock AC_RegivePlayerWeapons(playerid)
{
   CanCheck[playerid] = false;
   for (new slotid = 0; slotid < 13; slotid++)
   {
    GivePlayerWeapon(playerid, Weapons[playerid][slotid][0], Weapons[playerid][slotid][1]);
   }
}

forward AC_UpdatePlayerWeaponAmmo(playerid, slotid);
public AC_UpdatePlayerWeaponAmmo(playerid, slotid)
{
   new weaponid, ammo;
   GetPlayerWeaponData(playerid, slotid, weaponid, ammo);
   if(IsWeaponFireable(weaponid) && Weapons[playerid][slotid][0] == weaponid) Weapons[playerid][slotid][1] = ammo;
}

stock AC_RemovePlayerWeapon(playerid, slotid)
{
   Weapons[playerid][slotid][0] = 0;
   Weapons[playerid][slotid][1] = 0;
}

public OnPlayerUpdate(playerid)
{
   foreach(Player, i)
   {
    if(Spawned[i])
    {
	    if(!CanCheck[i]) CanCheck[i] = true;
	    else
	    {
		    if(GetPlayerWeapon(i) == 0)
		    {
			    for (new slotid = 0; slotid < 13; slotid++)
			    {
				    AC_CheckPlayerWeapon(i, slotid);
			    }
		    }
		    else AC_CheckPlayerWeapon(i);
	    }
    }
   }
   return true;
}

stock AC_CheckPlayerWeapon(playerid, slotid = -1)
{
   new tempWeapon[1][2];
   if(slotid == -1) slotid = GetWeaponSlotByWepID(GetPlayerWeapon(playerid));
   GetPlayerWeaponData(playerid, slotid, tempWeapon[0][0], tempWeapon[0][1]);
   if(tempWeapon[0][0] != 0)
   {
    if(tempWeapon[0][0] != AC_GetPlayerWeaponIDFromSlot(playerid, slotid) || (IsWeaponFireable(tempWeapon[0][0]) && tempWeapon[0][1] > AC_GetPlayerWeaponAmmoFromSlot(playerid, slotid)))
    {
	    // kick
	    printf("[iD:%i] is kicked for gun cheats", playerid);
	    SendClientMessage(playerid, COLOR_WHITE, "KICKED");
	    printf("[iD:%i] is kicked for gun cheats. Wep id %i, ammo %i, ac wep id %i, ammo %i", playerid, tempWeapon[0][0], tempWeapon[0][1], Weapons[playerid][slotid][0], Weapons[playerid][slotid][1]);
    }
    else if(IsWeaponFireable(tempWeapon[0][0]) && AC_GetPlayerWeaponAmmoFromSlot(playerid, slotid) > tempWeapon[0][1]) Weapons[playerid][slotid][1] = tempWeapon[0][1];
   }
}

stock GetWeaponSlotByWepID(weaponid)
{
   switch (weaponid)
   {
    case 0, 1	  : return 0;
    case 2..9	  : return 1;
    case 22..24    : return 2;
    case 25..27    : return 3;
    case 28, 29, 32: return 4;
    case 30, 31    : return 5;
    case 33, 34    : return 6;
    case 35..38    : return 7;
    case 16..19, 39: return 8;
    case 41..43    : return 9;
    case 10..15    : return 10;
    case 44..46    : return 11;
    case 40	    : return 12;
   }
   return -1;
}

stock IsWeaponFireable(weaponid)
{
   switch (weaponid)
   {
    case 0..15, 40, 44..46: return false;
   }
   return true;
}

stock IsWeaponsInSameSlot(oldweaponid, newweaponid)
{
   if(GetWeaponSlotByWepID(oldweaponid) == GetWeaponSlotByWepID(newweaponid)) return true;
   return false;
}

stock AC_GetPlayerWeaponIDFromSlot(playerid, slotid) return Weapons[playerid][slotid][0];

stock AC_GetPlayerWeaponAmmoFromSlot(playerid, slotid) return Weapons[playerid][slotid][1];

Anti-airbrk // anti-teleport.

#include <a_samp>
#include <foreach>

#undef  MAX_PLAYERS
#define MAX_PLAYERS			 (100)

new Float:AC_oldPos[MAX_PLAYERS][3], AC_oldPlayerState[MAX_PLAYERS], CanCheckABX[MAX_PLAYERS], bool:CanCheckAirBreak[MAX_PLAYERS], NeedCheckTuningAB[MAX_PLAYERS];

stock Float:GetDistanceBetweenPoints(Float:x1, Float:y1, Float:z1, Float:x2, Float:y2, Float:z2)
{
   x1 -= x2;
   y1 -= y2;
   z1 -= z2;
   return floatsqroot((x1 * x1) + (y1 * y1) + (z1 * z1));
}

forward AntiCheat();

main()
{
   print("\n");
}

public OnGameModeInit()
{
   AddPlayerClass(292, 151.4260, -161.4709, 1.5781, 94.3938, 0, 0, 0, 0, 0, 0); // start location in Blue Berry (gangsta)
   UsePlayerPedAnims();
   return true;
}

public OnPlayerConnect(playerid)
{
   CanCheckAirBreak[playerid] = false;
   CanCheckABX[playerid] = true;
   NeedCheckTuningAB [playerid] = 0;
   return true;
}

public OnPlayerSpawn(playerid)
{
   CanCheckAirBreak[playerid] = false;
   return true;
}

public OnPlayerDisconnect(playerid, reason)
{
   CanCheckABX[playerid] = true;
   NeedCheckTuningAB [playerid] = 0;
   return true;
}

public OnPlayerUpdate(playerid)
{
   // Anti-air break
   // *Note* CanCheckAirBreak[playerid] = false; put into AC_SetPlayerPos.

   //if( !Afking[playerid] && CanCheckABX[playerid])
   if( CanCheckABX[playerid])
   {
    if(!CanCheckAirBreak[playerid])
    {
	    AC_AirBreakReset(playerid);
	    CanCheckAirBreak[playerid] = true;
    }
    else
    {
	    if( NeedCheckTuningAB[ playerid ] == 1 )
	    {
		    NeedCheckTuningAB[ playerid ] = 0;
		    CanCheckAirBreak[ playerid ] = false;
	    }
	    else if( NeedCheckTuningAB[ playerid ] > 0 ) NeedCheckTuningAB[ playerid ]--;
	    else
	    {
		    new AC_playerState = GetPlayerState(playerid);
		    if(AC_oldPlayerState[playerid] == AC_playerState)
		    {
			    if(AC_playerState == PLAYER_STATE_ONFOOT || AC_playerState == PLAYER_STATE_DRIVER || AC_playerState == PLAYER_STATE_PASSENGER)
			    {
				    if(AC_playerState == PLAYER_STATE_ONFOOT)
				    {
					    new AC_animIndex = GetPlayerAnimationIndex(playerid);
					    if(AC_animIndex)
					    {
						    new animLib[32], animName[32];
						    GetAnimationName(AC_animIndex, animLib, 32, animName, 32);
						    if(!strcmp(animName, "FALL_LAND", true) || !strcmp(animName, "CLIMB_JUMP2FALL", true) || !strcmp(animName, "CLIMB_PULL", true) || !strcmp(animName, "CLIMB_JUMP_B", true))
						    {
							    CanCheckAirBreak[playerid] = false;
							    return true;
						    }
					    }
				    }

				    new Float:AC_fPos[3], Float:AC_fSpeed;
				    if(AC_playerState == PLAYER_STATE_DRIVER) GetVehicleVelocity(GetPlayerVehicleID(playerid), AC_fPos[0], AC_fPos[1], AC_fPos[2]);
				    else GetPlayerVelocity(playerid, AC_fPos[0], AC_fPos[1], AC_fPos[2]);
				    AC_fSpeed = floatsqroot(floatpower(AC_fPos[0], 2) + floatpower(AC_fPos[1], 2) + floatpower(AC_fPos[2], 2)) * 200;
				    if(AC_oldPos[playerid][0] != 0.0)
				    {
					    GetPlayerPos(playerid, AC_fPos[0], AC_fPos[1], AC_fPos[2]);

					    if( IsPlayerInRangeOfPoint(playerid, 5.0, 616.7820, -74.8151, 997.6350 ) || IsPlayerInRangeOfPoint(playerid, 5.0, 615.2851, -124.2390, 997.6350 ) || IsPlayerInRangeOfPoint(playerid, 5.0, 617.5380, -1.9900, 1000.6829 ) )
					    {
						    NeedCheckTuningAB [ playerid ] = 10;
					    }

					    if( NeedCheckTuningAB [ playerid ] == 0 )
					    {
						    new Float:AC_traveledDistance = GetDistanceBetweenPoints(AC_fPos[0], AC_fPos[1], AC_fPos[2], AC_oldPos[playerid][0], AC_oldPos[playerid][1], AC_oldPos[playerid][2]);

						    AC_oldPos[playerid][0] = AC_fPos[0];
						    AC_oldPos[playerid][1] = AC_fPos[1];
						    AC_oldPos[playerid][2] = AC_fPos[2];
						    if(AC_traveledDistance > AC_fSpeed > 0.2)
						    {
							    new
								    //pName			 [ MAX_PLAYER_NAME ],
								    zin				 [ 60 ];

							    /*GetPlayerName		 ( playerid, pName, MAX_PLAYER_NAME );
							    format				  ( zin, sizeof( zin ), "[ KICK' ] Išmestas [{FF7E7E}%s{FFFFFF}]", pName );
							    SendClientMessageToAll  ( WHITE, zin );
							    SendClientMessageToAll  ( WHITE, "{FF0000}[]{FFFFFF} Priežastis: [{FF7E7E}Galimas 'Air Break' naudojimas{FFFFFF}]" );*/
							    format(zin, 60, "Speed: %f | Dist: %f", AC_fSpeed, AC_traveledDistance);
							    SendClientMessageToAll  ( 0xFFFFFFFF, zin );
							    //Kick				  ( playerid );
						    }
					    }
				    }
				    else GetPlayerPos(playerid, AC_oldPos[playerid][0], AC_oldPos[playerid][1], AC_oldPos[playerid][2]);
			    }
		    }
		    else CanCheckAirBreak[playerid] = false;
		    AC_oldPlayerState[playerid] = AC_playerState;
	    }
    }
   }
   else
   {
    if(AC_oldPos[playerid][0] != 0.0) AC_AirBreakReset(playerid);
   }
   return true;
}

stock AC_SetPlayerPos( playerid, Float:pPosX, Float:pPosY, Float:pPosZ )
{
   CanCheckABX   [ playerid ] = false;
   CanCheckAirBreak[ playerid ] = false;
   NeedCheckTuningAB [ playerid ] = 5;
   SetPlayerPos( playerid, pPosX, pPosY, pPosZ );
   CanCheckABX	 [ playerid ] = true;
}

stock AC_PutPlayerInVehicle( playerid, pvehicleid, pseatid )
{
   CanCheckABX   [ playerid ] = false;
   CanCheckAirBreak[ playerid ] = false;
   NeedCheckTuningAB [ playerid ] = 5;
   PutPlayerInVehicle( playerid, pvehicleid, pseatid );
   CanCheckABX   [ playerid ] = true;
}

stock AC_AirBreakReset( playerid )
{
   AC_oldPos[playerid][0] = 0.0;
   AC_oldPos[playerid][1] = 0.0;
   AC_oldPos[playerid][2] = 0.0;
}

+ Filescriptas(anticheatas) http://forum.sa-mp.com/showthread.php?t=335007

Siūlyčiau susikurti paprasta fs, kaip pavydžiui per CS yra nenaudoti cheat keys, jeigu paspaudžia kažka ant klaviaturos, tai kad įjungia cheat'ą jį iškart išmetinėtu iš serverio ( kick geriausia nes kaikurie netyčia paspaudžia )

Jis perka o ne ieško ir nesiklauso nesamonų kaip tu jis perka supranti žodį perka? jam neįdomu ka tu siūlai jis nori pirkti supranti? nerink bereikalingų postų.

On 2013-10-31 19:21 Lukas™ rašė:

> ?

On 2013-10-31 19:21 M.Golden rašė:

> Del anti sobo

On 2013-10-31 19:21 Lukas™ rašė:

> aisku

On 2013-10-31 19:21 Lukas™ rašė:

> tai as turiu

On 2013-10-31 19:21 M.Golden rašė:

> Kuo his panasus?

On 2013-10-31 19:21 M.Golden rašė:

> Jis

On 2013-10-31 19:22 Lukas™ rašė:

> Viskas yra taspats , tik kalba yra anglu

On 2013-10-31 19:22 M.Golden rašė:

> Pirmas eini?

On 2013-10-31 19:22 M.Golden rašė:

> Payikimumo citatu rodyt? Daug yra:D

On 2013-10-31 19:22 M.Golden rašė:

> Patikimumo

On 2013-10-31 19:22 Lukas™ rašė:

> Reputacijos forume turiu, visur reputacijos turiu tai pirmas zinok neisiu. :)

On 2013-10-31 19:23 M.Golden rašė:

> Tos rep gali pats prisimetyt

On 2013-10-31 19:23 Lukas™ rašė:

> eik pirmas

On 2013-10-31 19:23 M.Golden rašė:

> Nufilmuok

On 2013-10-31 19:23 Lukas™ rašė:

> neapgausiu

On 2013-10-31 19:23 M.Golden rašė:

> Tada maybe

On 2013-10-31 19:23 Lukas™ rašė:

> neturiu kur ka

On 2013-10-31 19:23 Lukas™ rašė:

> hosto neturiu

On 2013-10-31 19:23 Lukas™ rašė:

> bet neapgausiu

On 2013-10-31 19:23 Lukas™ rašė:

> + savininkas csfan.lt

On 2013-10-31 19:23 M.Golden rašė:

> Per local hosta

On 2013-10-31 19:24 Lukas™ rašė:

> supranti nesiterliosiu kaip mazas vaikas

On 2013-10-31 19:24 Lukas™ rašė:

> perki neperki , trumpai aiskiai

On 2013-10-31 19:24 M.Golden rašė:

> Aiskus.

On 2013-10-31 19:24 M.Golden rašė:

> Dw.

  • Teigiamai 1
b5572e1d11358d202657c196d1293e0928.gif

Ši tema yra neaktyvi. Paskutinis pranešimas šioje temoje buvo prieš 4263 dienas (-ų). Patariame sukurti naują temą, o ne rašyti naują pranešimą.

Už neaktyvių temų prikėlimą galite sulaukti įspėjimo ir pranešimo pašalinimo!

Svečias
Ši tema yra užrakinta.
  • Šiame puslapyje naršo:   0 nariai

    • Nėra registruotų narių peržiūrinčių šį forumą.

Skelbimai



×
×
  • Sukurti naują...