function barierka(thePlayer)
local x, y, z = getElementPosition(thePlayer)
local rx, ry, rz = getElementRotation(thePlayer)
Barierka = createObject(2000, x, y , z, rx, ry, rz)
outputChatBox("Stworzy?e? barierk?", thePlayer)
end
addCommandHandler("b", barierka)
function barierka(thePlayer)
destroyElement(Barierka)
outputChatBox("Usun??e? barierk?", thePlayer)
end
addCommandHandler("ub", barierka)
Kod po stronie servera.
Z ogniem si? nie bawi?em wi?c nie pomog? za bardzo.
Ale widzia?em skrypt na ognie w gamemodzie OG-RPG (nie jestem pewien), pobierzesz ka?dego pseudola i powinno by? to samo.
http://gtao.pl/<font-c...30-vt120467.htm
Usuwa ostatni? bo tak zrobi?e? kod.
Tutaj barierki:
function stworzBarierke(thePlayer)
local x, y, z = getElementPosition(thePlayer)
local rx, ry, rz = getElementRotation(thePlayer)
local barierki = createObject(2000, x, y , z, rx, ry, rz)
setElementData(barierki, "barierka:wlasciciel:serial", getPlayerSerial(thePlayer))
outputChatBox("Stworzy?e? barierk?", thePlayer)
end
addCommandHandler("b", stworzBarierke)
function usunBarierki(thePlayer)
for _, barierka in ipairs(getElementsByType("object")) do
if getElementData(barierka, "barierka:wlasciciel:serial") ~= getPlayerSerial(thePlayer) then return end
destroyElement(barierka)
end
outputChatBox("Usun??e? swoje barierki", thePlayer)
end
addCommandHandler("ub", usunBarierki)
Dor?b sobie kod, kt?rym usuwasz barierki je?li gracz wyjdzie z serwera.
Tutaj pacho?ki, "IDpacholka" podmie? sobie na ID pacho?ka, kt?rego chcesz stawia? z komend?.
function stworzPacholek(thePlayer)
local x, y, z = getElementPosition(thePlayer)
local rx, ry, rz = getElementRotation(thePlayer)
local pacholek = createObject(IDpacholka, x, y , z, rx, ry, rz)
setElementData(pacholek, "pacholek:wlasciciel:serial", getPlayerSerial(thePlayer))
outputChatBox("Stworzy?e? pacho?ek", thePlayer)
end
addCommandHandler("p", stworzPacholek)
function usunPacholek(thePlayer)
for _, pacholek in ipairs(getElementsByType("object")) do
if getElementData(pacholek, "pacholek:wlasciciel:serial") ~= getPlayerSerial(thePlayer) then return end
destroyElement(pacholek)
end
outputChatBox("Usun??e? swoje pacho?ki", thePlayer)
end
addCommandHandler("up", usunPacholek)
Nie możesz pisać nowych tematów Nie możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach