GTA Közösség - A magyar GTA fórum

Multi Theft Auto (MTA) => MTA: Szerverfejlesztés => Archívum => A témát indította: Campe3r - 2014. Március 31. - 20:57:19

Cím: Hiba a kóddal
Írta: Campe3r - 2014. Március 31. - 20:57:19
function getMoney(thePlayer, nocheck)
if not nocheck then
checkMoneyHacks(thePlayer)
end
return getElementData(thePlayer, \"money\") or 0
end
function checkMoneyHacks(thePlayer)
if not getMoney(thePlayer, true) or getElementType(thePlayer) ~= \"player\" then return end
local safemoney = getMoney(thePlayer, true)
local hackmoney = getPlayerMoney(thePlayer)
if (safemoney < hackmoney) then
setPlayerMoney(thePlayer, safemoney)
sendMessageToAdmins(\"Moneyhack gyanú: \"..getPlayerName(thePlayer))
return true
else
return false
end
end

 
Sziasztok, ezzel a scriptel mi lehet a gond? Hibát jelez állandóan :S
Hiba:
 
Bad argument @ \'getElementData\' [Exepted element at argument 1, got a boolean value]
Bad argument @ \'getElementType\' [Exepted element at argument 1, got a boolean value]

 
Egyépként shodown modot használok.
Cím: Hiba a kóddal
Írta: muHaHaHa - 2014. Április 01. - 15:28:09
Ahol használva van, ott a játékos változója bele van írva / jó változó van bele írva?
Cím: Hiba a kóddal
Írta: Campe3r - 2014. Március 31. - 20:57:19
function getMoney(thePlayer, nocheck)
if not nocheck then
checkMoneyHacks(thePlayer)
end
return getElementData(thePlayer, \"money\") or 0
end
function checkMoneyHacks(thePlayer)
if not getMoney(thePlayer, true) or getElementType(thePlayer) ~= \"player\" then return end
local safemoney = getMoney(thePlayer, true)
local hackmoney = getPlayerMoney(thePlayer)
if (safemoney < hackmoney) then
setPlayerMoney(thePlayer, safemoney)
sendMessageToAdmins(\"Moneyhack gyanú: \"..getPlayerName(thePlayer))
return true
else
return false
end
end

 
Sziasztok, ezzel a scriptel mi lehet a gond? Hibát jelez állandóan :S
Hiba:
 
Bad argument @ \'getElementData\' [Exepted element at argument 1, got a boolean value]
Bad argument @ \'getElementType\' [Exepted element at argument 1, got a boolean value]

 
Egyépként shodown modot használok.
Cím: Hiba a kóddal
Írta: muHaHaHa - 2014. Április 01. - 15:28:09
Ahol használva van, ott a játékos változója bele van írva / jó változó van bele írva?