File "/home/css/jb/cstrike/addons/eventscripts/gungame/custom_addons/gg_gg4_convert/gg_gg4_convert.py", line 61, in convert
for steamid in gg4c_db[steamid]:
UnboundLocalError: local variable 'steamid' referenced before assignment
Currently I'm stuck! My Problem is the following:
I open the old database with:
es.sql('open', 'gg_database', '|gungame4/db')
So far, so good. Now I'm getting all the data of the gg_players table:
es.sql('query', 'gg_database', 'gg4c_db', 'SELECT * FROM gg_players')
Also no error, still looks good for me. Now I close the database:
es.sql('close', 'gg_database')
First part is done. Now I want to get each player of the database-data and import it in the GG5 dict_winners-array.
I tried it like the following:
for steamid in gg4c_db[steamid]:
dict_winners[steamid]['name'] = gg4c_db[name]
dict_winners[steamid]['wins'] = gg4c_db[wins]
dict_winners[steamid]['name'] = gg4c_db[name]
dict_winners[steamid]['wins'] = gg4c_db[wins]
Here the errors start.
There is a error with gg4c_db[steamid].
In this moment I asked myself an important question: If I get the complete data out of the database, how is it safed in the keygroup?
After this question, I asked me another: I said Keygroup... do I work the same way with a keygroup like with an array? Hmm, lets ask the ESP-Wiki.
So I searched for keygroup, but all I got was a reference to the ESS-Wiki which didn't helped me.
Maybe you can help me?
Best Regards, PitBull