Az alap scriptet Robika1/RobikaOne készitette:https://www.facebook.com/RobikaOne/?fref=ts Én csak tovább dolgoztam hogy csináljon valamit ha valaki átírta a metában a készítőt.
Script[server side]:
function vedelem ()
keszito = get(\"keszito\")
if (keszito == \"Neved\") then
outputChatBox(\"A mód sikeresen elinditva!\")
else
outputChatBox(\"Nem lopunk modot!\")
local allResources = getResources()
for i, resource in ipairs(allResources) do
if ( getResourceState(resource) == \"running\" ) and ( resource ~= getThisResource() ) then
stopResource(resource)
end
end
end
end
addEventHandler (\"onResourceStart\", root, vedelem)
A meta :
<meta>
-- egyéb meta tagek
<settings>
<setting name=\"keszito\" value=\"Neved\" desc=\"\" />
</settings>
</meta>
ACL.xml be!
<group name=\"Admin\">
<acl name=\"Moderator\"></acl>
<acl name=\"SuperModerator\"></acl>
<acl name=\"Admin\"></acl>
<acl name=\"RPC\"></acl>
<object name=\"resource.amibe bele épiteted resource neve!!!!!\"></object>
</group>
A kód lényegében ha a metában a készitő nevét átírják akkor leáll minden resource és újra se lehet inditani! (max. ha leállitják a védő resourceot, de ha több resourceba bele rakod nehezebb kijátszani) Meg persze titkositsátok le .luac-ba (a forumon felül MTA:SA/LUAC Konvertáló) A kód alapjait köszönjétek Robika1/RobikaOne-nak: https://www.facebook.com/RobikaOne/?fref=ts
A mód íroja Xistance.
----------------------------------------- Védelem resource neve alapján ---------------------------------------------------- Elvileg NEM müködik MÉG
function getResourceStatistic(res)
if getResourceState(res) == \"running\" and res == getThisResource() and getResourceFromName(\"x\") then
return \"okay\";
else
return \"not okay\";
end
end
function checkStatistic()
local get = getResourceStatistic(getThisResource())
if get == \"okay\" then
outputDebugString(\"Resource Futhat\")
else
while true do
outputChatBox(\" \")
end
end
end
addEventHandler(\"onClientResourceStart\", getResourceRootElement(getThisResource()), checkStatistic)
----------------------------------------- Védelem serial és név alapján ---------------------------------------------------- Nincs tesztelve!
function getResourceStatistic(res)
if getPlayerSerial == \"ASGK345252345KNMGLSANGALGSFLD\" and getPlayerName(localPlayer) == \"Xistance\" then
return \"okay\";
else
return \"not okay\";
end
end
function checkStatistic()
local get = getResourceStatistic(getThisResource())
if get == \"okay\" then
outputDebugString(\"Resource Futhat\")
else
while true do
outputChatBox(\" \")
end
end
end
addEventHandler(\"onClientResourceStart\", getResourceRootElement(getThisResource()), checkStatistic)
-----------------------------------------------------------------------------------------------------------------------------
Akkor kiegészíteném kliensoldali, kicsit más stílusú védelemmel. Első részben ha a resource nevét változtatják, megöli az egész klienst, a második részben ugyan ez csak a játékos nevét és a serialját kérdezi le.
----------------------------------------- Védelem resource neve alapján ----------------------------------------------------
function getResourceStatistic(res)
if getResourceState(res) == \"running\" and res == getThisResource() and getResourceFromName(\"x\") then
return \"okay\";
else
return \"not okay\";
end
end
function checkStatistic()
local get = getResourceStatistic(getThisResource())
if get == \"okay\" then
outputDebugString(\"Resource Futhat\")
else
while true do
outputChatBox(\" \")
end
end
end
addEventHandler(\"onClientResourceStart\", getResourceRootElement(getThisResource()), checkStatistic)
----------------------------------------- Védelem serial és név alapján ----------------------------------------------------
function getResourceStatistic(res)
if getPlayerSerial == \"ASGK345252345KNMGLSANGALGSFLD\" and getPlayerName(localPlayer) == \"Xistance\" then
return \"okay\";
else
return \"not okay\";
end
end
function checkStatistic()
local get = getResourceStatistic(getThisResource())
if get == \"okay\" then
outputDebugString(\"Resource Futhat\")
else
while true do
outputChatBox(\" \")
end
end
end
addEventHandler(\"onClientResourceStart\", getResourceRootElement(getThisResource()), checkStatistic)
-----------------------------------------------------------------------------------------------------------------------------
Üdvözletem!
Egy teszt alatt kipróbáltam a következő védelmet:
function getResourceStatistic(res)
if getResourceState(res) == \"running\" and res == getThisResource() and getResourceFromName(\"x\") then
return \"okay\";
else
return \"not okay\";
end
end
function checkStatistic()
local get = getResourceStatistic(getThisResource())
if get == \"okay\" then
outputDebugString(\"Resource Futhat\")
else
while true do
outputChatBox(\" \")
end
end
end
addEventHandler(\"onClientResourceStart\", getResourceRootElement(getThisResource()), checkStatistic)
Azt tapasztaltam, hogy a resource elindul, de ha újra indítom akkor ugyan úgy elindul késéssel. Lehet valamit rosszul csinálok legyen a resource neve modloader, és én \"x\"-en hagytam, hogy ne induljon el..... De késéssel mindig elindul, mit csinálok rosszul??!
Üdvözletem!
Egy teszt alatt kipróbáltam a következő védelmet:
function getResourceStatistic(res)
if getResourceState(res) == \"running\" and res == getThisResource() and getResourceFromName(\"x\") then
return \"okay\";
else
return \"not okay\";
end
end
function checkStatistic()
local get = getResourceStatistic(getThisResource())
if get == \"okay\" then
outputDebugString(\"Resource Futhat\")
else
while true do
outputChatBox(\" \")
end
end
end
addEventHandler(\"onClientResourceStart\", getResourceRootElement(getThisResource()), checkStatistic)
Azt tapasztaltam, hogy a resource elindul, de ha újra indítom akkor ugyan úgy elindul késéssel. Lehet valamit rosszul csinálok legyen a resource neve modloader, és én \"x\"-en hagytam, hogy ne induljon el..... De késéssel mindig elindul, mit csinálok rosszul??!
Elindulni elfog, viszont ha nem \"okay\" -t kap vissza értéknek, akkor a kliens oldalt kifagyassza. Nem próbáltam, de ez a funkciója a látottak alapján.