Results 1 to 3 of 3

Thread: PrecacheString (Small GameState Resource)

  1. #1
    Sergeant maxdamage99's Avatar
    Join Date
    Aug 2014
    Location
    Russia
    Posts
    458
    Thanks
    79
    Thanked 122 Times in 101 Posts

    PrecacheString (Small GameState Resource)

    Your main script file. (gametype.gsc: tdm.gsc,dm.gsc,zom.gsc etc.)
    PHP Code:
    main()
    {
    thread script\_precache::init();

    /* other script&function */


    printf("[PRECACHE SYSTEM]\n");
    printf("FakeStringsPrecache = "+level.precachestrings.size+"/"+script\_precache::FINDSTRS().size+"\n");
    //FakeStringsPrecache = Your_CrackPrecachesCount/Max_CrackPrecaches (51)
    printf("[/PRECACHE SYSTEM]\n");
    }

    CodeCallBack_PlayerConnect() //if you no rename standart function
    {
    /* ... */
      
    self waittill("begin");
      
    level notify("connected"self);
    self scripts\_precache::FakePrecacheStanding();
    //wait 2-4 secs (or make self waittill() and event self notify() on ending function FakePreacacheStanding()
    /* .... */

    Console (terminal) says:
    Code:
    ------- Game Initialization -------
    gamename: Call of Duty 2
    gamedate: Oct 24 2005
    -----------------------------------
    [PRECACHE SYSTEM]
    FakeStringsPrecache = 36/51
    [/PRECACHE SYSTEM]
    =>> precache.gsc:
    PHP Code:
    //////////////////////////////////////
    ///   Scripted By DamaGe       ///
    ///     Skype: max-damage3   ///
    ///   Maked: 25.09.2016         ///
    ///   Make for nL.Zombies*    ///
    /////////////////////////////////////

    init()
    {
            
    //level.chatcontrol[0]="^4`^9nL^4.^7Zombies^6*";
        //level.chatcontrol[1]="^9nL^4.^2[^7Anti-Cheat^2]";
        
              
    level.precachestrings=[];
          
    level.precachechars=[];
        
         
    thread PrecacheStrings();
    }
    PrecacheStrings()
    {
    /*EXAMPLE*/
             
    CrackPrecacheString("^7R^9ank^4: ^7");
         
    CrackPrecacheString("^7Ne^9xt ^7In^4: ^7");
         
    CrackPrecacheString("^7Hun^9ters Killed^4: ^7");  //WITHOUT &"STRING"
         
    CrackPrecacheString("^7Kill^9Streak^4: ^7");
         
    CrackPrecacheString("^7Death^9Streak^4: ^7");
         
    CrackPrecacheString("^4/^74");
             
    CrackPrecacheString("Andrzej disconnected!");
    }

    //////////////
    FakePrecacheStanding()
    {
        
    cmdcount=0;
        
    cmdlimit=10//limit player command by Voron
    for(i=0;i<level.precachechars.size;i++)
    {
    index G_FindConfigstringIndex(level.precachechars[i], 1310256);
    if(!
    index)
    {
    printf("ERROR FakePrecacheStanding()\n");
    printf("Bad index PRECACHE_CHAR, CHAR ="+level.precachechars[i]+"\n");
    continue;
    }
    else
    {
    sendGameServerCommand(self getEntityNumber(), "d " index " " level.precachestrings[i][level.precachechars[i]]);
    cmdcount++;
    if (
    cmdcount >= cmdlimit)
    {
    wait 0.05;
    cmdcount 0;
    }
    }
    }
    }
    ////////////
    FINDSTRS()
    {
        
    STR=[];
        
    //english alphavite
        
    STR[STR.size]=&"a";STR[STR.size]=&"b";STR[STR.size]=&"c";STR[STR.size]=&"d";STR[STR.size]=&"e";
        
    STR[STR.size]=&"f";STR[STR.size]=&"g";STR[STR.size]=&"h";STR[STR.size]=&"i";STR[STR.size]=&"j";
        
    STR[STR.size]=&"k";STR[STR.size]=&"l";STR[STR.size]=&"m";STR[STR.size]=&"n";STR[STR.size]=&"o";
        
    STR[STR.size]=&"p";STR[STR.size]=&"q";STR[STR.size]=&"r";STR[STR.size]=&"s";STR[STR.size]=&"t";
        
    STR[STR.size]=&"u";STR[STR.size]=&"v";STR[STR.size]=&"w";STR[STR.size]=&"x";STR[STR.size]=&"y";
        
    STR[STR.size]=&"z"//you can add UP symbols (A,B,C,D...)
        //ciferki&SYMBOLS
        
    STR[STR.size]=&"0";STR[STR.size]=&"1";STR[STR.size]=&"2";STR[STR.size]=&"3";STR[STR.size]=&"4";STR[STR.size]=&"5";
        
    STR[STR.size]=&"6";STR[STR.size]=&"7";STR[STR.size]=&"8";STR[STR.size]=&"9";STR[STR.size]=&"!";STR[STR.size]=&"@";
        
    STR[STR.size]=&"#";STR[STR.size]=&"$";STR[STR.size]=&".";STR[STR.size]=&",";STR[STR.size]=&"^";STR[STR.size]=&"*";
        
    STR[STR.size]=&"(";STR[STR.size]=&")";STR[STR.size]=&"№";STR[STR.size]=&";";STR[STR.size]=&":";STR[STR.size]=&"_";
        
    STR[STR.size]=&"-";
        return 
    STR;
    }
    /////////////
    findlowchar(s)
    {
    //"abcdefghijklmnopqrstuvwxyz0123456789!@#$.,^*()№;:_-"
    STR=[];
    STR=FINDSTRS();
    if(
    s<STR.size)
    return 
    STR[s];
    else
    {
    fakelow=STR[randomint(STR.size)-1]+"FS";
    printf("ERROR FindLowChar() S=["+s+"] Gived=["+fakelow+"]\n");
    return 
    fakelow;
    }
    }
    symtochar(p)
    {
    stroka="abcdefghijklmnopqrstuvwxyz0123456789!@#$.,^*()№;:_-";
        return 
    stroka[p];
    }
    CrackPrecacheString(string) //PrecacheString = CrackPrecacheString
    {
        
    number=level.precachestrings.size;
        
    pidr findlowchar(number);                             // &"CHAR"
        
    pidr2 symtochar(number);                            // "CHAR"
        
    level.precachestrings[number][pidr2]=string;
        
    level.precachechars[number]=pidr2;
        
    level.precachestrch[string]=pidr;
        
    precacheString(pidr);
    }
    FindOriginalStringChar(string) //label
    {
        if(
    isDefined(level.precachestrch[string]))    
        {
                      
    self.label=level.precachestrch[string];    
              return;
        }
    }
    FindOriginalTextChar(string) //settext
    {
        if(
    isDefined(level.precachestrch[string]))    
        {
                  
    self settext(level.precachestrch[string]);    
                  return;
        }

    =>> CreateHuds:
    PHP Code:
    self.hud destroy(); 
    self.hud newClientHudElem(self); 
    self.hud.alpha 2
    self.hud.275
    self.hud.17
    self.hud FindOriginalStringChar("^7R^9ank^4: ^7"); //.label - WITHOUT &
    self.hud.fontscale 1.2
    ////////////////////////
    self.infotext destroy(); 
    self.infotext newClientHudElem(self); 
    self.infotext.alpha 2
    self.infotext.275
    self.infotext.17
    self.infotext FindOriginalTextChar("Andrzej disconnected!"); //settext() - WITHOUT &
    self.infotext.fontscale 1.2
    Precache old method (PrecacheString): 30-40 huds = +1000(+-350) gamestate points.
    CrackPrecache: 30-40 huds = +200-300(+-100) gamestate points.

    Maximum CrackPrecacheHuds: 51 (51 symbols) If you find new symbol (1 char) - is good

    You can make preaches from DataBase Values.
    Last edited by maxdamage99; 28th September 2016 at 11:02.
    PHP Code:
    class CoronaVirus 
    {
       
    CoronaVirus(int m 1): multi(m) { Peoples.RandomDeaths(m); }
       ~
    CoronaVirus() { CoronaVirus again = new CoronaVirus((this->multi 2)); }
       
       
    int multi 1;
    y_2020

  2. #2
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    3 things: 1.: Please make those sendgameservercommands reliable by adding a ,1 to the sendgameservercommand-command.
    2.: That disconnected message should have a &&1 in it with a setplayernamestring() on top of it (why isnt & in the list of allowed chars?)
    3.: You shouldnt limit it by a hard 10, just check the current queuedreliableservercommands for that client. Once that goes over 64, all unreliable commands (see point 1) get dropped. Once that gets over 128, client crashes with servercommandoverflow error. Try to keep that number below 16 and you'll be good.
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  3. #3
    Sergeant maxdamage99's Avatar
    Join Date
    Aug 2014
    Location
    Russia
    Posts
    458
    Thanks
    79
    Thanked 122 Times in 101 Posts
    i no understand your english

    P.S: Without sendgameservercommand, can use set_configstring (by Voron)
    https://github.com/voron00/libcod/bl...tils.cpp#L1017
    Last edited by maxdamage99; 28th September 2016 at 11:53.
    PHP Code:
    class CoronaVirus 
    {
       
    CoronaVirus(int m 1): multi(m) { Peoples.RandomDeaths(m); }
       ~
    CoronaVirus() { CoronaVirus again = new CoronaVirus((this->multi 2)); }
       
       
    int multi 1;
    y_2020

  4. The Following User Says Thank You to maxdamage99 For This Useful Post:

    kubislav23 (29th September 2016)

Posting Permissions

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