Lua
-------Blitzer Globale Datenbank zusammen führung
handler = mysql_connect("XXXX","XXXX","XXXX",XXXX")
-------------------------GELD
function Blitzer_start_SF_GELD()
local sql = mysql_query(handler,"SELECT * FROM Blitzer_SF")
BlitzerGeld_SF = 0
if sql then
local Blitzer_SF = mysql_fetch_assoc(sql)
while(Blitzer_SF) do
local BlitzerGeldDStaat_SF = Blitzer_SF["Strafe"]
BlitzerGeld_SF = BlitzerGeld_SF + BlitzerGeldDStaat_SF
Blitzer_SF = mysql_fetch_assoc(sql)
end
mysql_free_result(sql)
outputServerLog("Es wurde "..BlitzerGeld_SF.." $ in Der Blitzer Datenbank von San Fierro gefunden!")
else
outputServerLog("[Blitzer_SF Error!] "..mysql_errno(handler).."[ "..mysql_error(handler).." ] ")
end
end
Blitzer_start_SF_GELD()
function Blitzer_start_LV_GELD()
local sql = mysql_query(handler,"SELECT * FROM Blitzer_LV")
BlitzerGeld_LV = 0
if sql then
local Blitzer_LV = mysql_fetch_assoc(sql)
while(Blitzer_LV) do
local BlitzerGeldDStaat_LV = Blitzer_LV["Strafe"]
BlitzerGeld_LV = BlitzerGeld_LV + BlitzerGeldDStaat_LV
Blitzer_LV = mysql_fetch_assoc(sql)
end
mysql_free_result(sql)
outputServerLog("Es wurde "..BlitzerGeld_LV.." $ in Der Blitzer Datenbank von Las Venturas gefunden!")
else
outputServerLog("[Blitzer_LV Error!] "..mysql_errno(handler).."[ "..mysql_error(handler).." ] ")
end
end
Blitzer_start_LV_GELD()
-------------------------------------------------------------Geblitze
function Blitzer_start_SF_RASER()
local sql = mysql_query(handler,"SELECT * FROM Blitzer_SF")
Raser_SF = 0
if sql then
local Blitzer_SF = mysql_fetch_assoc(sql)
while(Blitzer_SF) do
local Raser_SF_DB = Blitzer_SF["Raser"]
Raser_SF = Raser_SF + Raser_SF_DB
Blitzer_SF = mysql_fetch_assoc(sql)
end
mysql_free_result(sql)
outputServerLog("Blitzer Start SF Raser")
else
outputServerLog("[Blitzer_SF Error!] "..mysql_errno(handler).."[ "..mysql_error(handler).." ] ")
end
end
Blitzer_start_SF_RASER()
function Blitzer_start_LV_RASER()
local sql = mysql_query(handler,"SELECT * FROM Blitzer_LV")
Raser_LV = 0
if sql then
local Blitzer_LV = mysql_fetch_assoc(sql)
while(Blitzer_LV) do
local RaserLVDB = Blitzer_LV["Raser"]
Raser_LV = Raser_LV + RaserLVDB
Blitzer_LV = mysql_fetch_assoc(sql)
end
mysql_free_result(sql)
outputServerLog("Blitzer Start LV Raser")
else
outputServerLog("[Blitzer_LV Error!] "..mysql_errno(handler).."[ "..mysql_error(handler).." ] ")
end
end
Blitzer_start_LV_RASER()
RaserGlobal = Raser_SF + Raser_LV
BlitzerGeld_Global = BlitzerGeld_SF + BlitzerGeld_LV
outputServerLog("Es wurde "..BlitzerGeld_Global.." $ in der Globalen Blitzer Datenbank gefunden!")
outputServerLog("Es wurden "..RaserGlobal.." Raser Blitzer Datenbank gefunden!")
Alles anzeigen
das mit der geld anzeige funktioniert jetzt hab ich das gleiche mit den Rasern versucht jetzt kommt aber in zeile 48
[2014-08-31 19:29:00] ERROR: ...des]\play\server\dhgc\dhgc_Blitzer_Global_server.lua:48: attempt to perform arithmetic on local 'Raser_SF_DB' (a string value)
wie kann ich den die einträge bei den rasern abfragen ?