Anti-CBUG

Započeo pLp, Februar 02, 2019, 17:17:31 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

pLp

*

Problem(error/warning): Potreban mi je onaj AntiCBug koji daje 3 opomene, nakon 3 opomene kikuje sa servera..
Dio skripte: [ pawn ]//[ /pawn ]
Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log): [ code ]//([ /code ]
Slika/video ingame problema(obavezno ako je ingame problem): //


pLp

*

Ne taj, trazim onaj koji daje opomena, nakon trece opomene dobija kick sa servera..

Pa prilagodi sistem svojim zeljama :D
[pawn]public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
   new cBugCount[MAX_PLAYERS], str[128];
   if((oldkeys & KEY_FIRE) && (newkeys & KEY_CROUCH))
   {
       new weapon = GetPlayerWeapon(playerid);
       if(cBugCount[playerid] >= 3)
       {
           format(str, sizeof(str), "Igrac %s je kikovan sa zervera zbog C-Buga.", pIme(playerid));
           SendClientMessageToAll(-1, str);
           Kick(playerid);
       }
       if(weapon == 24)
      {
         cBugCount[playerid] ++;
         format(str, sizeof(str), "Ne radi C-BUG, upozorenja %d/3", cBugCount[playerid]);
         SendClientMessage(playerid, -1, str);
      }
   }
   return 1;
}[/pawn]

pLp

*

Tebra, mozes li mi sve sto trebam da ubacim staviti u pastebin, ako ti nije tesko, nisam ja bas neki skripter kako bi sve to razumio :D


pLp

*


OVO DODAS NA POCETAK SKRIPTE NEGDJE
[pawn]new CBugReport;[/pawn]
OVO STAVIS POD RESET PLAYER
[pawn]antiCheatCS[ playerid ][ CBugReport ] = 0;[/pawn]
OVO STAVIS POD OSTALE FORWARD-OVE
[pawn]forward __check( playerid );
public __check( playerid )
{
   if( GetPlayerSpecialAction( playerid ) == SPECIAL_ACTION_DUCK )
      return 1;

   antiCheatCS[ playerid ][ CBugReport ]++;

   if( antiCheatCS[ playerid ][ CBugReport ] >= 3 ) {
      format( globalstring, sizeof( globalstring ), "[ANTICHEAT]"col_white" %s je kickovan sa servera. Razlog: "col_white"C-Bug", ImeIgraca( playerid ) );
      AdminPoruka( ANTICHEAT, globalstring );
      Kickovanje( playerid, ""col_white"Ti si kickovan sa servera. Razlog: "col_server"C-Bug");
      return 0;
   }

   GameTextForPlayer( playerid, "~r~Prestani da radis C-Bug!", 1000, 3 );

   antiCheatCS[ playerid ][ LastWShot ] = -1;

   return 1;
}[/pawn]
OVO STAVIS POD ONPLAYERKEYSTATECHANGE, UKOLIKO IMAS VEC STAVLJEN ONPLAYERKEYSTATCHANE ONDA STAVIS OD OVOG IF
[pawn]public OnPlayerKeyStateChange( playerid, newkeys, oldkeys ) {

if( !IsPlayerInAnyVehicle( playerid ) && IsCbugWeapon( playerid ) && ( ( tickcount( ) - antiCheatCS[ playerid ][ LastWShot ] ) < 750 ) ) {
      if( HOLDING( KEY_JUMP | KEY_SPRINT | KEY_CROUCH ) ) {

         antiCheatCS[ playerid ][ CBugReport ]++;

         GameTextForPlayer( playerid, "~r~Prestani da radis C-Bug!", 1000, 3 );

         antiCheatCS[ playerid ][ LastWShot ] = -1;

         if( antiCheatCS[ playerid ][ CBugReport ] >= 3 ) {
             format( globalstring, sizeof( globalstring ), "[ANTICHEAT]"col_white" %s je kickovan sa servera. Razlog: "col_white"C-Bug", ImeIgraca( playerid ) );
            AdminPoruka( ANTICHEAT, globalstring );
            Kickovanje( playerid, ""col_white"Ti si kickovan sa servera. Razlog: "col_server"C-Bug");
            return 0;
         }

         return 1;
      }
      if( newkeys & KEY_CROUCH ) {

         SetTimerEx( "__check", 200, false, "i", playerid );
      }
   }[/pawn]