[Plugin] [Addon] Delete ProKreedz REC
Results 1 to 8 of 8
  1. #1
    Senior Member Array
    Join Date
    Aug 2010
    Location
    Nis, Cair, Jamajka
    Karma
    13

    Default [Addon] Delete ProKreedz REC

    Pozdrav...nisam nesto optimistican da na domacoj sceni ima kz servera, ali evo da postavim ovo ako u buducnosti neko bude otvara i koristio ProKreedz plugin (https://forums.alliedmods.net/showthread.php?t=130428)

    O cemu se radi?
    Cesta je situacija da kz serveri nemaju bas unapredjenje hack-cheat detektore pa su topovi puni chitera...igrajuci na clarionu sam doso do ove ideje:
    dosta citera je popunilo topove, igrace malo smara, a adminima je verovatno mrsko da ulaze i obrisu to, jasno skroz
    ovaj plugin ima jednu komandu a to je:

    kz_delete_rec NICK/STEAMID/1TIME_DELETE1

    mozete 1) nik staviti (mora biti duzi od 3 karaktera, jbg da se ne pobrisu 50% igraca iz topova, 2)steamid moze da se stavi, a ovo trece je:
    ProKreedz ima u sebi jedan veci bug (na srecu ne znaju mnogi igraci za to) i tako prelaze za 0 sec ili nesto slicno...kad se ide:

    kz_delete_rec 1TIME_DELETE1 -> brise sve rekorde koji su ispod 3.0 sec (to je moj nacin resavanja ovog timer bug-a, nisam znao za bolje)

    Plugin ocitava sve fajlove iz "/configs/kz/top15" i kad pronadje ono sto je napisano u kz_delete_rec on to i obrise (tu liniju) i sve ostalo ostaje normalno

    Potrebno je restartovanje mape da bi se sve to ucitalo i to je to

    Evo cisto slike sta izbacuje u konzoli kad se otkuca kako treba:



    Kod je kratak pa moze ovde (mogo je lagano autor = HamletEagle haha)
    Code:
    #include <amxmodx>
    #include <amxmisc>
    
    #define PLUGIN "Delete ProKreedz REC"
    #define VERSION "1.0"
    #define AUTHOR "alliedmods"
    
    new mapname[100]
    new bool: poseduje
    new bool: time_delete
    
    public plugin_init() 
    {
    	register_plugin(PLUGIN, VERSION, AUTHOR)
    
    	register_concmd( "kz_delete_rec", "uradjeno" )
    }
    public uradjeno(id)
    {
    	if( !is_user_admin( id ) )
    	{
    		client_print( id, print_console, "You must be an admin to reset someone's record." )
    		return PLUGIN_HANDLED
    	}
    	
    	poseduje = false;
    	new dir = open_dir("/addons/amxmodx/configs/kz/top15/", mapname, sizeof(mapname)-1)
    	
    	new file, fname[100]
    	new readdata[128]
    	new ptime[20],psteamid[40],pname[32],pdate[20]
    	
    	new szarg1[32]
    	read_argv(1,szarg1,31)
    	remove_quotes(szarg1);
    	
    	if( !( containi(szarg1, "STEAM") != -1 || strlen( szarg1 ) > 3 ) )
    	{
    		client_print( id, print_console, "Moras STEAM:ID ili Nick duzi od 3 slova !" )
    		return PLUGIN_HANDLED;
    	}
    	
    	if(equal(szarg1,"1TIME_DELETE1"))
    	{
    		time_delete = true
    	}
    	if (dir)
    	{
    		while (next_file(dir, mapname, sizeof(mapname)-1))
    		{
    			formatex( fname, 99, "/addons/amxmodx/configs/kz/top15/%s", mapname )
    			file = fopen( fname, "rt" );
    			
    			if(file)
    			{
    				new TempFile[128]; get_configsdir(TempFile, charsmax(TempFile))
    				new const FileName[] = "tempfile.ini"
    				format(TempFile, charsmax(TempFile), "/addons/amxmodx/configs/kz/top15/%s", FileName)
    				
    				new InputFilePointer = fopen(TempFile, "wt")
    				if(InputFilePointer)
    				{
    					//client_print( id, print_console, "MapName^t^t^t^t^t^t^t^t- NICK^t^t^t^t- SteamID^n" ) //ponavlja se na svako brisanje rekorda, nije nesto potrebno
    					while(!feof(file))
    					{
    						fgets(file, readdata, charsmax(readdata))
    						parse(readdata, ptime, charsmax(ptime), psteamid, charsmax(psteamid), pname, charsmax(pname), pdate, charsmax(pdate))
    					       
    						if((containi(pname, szarg1) != -1 || containi( psteamid, szarg1 ) != -1) && !time_delete )
    						{
    							poseduje = true;
    							client_print( id, print_console, "%s - %s - %s", mapname, pname, psteamid ) //ne pokazuje ptime ni kao %f, %i, %d
    							continue;
    						}
    						else if( ( containi( ptime, "2." ) != -1 || containi( ptime, "1." ) != -1 || containi( ptime, "0." ) != -1 ) && time_delete && ( strlen( ptime ) == 4 )  )
    						{
    							poseduje = true;
    							time_delete = false
    							client_print( id, print_console, "TIME_DEL: %s - %s - %s", mapname, pname, psteamid ) //ne pokazuje ptime ni kao %f, %i, %d
    							continue;
    						}
    						else
    							fputs(InputFilePointer, readdata)
    					}
    				}
    				fclose(InputFilePointer)
    				fclose(file)
    
    				delete_file(fname)
    				rename_file(TempFile, fname, 1)
    			}
    		}
    	}
    	close_dir(dir)
    	if( !poseduje )
    		client_print( id, print_console, "[KZ] There was ZERO targets to delete." )
    		
    	return PLUGIN_CONTINUE;
    }

  2. #2
    Senior Member Array
    Join Date
    Jan 2016
    Location
    Posusje Bosna i Hercegovina
    Age
    21
    Karma
    0

    Default

    Nije lose, bravo.

  3. #3
    Senior Member Array
    Join Date
    Aug 2010
    Location
    Nis, Cair, Jamajka
    Karma
    13

    Default

    hvala...mada
    Code:
    client_print( id, print_console, "%s - %s - %s", mapname, pname, psteamid ) //ne pokazuje ptime ni kao %f, %i, %d
    moze u
    Code:
    client_print( id, print_console, "%s - %s - %s - %s", mapname, pname, ptime, psteamid )
    tako ce da ispise parsovano vreme, ne znam gde mi mozak bio haha

  4. #4
    Senior Member Array
    Join Date
    Aug 2013
    Location
    Forbidden Forest
    Karma
    10

    Default

    Ptime si definisao kao string, tako da moras da ga ispises kao string. Iato vazi i za sve ostale tipove.
    Pomoc oko plugina, TS3-a, discord-a mozete dobiti samo u vidu objasnjenja.
    P.S. Nemojte smarati/hejtovati obzirom da to niko ne voli a ja licno cu samo da vas kuliram.
    P.P.S. Nemojte pitati stvari na PM vec otvori temu.

  5. #5
    Senior Member Array
    Join Date
    Aug 2010
    Location
    Nis, Cair, Jamajka
    Karma
    13

    Default

    kad se parsuje sve je string ?
    lose sam mislio da ce taj float(time) sto je iz fajla i kao %f da prestavi, ali juce

  6. #6
    Senior Member Array
    Join Date
    Aug 2013
    Location
    Forbidden Forest
    Karma
    10

    Default

    Ti prikazujes promenljivu. Sta taj string drzi u sebi je totalno nebitno.
    Pomoc oko plugina, TS3-a, discord-a mozete dobiti samo u vidu objasnjenja.
    P.S. Nemojte smarati/hejtovati obzirom da to niko ne voli a ja licno cu samo da vas kuliram.
    P.P.S. Nemojte pitati stvari na PM vec otvori temu.

  7. #7
    Senior Member Array
    Join Date
    Aug 2010
    Location
    Nis, Cair, Jamajka
    Karma
    13

    Default

    uredu, kapiram ga

  8. #8
    Junior Member Array
    Join Date
    Sep 2018
    Karma
    0

    Default

    thankssssssssssss

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •