Wysłany: 2012-03-22, 19:05
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
Oto serwer i innego panelu :
Kod: --***********************************--
--***********************************--
-- Jail System --
-- By Al3grab --
-- Server Side --
--***********************************--
--***********************************--
Command = get("command") -- getTheCommand
rRoot = getResourceRootElement(getThisResource())
------
function getData(to) -- get the weapons data and send them to the client who requested it [to]
local file = xmlLoadFile("data.xml")
jTable = {}
tTable = {}
if file then
for k,v in ipairs (xmlNodeGetChildren(xmlFindChild(file,"Jails",0)))do
local name = xmlNodeGetAttribute(v,"name")
local posX,posY,posZ = xmlNodeGetAttribute(v,"posX"),xmlNodeGetAttribute(v,"posY"),xmlNodeGetAttribute(v,"posZ")
local int = xmlNodeGetAttribute(v,"int")
local dim = xmlNodeGetAttribute(v,"dim")
table.insert(jTable, {name,posX,posY,posZ,int,dim})
end
for k,v in ipairs (xmlNodeGetChildren(xmlFindChild(file,"time",0)))do
local times = xmlNodeGetAttribute(v,"times")
for i =1,50 do
local iTime = gettok ( times, i, string.byte(',') )
if iTime then
--
if tonumber(iTime) > 59.5 then
iTime = math.floor(iTime / 60)
iTimeDes = "Minuta"
if iTime > 59.5 then
iTime = math.floor(iTime / 60)
iTimeDes = "Godzina"
end
else
iTimeDes = "Sekunda"
end
table.insert(tTable,{iTime,iTimeDes})
end
end
end
end
triggerClientEvent(to,"sendDataz",to,jTable,tTable) -- sending to client event
end
addEvent("getDataz",true)
addEventHandler("getDataz",root,getData)
addCommandHandler ( Command, -- Adding The Command Handler
function ( player, cmd )
if hasObjectPermissionTo ( player, "function.Freeze" ) then
triggerClientEvent(player,"jailShow",player)
else
outputChatBox("odmowa dost?pu",player,255,0,0)
end
end
)
anims = {
"F_smklean_loop",
"M_smklean_loop",
"M_smkstnd_loop",
"M_smk_drag",
"M_smk_in",
"M_smk_loop",
"M_smk_out",
"M_smk_tap" ,
}
function removeVehicle(thePlayer)
if isPedInVehicle(thePlayer) then destroyElement(getPedOccupiedVehicle(thePlayer)) end
end
function JailHim(jailed,theJails,time,timeDes,showWho)
thePlayer = getPlayerFromName(jailed)
if not thePlayer then outputChatBox("** #FFFF00Prosze wybierz gracza !",source,255,0,0,true) return end
removePedFromVehicle(thePlayer)
for k,v in ipairs ( jTable ) do
if theJails == v[1] then
theJail = v
end
end
if theJail then
if tostring(time) then
local theTimex = gettok ( time, 1, string.byte(timeDes) )
if timeDes == "Godzina" then
theTimex = math.floor(theTimex*60*60*1000)
elseif timeDes == "Minuta" then
theTimex = math.floor(theTimex*60*1000)
elseif timeDes == "Senkunda" then
theTimex = math.floor(theTimex*1000)
end
triggerClientEvent(thePlayer,"startTimer",thePlayer,thePlayer,theTimex)
local x,y,z = theJail[2],theJail[3],theJail[4]
local int = theJail[5]
local dim = theJail[6]
setElementInterior ( thePlayer, int )
setElementDimension ( thePlayer, dim )
setElementPosition (thePlayer,x,y,z )
setElementData(thePlayer,"jailed",true)
setElementData(getResourceRootElement(getThisResource()),""..getPlayerIP(thePlayer).."-j",true)
if showWho ~= true then
outputChatBox("** #FFFF00 Jeste? uwi?ziony[ "..getPlayerName(thePlayer).." #FFFF00] at "..theJail[1].." For "..time,source,255,0,0,true)
outputChatBox("** #FFFF00 Jestes wi?ziony przez[ "..getPlayerName(source).." #FFFF00] at "..theJail[1].." For "..time,thePlayer,255,0,0,true)
end
outputChatBox("** #FFFF00[ "..getPlayerName(thePlayer).." #FFFF00]Zosta? skazany na "..time,root,255,0,0,true)
local randomAnim
setPedAnimation(thePlayer,"SMOKING",anims[math.random(#anims)],theTimex/2)
else
outputChatBox("** #FFFF00 Wybierz czas!",source,255,0,0,true)
end
else
outputChatBox("** #FFFF00 Wybierz wi?zienie!",source,255,0,0,true)
end
end
addEvent("JailHimx",true)
addEventHandler("JailHimx",root,JailHim)
function unJailHim(jailed,showWho)
thePlayer = getPlayerFromName(jailed)
if not thePlayer then outputChatBox("** #FFFF00 Wybierz gracza!",source,255,0,0,true) return end
if getElementData(thePlayer,"jailed") == true then
setElementInterior ( thePlayer, 0)
setElementDimension ( thePlayer, 0 )
setElementPosition ( thePlayer, 1552.9108886719, -1675.5844726563, 16.1953125)
setElementData(thePlayer,"jailed",false)
setElementData(rRoot,""..getPlayerIP(thePlayer).."-j",false)
if showWho ~= true then
outputChatBox("** #Jeste? autorskich[ "..getPlayerName(thePlayer).." #FFFF00]",source,255,0,0,true)
outputChatBox("** #FFFF00 Zosta?e? wypuszony przez[ "..getPlayerName(source).." #FFFF00]",thePlayer,255,0,0,true)
end
outputChatBox("** #FFFF00[ "..getPlayerName(thePlayer).." #FFFF00] Zosta?a wydana",root,255,0,0,true)
triggerClientEvent(thePlayer,"onClientJailEnd",thePlayer,thePlayer)
else
outputChatBox("Gracz nie jest jednak skazany!",source,255,0,0,true)
end
end
addEvent("unJailHim",true)-- unJail
addEventHandler("unJailHim",root,unJailHim)
addEvent("onJailEnd",true)
addEventHandler("onJailEnd",root,function(player)
unJailHim(getPlayerName(player),true)
end )
addEventHandler("onPlayerSpawn",root, -- Check If He Is Jailed [ OnSpawn ]
function()
if getElementData(source,"jailed") == true then
randomJail = jTable[math.random(#jTable)]
if randomJail then
x,y,z = randomJail[2],randomJail[3],randomJail[4]
int = randomJail[5]
dim = randomJail[6]
setElementInterior ( source, int )
setElementDimension(source,dim)
setElementPosition (source,x,y,z )
end
end
end)
addEventHandler("onPlayerJoin",root, -- Check If He Is Jailed - By IP [ OnJoin ]
function()
if getElementData(rRoot,""..getPlayerIP(source).."-j") == true then
setElementData(source,"jailed",true)
randomJail = jTable[math.random(#jTable)]
if randomJail then
x,y,z = randomJail[2],randomJail[3],randomJail[4]
int = randomJail[5]
dim = randomJail[6]
setElementInterior ( source, int )
setElementDimension(source,dim)
setElementPosition (source,x,y,z )
end
end
end )
mam tu du?o tego tych opcji te? jest zbudowany na MissionTimer
Wysłany: 2012-03-22, 19:20
Jacob
Głupiomądry
Wiek: 28 Na forum: 5502 dni Posty: 967
Nick w MP: Jacob
Piwa : 786
luki123luki123 , ja osobi?cie nie pomagam przy skopiowanych skryptach. Trzeba nauczy? was pracowa? samodzielnie
Wysłany: 2012-03-22, 19:29
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
Ej to jest moje :
Kod: function ()
local serial = getPlayerSerial(thePlayer)
setElementData (serial, "serial", tonumber(30))
setElementPosition (thePlayer, posX, posY, posZ )
setElementInterior (thePlayer, interior, 2233.91, 1714.73, 1011.38 )
local timer = exports.missiontimer:createMissionTimer(tonumber(30*1000),true,true,0.5,20,true,"default-bold",1)-- tam gdzie 30 minuty zostaw *1000
local ile = exports.missiontimer:getMissionTimerTime(timer)
if (ile == 0) then
outputChatBox("** #FFFF00 Jestes wi?ziony przez[ "..getPlayerName(source)..",255,0,0,true)
end
i co propawi?
Wysłany: 2012-03-22, 19:31
Piorun
Wiek: 32 Na forum: 6712 dni Posty: 1837
Nick w MP: Piorun
Piwa : 516
Widz?, ?e to jak grochem o ?cian?. Skoro to twoje to gdzie? zdefiniowa? poni?sze zmienne?
posX,
posY,
posZ,
interior
A na dodatek ja Ci radz? zrobi? wszystko od nowa, samemu. Trudne? To mo?e czas zaj?? si? czym? prostszym, a nie lecie? jak na zabicie przed siebie. Widzia?e? kiedy? si?acza, kt?ry od razu zaczyna ze sztang? 100kg? W?tpi?. Zastosuj system schodkowy - pnij si? do g?ry, a? w ko?cu uzyskasz odpowiedni wynik.
Wysłany: 2012-03-22, 19:33
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
Potrzebuje tego panelu
Wysłany: 2012-03-22, 19:50
Jacob
Głupiomądry
Wiek: 28 Na forum: 5502 dni Posty: 967
Nick w MP: Jacob
Piwa : 786
luki123luki123 , ciesze si?. A my chcemy, aby u?ytkownicy si? rozwijali.
Wysłany: 2012-03-22, 20:00
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
Ale testy ja................
Wysłany: 2012-03-22, 20:11
Piorun
Wiek: 32 Na forum: 6712 dni Posty: 1837
Nick w MP: Piorun
Piwa : 516
Cytat: Ale testy ja................
O co ci 'kaman' ??
Wysłany: 2012-03-22, 20:13
Oski
LUA Scripter
Wiek: 30 Na forum: 5246 dni Posty: 428
Nick w MP: Oski
Piwa : 56
Powiem szczerze ?e osobi?cie kiedy? pr?bowa?em przerabia? skrypty z community.
Wi?kszo?? tak robi.
A teraz wole co? sam napisa? dlatego ?e:
Mam z tego satysfakcje.
Je?li co? sie zepsuje to wiem za co mam sie bra?.
Rozumiem ca?y skrypt.
Szybciej si? to robi ni? przer?bki.
Luki pomy?l to nie boli. LUA jest najprostszym j?zykiem jaki widzia?em.
Teraz mam dopiero C++ w szkole to jest dopiero trudne.
To odemnie mo?e nie na temat ale ?eby u?ytkownik zrozumia? ?eby co? zrobi? samemu
Pozdro
Oski
[ Dodano : 2012-03-22, 20:15 ]
"Pioruniasty" napisał/a : Cytat: Ale testy ja................
O co ci 'kaman' ??
Tu chodzi o to chyba ?e robimy mu testy(Sprawdziany) a to "jaaaaa" to
taki gest. takie co? jak yeeah
xD
Wysłany: 2012-03-22, 20:21
Adrian1545
Wiek: 30 Na forum: 5647 dni Posty: 78
Nick w MP: [sXc]Lexon
Piwa : 125
Cytat: Ale testy ja................
Tu On zapomnia? napisa? "ja si? bardzo ciesz?"
Wysłany: 2012-03-24, 20:51
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
Wiem troch? o lua i interesuje si? nim ale co mam robi? jakie stropie i jakie skrypty jaki? zadanie ?ebym robi? skrypty nie mam takiej osoby ?eby mi "zadawa?a zadania " a to najprostsza nauka lua
Oski dla cb piwo
Mo?e kto? mi pom?c
Tagi: lua
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: