Script To Replaces Spaces With _ ?

Discussion in 'Spearhead' started by loeri, May 6, 2012.

  1. loeri loeri.tk

    Contributions:
    45
    Specialties:
    Mapper, Scripting, Programming, Support
    Processing:
    Graphics:
    PREMIUM
    I Donated
    Is there any script to replace a space with a underscore ( _ ) ?
    As some scanner wont scan a player because he has a space in his name..

    I know foresight does this, but i dont want to use foresight it gives too much problems
  2. Silent*Angel Corporal

    Contributions:
    6
    Specialties:
    Scripting, Programming
    Processing:
    Graphics:
    In Spearhead you can't because you cannot access netname via script..you have to use a scanner that do this automatically. Or maybe you can decide to make a script that change player name and use it as a command where you imput player number and the new name. But this will only be manually...so totally useless :) srry m8
    Not sure but in BT I think you can use $player[local.i].netname to get his name and this make this task possible. BUT not sure of this because never used BT :)
    If you are having problems with dumpuser rcon command you may think to install Daven's patch that has a new command "dumpclient" followed by slot number. However this is useless if you are having problems with players scanners like AI or others that do not support dumpclient and don't have a automatic replace for " " to "_"
  3. ordever Corporal

    Contributions:
    72
    Specialties:
    Mapper, Scripting, Pure Gamer, Support
    Processing:
    Graphics:
    Try with Delator scanner You will not have a problem with that, dumpclient will work and Delator will replace spaces with _ for scanning them. Much better and you will not have those problem with it like with foresight. Just unpack it it's not need to install it start RconDelator.exe make a setup like rconpasss max ping or other and try it. also with ModDelator.exe when you open it you must setup what you want to stopped like cheats than on the end it will create for you In Generated mod folder a file colled zzzzz-delator.pk3 put it on the server and than start scanner. If you need help ask.

    Attached Files:

    zlatko likes this.
  4. LeBabouin Papio anubis

    Contributions:
    419
    Specialties:
    Scripting
    Processing:
    Graphics:
    PREMIUM
    I Donated
    Indeed you can, using Daven's patch ;)
    zlatko and Silent*Angel like this.
  5. ordever Corporal

    Contributions:
    72
    Specialties:
    Mapper, Scripting, Pure Gamer, Support
    Processing:
    Graphics:
    Yea LeBabouin You have right Davens patch will do that but most of the providers close exe files for changing and than Davens patch cant be installed.
    If you have that problem give a try to Delator if not take a Davens patch and don't worry.
  6. loeri loeri.tk

    Contributions:
    45
    Specialties:
    Mapper, Scripting, Programming, Support
    Processing:
    Graphics:
    PREMIUM
    I Donated
    So how would i start with it? :confused:
    We applied davens fixes, had to ask the host
  7. ordever Corporal

    Contributions:
    72
    Specialties:
    Mapper, Scripting, Pure Gamer, Support
    Processing:
    Graphics:
    If You can't delete moh_spearhead_server.exe file from Your server than you must ask provider to do that for you if they want.
    When I try with my provider they didn't want to do that for me.
  8. green54321 Corporal

    Contributions:
    62
    Specialties:
    Support
    Processing:
    Graphics:
    if u not have access for files .exe and .dll in server sometimes helpfully is FTP program.
  9. ordever Corporal

    Contributions:
    72
    Specialties:
    Mapper, Scripting, Pure Gamer, Support
    Processing:
    Graphics:
    If you don't have acces on it than FTP programs like FileZila or.. will not help You they will stay locked and can't be changed.
  10. loeri loeri.tk

    Contributions:
    45
    Specialties:
    Mapper, Scripting, Programming, Support
    Processing:
    Graphics:
    PREMIUM
    I Donated
    Yeah they didnt wanted to give us acces to it as u could upload a .exe with a virus in it so they putted it in tcadmin as update pack and we updated it some days ago.
  11. Sor Who made who?

    Contributions:
    93
    Specialties:
    Scripting, Pure Gamer, Support
    Processing:
    Graphics:
    PREMIUM
    I Donated
    If you have daven's patch applied and you got your name that you want to convert, then use the attached script and place it in global/ folder. Then simple do:
    Code:
    local.newstring = waitthread global/strings.scr::replace local.playername " " "_"
    local.player stufftext ("set name " + local.newstring)
    
    If not, keeping asking your provider, they're probably just scared that whatever you want to do might cause problems you could sue them for or something similar

    Attached Files:

    loeri likes this.
  12. Silent*Angel Corporal

    Contributions:
    6
    Specialties:
    Scripting, Programming
    Processing:
    Graphics:
    :) upsss that's a good new for me!! this is awesome!!!
  13. loeri loeri.tk

    Contributions:
    45
    Specialties:
    Mapper, Scripting, Programming, Support
    Processing:
    Graphics:
    PREMIUM
    I Donated
    Thanks Sor will test it now!

    EDIT: It seems not to work i use this:
    And the daven fixes i have is: SH Server fixes (09-08-10)

    Code:
    main:
    thread name
    end
     
    name:
     
    while(1) {
       
        for(local.i=1; local.i<=$player.size; local.i++)
        {
     
    local.newstring = waitthread global/strings.scr::replace local.playername " " "_"
    local.player stufftext ("set name " + local.newstring)
        }
        wait 20
        thread name
     
    end
  14. Sor Who made who?

    Contributions:
    93
    Specialties:
    Scripting, Pure Gamer, Support
    Processing:
    Graphics:
    PREMIUM
    I Donated
    You have to obtain the player's name first. I just used 'local.playername' as reference. I think daven made netname work the same way it does in BT..
  15. green54321 Corporal

    Contributions:
    62
    Specialties:
    Support
    Processing:
    Graphics:
    i trying do this and only big problem with get name from player, i try getcvar name but it take name from server cfgs (not from player cfgs) :/
    about scaner Counter Intelligence have change "" to "_".
  16. green54321 Corporal

    Contributions:
    62
    Specialties:
    Support
    Processing:
    Graphics:
    ehhh now i take name from player but only this "player". Real name is different so it bad work but its more what i make:D maybe someone add some fix :D

    Code:
    main:
    thread name
    end
     
    name:
     
    //while(1) {
    
        for(local.i=1; local.i<=$player.size; local.i++)
        {
    
    level.name = ($player[local.i] + (getcvar(ui_name)))
    local.fixname = level.name
    local.newstring = waitexec global/strings.scr::Replace local.fixname " " "_"    //local.newstring = waitthread global/strings.scr::replace local.playername " " "_"
    wait 2
    $player[local.i] stufftext ("set name " + local.newstring)    //local.player stufftext ("set name " + local.newstring)
        wait 2
    if(local.player == NULL)
    {
    $player[local.i] iprint ("Splayer OldNAME: " + local.fixname) 1
    //$player[local.i] iprint ("local netname: " + local.netname) 1
    //$player[local.i] iprint ("local playername: " + local.playername) 1
    $player[local.i] iprint ("local newstring(NEWNAME): " + local.newstring) 1
    }
    }
    if (local.newstring == NIL)
    {
    println "++++++++++++++++++++++ NEW NAME NIL :/ "    
    }
        //}
      wait 20
        thread name
         
    end
  17. Sor Who made who?

    Contributions:
    93
    Specialties:
    Scripting, Pure Gamer, Support
    Processing:
    Graphics:
    PREMIUM
    I Donated
    Without daven's patch for SH or Reborn patch for AA, you cannot obtain a random player's name. Just your own. All the cvars you check are your own settings.
  18. green54321 Corporal

    Contributions:
    62
    Specialties:
    Support
    Processing:
    Graphics:
    OK, thank You, so we must waiting for patch/reborn for SH
  19. green54321 Corporal

    Contributions:
    62
    Specialties:
    Support
    Processing:
    Graphics:
    Hello I fix this problem :D
    local.name = waitthread get_player_name local.player

    Code:
    get_player_name local.player:
        if (local.player == NIL || local.player == NULL)
        {
            end
        }
     
        if (local.player.netname != NIL)
        {
            if (local.player.netname != "")
            {
                end local.player.netname
            } else
            {
                end
            }
        }
     
    end
  20. green54321 Corporal

    Contributions:
    62
    Specialties:
    Support
    Processing:
    Graphics:
    and Answer for Thread is:
    local.name = waitthread get_player_name local.player
    local.string = waitexec global/strings.scr::Replace local.name " " "_"
    $player stufftext ("name " + local.string)
    loeri likes this.

Share This Page