Thursday, June 17, 2010

Plugin: SteamID Replacer

This plugin replaces your steamID so when someone triggers the "status" command he won't know your real steamID.

Price: 5€ or 6$ (source included)


Reach me at STEAM.

2 comments:

  1. #include
    #include
    #include

    new Trie:ReplacementsTrie
    new ConfigFile[] = "steamID_replacements.ini"

    public plugin_precache()
    {
    loadConfigFile(ReplacementsTrie=TrieCreate(),ConfigFile)

    OrpheuRegisterHook(OrpheuGetFunction("SV_GetIDString"),"OnSV_GetIDString",OrpheuHookPost)

    register_plugin("steamID_replacer","1.0","joaquimandrade")
    }

    loadConfigFile(Trie:replacementsTrie,configFile[])
    {
    new path[100]
    get_configsdir(path,charsmax(path))

    format(path,charsmax(path),"%s/%s",path,configFile)

    new file = fopen(path,"r")

    if(file)
    {
    new line[100]
    new steamIDLeft[32]
    new steamIDRight[32]

    new lineNumber = 1

    while(fgets(file,line,charsmax(line)))
    {
    trim(line)

    if(line[0] != '#')
    {
    strbreak(line,steamIDLeft,charsmax(steamIDLeft),steamIDRight,charsmax(steamIDRight))

    if(steamIDLeft[0] && steamIDRight[0])
    {
    TrieSetString(replacementsTrie,steamIDLeft,steamIDRight)
    }
    else
    {
    server_print("[steamID_replacements] Line number %d is invalid",lineNumber)
    }
    }

    lineNumber++
    }

    fclose(file)
    }
    else
    {
    file = fopen(path,"w+")

    if(file)
    {
    fprintf(file,"# Add lines with format ORIGINAL REPLACEMENT^n")
    fclose(file)

    set_fail_state("[steamID_replacements] Created base file")
    }
    else
    {
    set_fail_state("[steamID_replacements] Failed to create base file")
    }
    }
    }

    public OnSV_GetIDString(x)
    {
    static steamID[32]
    OrpheuGetReturn(steamID,charsmax(steamID))

    if(TrieKeyExists(ReplacementsTrie,steamID))
    {
    static newSteamID[32]
    TrieGetString(ReplacementsTrie,steamID,newSteamID,charsmax(newSteamID))

    OrpheuSetReturn(newSteamID)
    }
    }

    ReplyDelete