Coins Ingame geben.

03/09/2012 21:14 '-SkyLiiNe-'#1
Hallo,

Ich habe mir die Questlib-Erweiterung von Mijago installiert und wollte nun über eine Quest Coins geben, als Belohnung.
Hier die MySQL Query:
Code:
mysql_query("UPDATE account.account,player.player SET account.coins = account.coins+1000 WHERE account.id = player.account_id AND player.name = \'"..pc.get_name().."\')
Leider funktioniert es nicht.

make.py Fehlermeldung:
Code:
Error occured on compile ingame_coins.quest
(Es muss an dieser Zeile liegen, da wenn ich sie auskommentiere kein Fehler auftritt)

Vielen Dank für Hilfen.
Gruß
'-SkyLiiNe-'
03/09/2012 22:10 Ocelot2606#2
PHP Code:
quest is_coins begin
    state start begin
        when 30252.
use begin
            say_title
("Coins auffüller")
            
say("Coins auffüllen?")
            
local s=select("Ja""Nein")
            if 
s==2 then return end
            
if pc.count_item(item.vnum)==0 then chat("CHEATER") return end
            local DB_USER 
"dein user"
            
local DB_PASS "dein mysql pw"
            
local WERT 5000
            local ID 
pc.get_account_id()
            
local QUERY "UPDATE account.account SET coins = coins + "..WERT.." WHERE id = "..ID..";"
            
os.execute("mysql --host=localhost --user="..DB_USER.." --password="..DB_PASS.." --execute='"..QUERY.."'")
            
pc.remove_item(item.vnum1)
        
end
    end
end 
local DB_USER und local DB_PASS anpassen
03/09/2012 22:19 '-SkyLiiNe-'#3
Vielen Dank!
funktioniert.
03/09/2012 22:22 Mijago#4
im mysql_query musst du \ immer 2x angeben, da der qc compiler es sonst rausnimmt.
dh
mysql_query("UPDATE account.account,player.player SET account.coins = account.coins+1000 WHERE account.id = player.account_id AND player.name = \\'"..pc.get_name().."\\'","root","PASSWORT")
03/09/2012 22:52 Night³#5
PHP Code:
quest is_coins begin
    state start begin
        when 30251.
use begin
            say_title
("Coins auffüller")
            
say("Coins auffüllen?")
            
local s=select("Ja""Nein")
            if 
s==2 then return end
            
if pc.count_item(item.vnum)==0 then chat("CHEATER") return end
            local DB_USER 
"root"
            
local DB_PASS "euer navicat pw"
            
local WERT 15000
            local ID 
pc.get_account_id()
            
local QUERY "UPDATE account.account SET coins = coins + "..WERT.." WHERE id = "..ID..";"
            
os.execute("mysql --host=localhost --user="..DB_USER.." --password="..DB_PASS.." --execute='"..QUERY.."'")
            
pc.remove_item(item.vnum1)
        
end
    end
end 

PHP Code:
quest is_coins begin
    state start begin
        when 30252.
use begin
            say_title
("Coins auffüller")
            
say("Coins auffüllen?")
            
local s=select("Ja""Nein")
            if 
s==2 then return end
            
if pc.count_item(item.vnum)==0 then chat("CHEATER") return end
            local DB_USER 
"root"
            
local DB_PASS "eire navicat pw"
            
local WERT 5000
            local ID 
pc.get_account_id()
            
local QUERY "UPDATE account.account SET coins = coins + "..WERT.." WHERE id = "..ID..";"
            
os.execute("mysql --host=localhost --user="..DB_USER.." --password="..DB_PASS.." --execute='"..QUERY.."'")
            
pc.remove_item(item.vnum1)
        
end
    end
end 
PHP Code:
quest is_coins begin
    state start begin
        when 30253.
use begin
            say_title
("Coins auffüller")
            
say("Coins auffüllen?")
            
local s=select("Ja""Nein")
            if 
s==2 then return end
            
if pc.count_item(item.vnum)==0 then chat("CHEATER") return end
            local DB_USER 
"root"
            
local DB_PASS "euer navicat pw"
            
local WERT 25000
            local ID 
pc.get_account_id()
            
local QUERY "UPDATE account.account SET coins = coins + "..WERT.." WHERE id = "..ID..";"
            
os.execute("mysql --host=localhost --user="..DB_USER.." --password="..DB_PASS.." --execute='"..QUERY.."'")
            
pc.remove_item(item.vnum1)
        
end
    end
end 
hoffe kan dir da mit helfen
03/09/2012 23:15 Ocelot2606#6
Quote:
Originally Posted by xgangsterx1 View Post
PHP Code:
quest is_coins begin
    state start begin
        when 30251.
use begin
            say_title
("Coins auffüller")
            
say("Coins auffüllen?")
            
local s=select("Ja""Nein")
            if 
s==2 then return end
            
if pc.count_item(item.vnum)==0 then chat("CHEATER") return end
            local DB_USER 
"root"
            
local DB_PASS "euer navicat pw"
            
local WERT 15000
            local ID 
pc.get_account_id()
            
local QUERY "UPDATE account.account SET coins = coins + "..WERT.." WHERE id = "..ID..";"
            
os.execute("mysql --host=localhost --user="..DB_USER.." --password="..DB_PASS.." --execute='"..QUERY.."'")
            
pc.remove_item(item.vnum1)
        
end
    end
end 

PHP Code:
quest is_coins begin
    state start begin
        when 30252.
use begin
            say_title
("Coins auffüller")
            
say("Coins auffüllen?")
            
local s=select("Ja""Nein")
            if 
s==2 then return end
            
if pc.count_item(item.vnum)==0 then chat("CHEATER") return end
            local DB_USER 
"root"
            
local DB_PASS "eire navicat pw"
            
local WERT 5000
            local ID 
pc.get_account_id()
            
local QUERY "UPDATE account.account SET coins = coins + "..WERT.." WHERE id = "..ID..";"
            
os.execute("mysql --host=localhost --user="..DB_USER.." --password="..DB_PASS.." --execute='"..QUERY.."'")
            
pc.remove_item(item.vnum1)
        
end
    end
end 
PHP Code:
quest is_coins begin
    state start begin
        when 30253.
use begin
            say_title
("Coins auffüller")
            
say("Coins auffüllen?")
            
local s=select("Ja""Nein")
            if 
s==2 then return end
            
if pc.count_item(item.vnum)==0 then chat("CHEATER") return end
            local DB_USER 
"root"
            
local DB_PASS "euer navicat pw"
            
local WERT 25000
            local ID 
pc.get_account_id()
            
local QUERY "UPDATE account.account SET coins = coins + "..WERT.." WHERE id = "..ID..";"
            
os.execute("mysql --host=localhost --user="..DB_USER.." --password="..DB_PASS.." --execute='"..QUERY.."'")
            
pc.remove_item(item.vnum1)
        
end
    end
end 
hoffe kan dir da mit helfen
Schön aus meinen Files kopieren und damit angeben? Fail xD

Der Einizige andere der das recht hat diese Posten ist mein ehmaliger Quester
03/09/2012 23:19 'oShet#7
Quote:
Originally Posted by Ocelot2606 View Post
Schön aus meinen Files kopieren und damit angeben? Fail xD

Der Einizige andere der das recht hat diese Posten ist mein ehmaliger Quester
Wo ist er denn am angeben? Vollidiot *facepalm* er wollte nur helfen...