Înlocuiți uniqueid din BOT

Tutoriale scripting, cod si portiuni de cod.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
mlibre
Membru, skill 0
Membru, skill 0
Posts: 1
Joined: 22 Dec 2015, 01:25
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Location: Northern South America
Contact:

22 Dec 2015, 01:36

Hei baieti, vreau să schimbe "uniqueid" de "BOT" la "VALVE_ID_PENDING" Am dat peste acest plugin pentru a obține o idee de cum se face, dar nu merge ... cineva să mă ajute să atinge scopul meu?

Code: Select all

#include <amxmodx>
#include <amxmisc>
#include <orpheu>
#include <hamsandwich>

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)
}
} 
steamID_replacements.ini

Code: Select all

# Add lines with format ORIGINAL REPLACEMENT
"BOT" "VALVE_ID_PENDING"
Acest bug a fost corectat:

Code: Select all

L 12/20/2015 - 11:56:02: Start of error session.
L 12/20/2015 - 11:56:02: Info (map "de_dust2") (file "addons/amxmodx/logs/error_20151220.log")
L 12/20/2015 - 11:56:02: [ORPHEU] Function "SV_GetIDString" not found
L 12/20/2015 - 11:56:02: [AMXX] Displaying debug trace (plugin "steamidreplacer.amxx")
L 12/20/2015 - 11:56:02: [AMXX] Run time error 10: native error (native "OrpheuGetFunction")
L 12/20/2015 - 11:56:02: [AMXX]    [0] steamidreplacer.sma::plugin_precache (line 57)
orpheu\functions\SV_GetIDString

Code: Select all

{
"name" : "SV_GetIDString",
"library" : "engine",
"arguments" : 
[
{
"type" : "pointer"
}
],
"return" : 
{
"type" : "char *"
},
"identifiers":
[
{
"os" : "windows",
"value" : [0x55,0x8B,"*",0x83,"*","*",0x8B,"*","*",0xC6]
},
{
"os" : "linux",
"value" : "SV_GetIDString"
}
]
}
Post Reply

Return to “Scripting”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 9 guests