Jump to content

~=[ مساعدة في ديربي]=~


Recommended Posts

3 hours ago, TOUNSI | ا̍ڸــڛۣــ؏ــٰٱ̍دہ said:

حطه بلوحة ادمين

يخي حط الكود عندما لاعب يدخل الى الديربي

بشوي ع الرجاآل , وتراه لسه داخل البرمجة فلآزم نفيده :]
..

3 hours ago, OmaR|FLaSH said:

جربت احطة في كل حتة ف المود المود مش بيشتغل ..

حطه في ملف السيرفر قل ليه ؟
شايف لونه ؟ 

البرتقالي ذا يعني سيرفر,
لو كان احمر يعني كلنت

لو ازرق يعني تقدر تحطه في كلنت او سيرفر ..

setPedGravity(Element, 0.008) -- Element = الحدث 

 

Edited by Guest
Link to comment
1 minute ago, *AnGeL said:

بشوي ع الرجاآل , وتراه لسه داخل البرمجة فلآزم نفيده :]
..

حطه في ملف السيرفر قل ليه ؟
شايف لونه ؟ 

البرتقالي ذا يعني سيرفر,
لو كان احمر يعني كلنت

لو ازرق يعني تقدر تحطه في كلنت او سيرفر ..


setPedGravity(Element, 0.008) -- Element = الحدث 

 

Element = الحدث 

؟؟؟؟؟؟؟؟؟

  • Haha 1
Link to comment
spawns = {}
setElementData(resourceRoot,"map","no")
setElementData(resourceRoot,"winMoney","0")
addEventHandler("onPlayerChat",getRootElement(),function(message)
if tostring(message) == "ديربي" and checkDuel(source) == "prestart" and ( not checkExistPlrOnDuel(source) )   then
setPedGravity(map, 0.008)

online = countPlayersOnDerby()
if tonumber(online)+1 < 32 then
setData(source,"onCrossMap","yes")
outputChatBox("* #00BCCD≈ - ( #555555Derby #00BCCD} :الرجاء الانتظار ..",source,255,255,0,true)
setD(source)
spawnOnMap(source)
else
outputChatBox("* #00BCCD≈ - ( #555555Derby #00BCCD) : لم يبق مكان بالديـربي الرجآء, الانتظآر الديربي القآدم,",source,0,255,0,true)
end
end end)
function checkDuel(p)
if tostring(getElementData(resourceRoot,"map")) == "yes" then
outputChatBox("* #ff0000≈ #ffffff[#ff0000 DerbySystem #ffffff ] #00BCCD≈",p,255,255,0,true)
elseif tostring(getElementData(resourceRoot,"map")) == "no" then
outputChatBox("* #00BCCD≈ - ( #555555Derby #00BCCD) : الرجآء الانتظآر,حتى يبدء الديربي",p,255,255,0,true)
end
return tostring(getElementData(resourceRoot,"map"))
end
function checkExistPlrOnDuel(p)
per = getElementData(p,"onCrossMap")
if tostring(per) == "yes" then
return true
else
return false
end
end
function setData(element,key,vlr)
setElementData(element,key,vlr)
end
function setD(element)
setElementDimension(element,30)
end
function spawnOnMap(p)
count = countPlayersOnDerby()
spawned = "no"
for i,data in pairs(spawns)do
if tonumber(data.id) == tonumber(count) then
spawned = "yes"
v = createVehicle(411,data.x,data.y,data.z,data.rx,data.ry,data.rz)
setElementDimension(v,30)
setElementFrozen(v,true)
setElementData(v,"creatorDerby","yes")
break
end
end
if spawned == "no" then
randomS = math.random("1","32")
for i,data in pairs(spawns)do
if tonumber(data.id) == tonumber(randomS) then
v = createVehicle(411,data.x,data.y,data.z,data.rx,data.ry,data.rz)
setElementDimension(v,30)
setElementFrozen(v,true)
setElementData(v,"creatorDerby","yes")
break
end end
end
toggleControl(p,"enter_exit", false ) 
warpPedIntoVehicle(p,v)
setCameraTarget(p,p)
end
function countPlayersOnDerby()
c = -1
for i,p in pairs(getElementsByType("player"))do
if checkExistPlrOnDuel(p) then
c = c+1
end
end 
return tonumber(c)
end
function eventCheck ()
if checkExistPlrOnDuel(source) then
toggleControl(source,"enter_exit",true ) 
setData(source,"onCrossMap","no")
checkEnd()
end
end
addEventHandler("onPlayerWasted",getRootElement(),eventCheck)
addEventHandler("onPlayerQuit",getRootElement(),eventCheck)
addEventHandler("onPlayerJoin",getRootElement(),function()
outputChatBox("",source,255,255,0,true)
setData(source,"onCrossMap","no")
end)
for i,p in pairs(getElementsByType("player"))do
setData(p,"onCrossMap","no")
end
function checkEnd()
c = 0
for i,p in pairs(getElementsByType("player"))do
if checkExistPlrOnDuel(p) then
c = c+1
winner = p
end end
if tonumber(c) == 1 then
givePlayerMoney(winner,tonumber(getElementData(resourceRoot,"winMoney")))
n = string.gsub(getPlayerName(winner), "#%x%x%x%x%x%x", "")
outputChatBox("* #ff0000≈[ #ff0000 " .. n .. " #FF9700 Won the Derby and win#00FF00 " .. tonumber(getElementData(resourceRoot,"winMoney")) .. "$ ##ff0000]≈",getRootElement(),255,255,0,true)
setElementData(resourceRoot,"map","no")
endDerby()
setTimer(newDuel,30000,1)
end
end
function newDuel()
for i,p in pairs(getElementsByType("player"))do
setData(p,"onCrossMap","no")
end
setElementData(resourceRoot,"map","prestart")
outputChatBox("* #00BCCD≈ - ( #555555Derby #00BCCD) : لدخول الديربي,اكتب في الشـآت ديربي.",getRootElement(),255,255,0,true)
RMoney = math.random("50000","300000")
setElementData(resourceRoot,"winMoney",tonumber(RMoney))
outputChatBox("* #00BCCD≈ - ( #555555Derby #00BCCD) : سيحصل الفآئز في الديربي على #00FF00|" .. RMoney .. "|$",getRootElement(),0,255,0,true)
setTimer(checkPlrs,30000,1)
end
function checkPlrs ()
c = 0
for i,p in pairs(getElementsByType("player"))do
if checkExistPlrOnDuel(p) then
c = c+1
end end
if tonumber(c) > 1 then
setElementData(resourceRoot,"map","yes")
for i,p in pairs(getElementsByType("player"))do
if checkExistPlrOnDuel(p) then
setElementCollisionsEnabled(getPedOccupiedVehicle(p),true)
outputChatBox("* #00BCCD≈ - ( #555555Derby #00BCCD) : لقد بدآء الديربي , يمكنك الانطلاق",p,0,255,0,true)
setElementFrozen(getPedOccupiedVehicle(p),false)
end end
else
endDerby()
setElementData(resourceRoot,"map","no")
outputChatBox("* #00BCCD≈ - ( #555555Derby #00BCCD) : لم يبدآء الديربي, لعدم توفر الاعبين",getRootElement(),255,255,0,true)
setTimer(newDuel,60000,1)
end
end
setTimer(newDuel,3000,1)
function onStartLoadSpawns ()
file = fileOpen("map.map")
localFile = fileOpen("map.xml")
fileWrite(localFile,"")
data = fileRead(file,999999)
fileWrite(localFile,data)
fileClose(localFile)
xml = xmlLoadFile("map.xml")
c = 0
for i,data in pairs(xmlNodeGetChildren(xml)) do
if  xmlNodeGetName(data) == "spawnpoint" then
c = c+1
v,xx,yy,zz,rxx,ryy,rzz = xmlNodeGetAttribute(data,"vehicle"),xmlNodeGetAttribute(data,"posX"),xmlNodeGetAttribute(data,"posY"),xmlNodeGetAttribute(data,"posZ"),xmlNodeGetAttribute(data,"rotX"),xmlNodeGetAttribute(data,"rotY"),xmlNodeGetAttribute(data,"rotZ")
table.insert(spawns,{id = c,model = v,x = xx,y = yy,z = zz,rx = rxx,ry = ryy,rz = rzz})
end
end
for i,data in pairs(xmlNodeGetChildren(xml)) do
if  xmlNodeGetName(data) == "object" then
m,xx,yy,zz,rxx,ryy,rzz = xmlNodeGetAttribute(data,"model"),xmlNodeGetAttribute(data,"posX"),xmlNodeGetAttribute(data,"posY"),xmlNodeGetAttribute(data,"posZ"),xmlNodeGetAttribute(data,"rotX"),xmlNodeGetAttribute(data,"rotY"),xmlNodeGetAttribute(data,"rotZ")
object = createObject(m,xx,yy,zz,rxx,ryy,rzz)
setElementDimension(object,30)
end end
end
setTimer(onStartLoadSpawns,3000,1)
function endDerby()
for i,p in pairs(getElementsByType("player"))do
if checkExistPlrOnDuel(p) then
killPed(p)
end end
for i,v in pairs(getElementsByType("vehicle"))do
if getElementData(v,"creatorDerby") then
destroyElement(v)
end end
end
setTimer(function()
for i,p in pairs(getElementsByType("player"))do
sea(p)
resetHan(p)
checkVeh(p)
checkModel(p)
end
end,1000,0)
outputChatBox("",getRootElement(),255,255,0,true)
function sea(p)
if checkExistPlrOnDuel(p) then
x,y,z = getElementPosition(p)
if tonumber(z) <= 0 then
killPed(p)
end
end
end
function checkVeh(p)
if (tonumber(getElementDimension(p)) == 30) and not (isPedInVehicle(p))then
killPed(p)
end
end
function resetHan(p)
if checkExistPlrOnDuel(p) then
setVehicleHandling (getPedOccupiedVehicle(p), true )
end
end
function checkModel(p)
if checkExistPlrOnDuel(p) and isPedInVehicle(p) then
if tonumber(getElementModel(getPedOccupiedVehicle(p))) ~= 411 then 
killPed(p)
end end
end

Try.

Link to comment

 

On 15/10/2018 at 23:05, #_iMr,[E]coo said:

هات اخر ٥٠ سطر .

ملف سيرفر كلههءء

spawns = {}
setElementData(resourceRoot,"map","no")
setElementData(resourceRoot,"winMoney","0")
addEventHandler("onPlayerChat",getRootElement(),function(message)
if tostring(message) == "ديربي" and checkDuel(source) == "prestart" and ( not checkExistPlrOnDuel(source) )   then
online = countPlayersOnDerby()
if tonumber(online)+1 < 32 then
setData(source,"onCrossMap","yes")
exports.killmessages:outputMessage("#66ffb3▒ #ffffffتم الأنضمام للديربي .. انتظر قليلآ حتي قدوم اللاعبين#66ffb3▒                     ",source,0,0,0,true)
setD(source)
spawnOnMap(source)
else
OutPut("#66ffb3▒ #ffffffعدد اللاعبين في الديربي كبير جدآ انتظر الديربي القادم ... #66ffb3▒                  ",source,0,0,0,true)
end
end end)
function checkDuel(p)
if tostring(getElementData(resourceRoot,"map")) == "yes" then
elseif tostring(getElementData(resourceRoot,"map")) == "no" then
exports.killmessages:outputMessage("#66ffb3▒ #ffffffالديربي لم يبدأ الان .. أنتظر قليلآ حتي يبدأ الديربي #66ffb3▒                 ",p,0,0,0,true)
end
return tostring(getElementData(resourceRoot,"map"))
end
function checkExistPlrOnDuel(p)
per = getElementData(p,"onCrossMap")
if tostring(per) == "yes" then
return true
else
return false
end
end
function setData(element,key,vlr)
setElementData(element,key,vlr)
end
function setD(element)
setElementDimension(element,30)
end
function spawnOnMap(p)
count = countPlayersOnDerby()
spawned = "no"
for i,data in pairs(spawns)do
if tonumber(data.id) == tonumber(count) then
spawned = "yes"
v = createVehicle(502,data.x,data.y,data.z,data.rx,data.ry,data.rz)
setElementDimension(v,30)
setElementFrozen(v,true)
setElementData(v,"creatorDerby","yes")
break
end
end
if spawned == "no" then
randomS = math.random("1","32")
for i,data in pairs(spawns)do
if tonumber(data.id) == tonumber(randomS) then
v = createVehicle(502,data.x,data.y,data.z,data.rx,data.ry,data.rz)
setElementDimension(v,30)
setElementFrozen(v,true)
setElementData(v,"creatorDerby","yes")
break
end end
end
toggleControl(p,"enter_exit", false ) 
warpPedIntoVehicle(p,v)
setCameraTarget(p,p)
end
function countPlayersOnDerby()
c = -1
for i,p in pairs(getElementsByType("player"))do
if checkExistPlrOnDuel(p) then
c = c+1
end
end 
return tonumber(c)
end
function eventCheck ()
if checkExistPlrOnDuel(source) then
toggleControl(source,"enter_exit",true ) 
setData(source,"onCrossMap","no")
checkEnd()
end
end
addEventHandler("onPlayerWasted",getRootElement(),eventCheck)
addEventHandler("onPlayerQuit",getRootElement(),eventCheck)
addEventHandler("onPlayerJoin",getRootElement(),function()
outputChatBox("",source,255,255,0,true)
setData(source,"onCrossMap","no")
end)
for i,p in pairs(getElementsByType("player"))do
setData(p,"onCrossMap","no")
end
function checkEnd()
c = 0
for i,p in pairs(getElementsByType("player"))do
if checkExistPlrOnDuel(p) then
c = c+1
winner = p
end end
if tonumber(c) == 1 then
givePlayerMoney(winner,tonumber(getElementData(resourceRoot,"winMoney")))
n = string.gsub(getPlayerName(winner), "#%x%x%x%x%x%x", "")
exports.killmessages:outputMessage("#66ffb3❀⌠ #e6b800 " .. tonumber(getElementData(resourceRoot,"winMoney")) .. "$ #ffffff هو الفائز في هذا الديربي وحصل علي مبلغ : #e6b800 " .. n .. " #66ffb3⌡❀               ",getRootElement(),0,0,0,true)setElementData(resourceRoot,"map","no")
endDerby()
setTimer(newDuel,30000,1)
end
end
function newDuel()
for i,p in pairs(getElementsByType("player"))do
setData(p,"onCrossMap","no")
end
setElementData(resourceRoot,"map","prestart")
exports.killmessages:outputMessage("#66ffb3▒ #FFFFFFلقد بدأ ديربي سيرفر ستورم #66ffb3▒                                ",getRootElement(),0,0,0,true)
exports.killmessages:outputMessage("#66ffb3▒ #FFFFFFلدخول الديربي اكتب بالشات | ديربي #66ffb3▒                          ",getRootElement(),0,0,0,true)
RMoney = math.random("50000","300000")
setElementData(resourceRoot,"winMoney",tonumber(RMoney))
exports.killmessages:outputMessage("#66ffb3▒ #FFFFFFسيحصل الفائز في الديربي علي | " .. RMoney .. " $ #66ffb3▒                    ",getRootElement(),0,0,0,true)
setTimer(checkPlrs,30000,1)
end
function checkPlrs ()
c = 0
for i,p in pairs(getElementsByType("player"))do
if checkExistPlrOnDuel(p) then
c = c+1
end end
if tonumber(c) > 1 then
setElementData(resourceRoot,"map","yes")
for i,p in pairs(getElementsByType("player"))do
if checkExistPlrOnDuel(p) then
setElementCollisionsEnabled(getPedOccupiedVehicle(p),true)
OutPut("لقد بدأ الديربي يمكنك التحرك ..",p,0,255,0,true)
setElementFrozen(getPedOccupiedVehicle(p),false)
end end
else
endDerby()
setElementData(resourceRoot,"map","no")
exports.killmessages:outputMessage("#66ffb3▒ #ffffff لم يبدأ الديربي لعدم وجود لاعبين كافيين #66ffb3▒                    ",getRootElement(),255,255,0,true)
setTimer(newDuel,60000,1)
end
end
setTimer(newDuel,3000,1)
function onStartLoadSpawns ()
file = fileOpen("map.map")
localFile = fileOpen("map.xml")
fileWrite(localFile,"")
data = fileRead(file,999999)
fileWrite(localFile,data)
fileClose(localFile)
xml = xmlLoadFile("map.xml")
c = 0
for i,data in pairs(xmlNodeGetChildren(xml)) do
if  xmlNodeGetName(data) == "spawnpoint" then
c = c+1
v,xx,yy,zz,rxx,ryy,rzz = xmlNodeGetAttribute(data,"vehicle"),xmlNodeGetAttribute(data,"posX"),xmlNodeGetAttribute(data,"posY"),xmlNodeGetAttribute(data,"posZ"),xmlNodeGetAttribute(data,"rotX"),xmlNodeGetAttribute(data,"rotY"),xmlNodeGetAttribute(data,"rotZ")
table.insert(spawns,{id = c,model = v,x = xx,y = yy,z = zz,rx = rxx,ry = ryy,rz = rzz})
end
end
for i,data in pairs(xmlNodeGetChildren(xml)) do
if  xmlNodeGetName(data) == "object" then
m,xx,yy,zz,rxx,ryy,rzz = xmlNodeGetAttribute(data,"model"),xmlNodeGetAttribute(data,"posX"),xmlNodeGetAttribute(data,"posY"),xmlNodeGetAttribute(data,"posZ"),xmlNodeGetAttribute(data,"rotX"),xmlNodeGetAttribute(data,"rotY"),xmlNodeGetAttribute(data,"rotZ")
object = createObject(m,xx,yy,zz,rxx,ryy,rzz)
setElementDimension(object,30)
end end
end
setTimer(onStartLoadSpawns,3000,1)
function endDerby()
for i,p in pairs(getElementsByType("player"))do
if checkExistPlrOnDuel(p) then
killPed(p)
end end
for i,v in pairs(getElementsByType("vehicle"))do
if getElementData(v,"creatorDerby") then
destroyElement(v)
end end
end
setTimer(function()
for i,p in pairs(getElementsByType("player"))do
sea(p)
resetHan(p)
checkVeh(p)
checkModel(p)
end
end,1000,0)
outputChatBox("",getRootElement(),255,255,0,true)
function sea(p)
if checkExistPlrOnDuel(p) then
x,y,z = getElementPosition(p)
if tonumber(z) <= 0 then
killPed(p)
end
end
end
function checkVeh(p)
if (tonumber(getElementDimension(p)) == 30) and not (isPedInVehicle(p))then
killPed(p)
end
end
function resetHan(p)
if checkExistPlrOnDuel(p) then
setVehicleHandling (getPedOccupiedVehicle(p), true )
end
end
function checkModel(p)
if checkExistPlrOnDuel(p) and isPedInVehicle(p) then
if tonumber(getElementModel(getPedOccupiedVehicle(p))) ~= 502 then 
killPed(p)
end end
end

addEvent("JumpVehicle",true)
addEventHandler("JumpVehicle",root,
function (Vehicle)
	local speedx, speedy, speedz = getElementVelocity (Vehicle)
	setElementVelocity (Vehicle,speedx,speedy,0.3)
end)

addEvent( "Warning", true )
function Warningg ()
  OutPut( "يمنع فتح اللوحات اثناء مسابقة الديربي", source, 36, 218, 199 )
end
addEventHandler ( "Warning", getRootElement(), Warningg )

 

Edited by N3xT
Link to comment
spawns = {}
setElementData(resourceRoot,"map","no")
setElementData(resourceRoot,"winMoney","0")
addEventHandler("onPlayerChat",getRootElement(),function(message)
if tostring(message) == "ديربي" and checkDuel(source) == "prestart" and ( not checkExistPlrOnDuel(source) )   then
setPedGravity(map,0.008)
online = countPlayersOnDerby()
if tonumber(online)+1 < 32 then
setData(source,"onCrossMap","yes")
exports.killmessages:outputMessage("#66ffb3▒ #ffffffتم الأنضمام للديربي .. انتظر قليلآ حتي قدوم اللاعبين#66ffb3▒                     ",source,0,0,0,true)
setD(source)
spawnOnMap(source)
else
OutPut("#66ffb3▒ #ffffffعدد اللاعبين في الديربي كبير جدآ انتظر الديربي القادم ... #66ffb3▒                  ",source,0,0,0,true)
end
end end)
function checkDuel(p)
if tostring(getElementData(resourceRoot,"map")) == "yes" then
elseif tostring(getElementData(resourceRoot,"map")) == "no" then
exports.killmessages:outputMessage("#66ffb3▒ #ffffffالديربي لم يبدأ الان .. أنتظر قليلآ حتي يبدأ الديربي #66ffb3▒                 ",p,0,0,0,true)
end
return tostring(getElementData(resourceRoot,"map"))
end
function checkExistPlrOnDuel(p)
per = getElementData(p,"onCrossMap")
if tostring(per) == "yes" then
return true
else
return false
end
end
function setData(element,key,vlr)
setElementData(element,key,vlr)
end
function setD(element)
setElementDimension(element,30)
end
function spawnOnMap(p)
count = countPlayersOnDerby()
spawned = "no"
for i,data in pairs(spawns)do
if tonumber(data.id) == tonumber(count) then
spawned = "yes"
v = createVehicle(502,data.x,data.y,data.z,data.rx,data.ry,data.rz)
setElementDimension(v,30)
setElementFrozen(v,true)
setElementData(v,"creatorDerby","yes")
break
end
end
if spawned == "no" then
randomS = math.random("1","32")
for i,data in pairs(spawns)do
if tonumber(data.id) == tonumber(randomS) then
v = createVehicle(502,data.x,data.y,data.z,data.rx,data.ry,data.rz)
setElementDimension(v,30)
setElementFrozen(v,true)
setElementData(v,"creatorDerby","yes")
break
end end
end
toggleControl(p,"enter_exit", false ) 
warpPedIntoVehicle(p,v)
setCameraTarget(p,p)
end
function countPlayersOnDerby()
c = -1
for i,p in pairs(getElementsByType("player"))do
if checkExistPlrOnDuel(p) then
c = c+1
end
end 
return tonumber(c)
end
function eventCheck ()
if checkExistPlrOnDuel(source) then
toggleControl(source,"enter_exit",true ) 
setData(source,"onCrossMap","no")
checkEnd()
end
end
addEventHandler("onPlayerWasted",getRootElement(),eventCheck)
addEventHandler("onPlayerQuit",getRootElement(),eventCheck)
addEventHandler("onPlayerJoin",getRootElement(),function()
outputChatBox("",source,255,255,0,true)
setData(source,"onCrossMap","no")
end)
for i,p in pairs(getElementsByType("player"))do
setData(p,"onCrossMap","no")
end
function checkEnd()
c = 0
for i,p in pairs(getElementsByType("player"))do
if checkExistPlrOnDuel(p) then
c = c+1
winner = p
end end
if tonumber(c) == 1 then
givePlayerMoney(winner,tonumber(getElementData(resourceRoot,"winMoney")))
n = string.gsub(getPlayerName(winner), "#%x%x%x%x%x%x", "")
exports.killmessages:outputMessage("#66ffb3❀⌠ #e6b800 " .. tonumber(getElementData(resourceRoot,"winMoney")) .. "$ #ffffff هو الفائز في هذا الديربي وحصل علي مبلغ : #e6b800 " .. n .. " #66ffb3⌡❀               ",getRootElement(),0,0,0,true)setElementData(resourceRoot,"map","no")
endDerby()
setTimer(newDuel,30000,1)
end
end
function newDuel()
for i,p in pairs(getElementsByType("player"))do
setData(p,"onCrossMap","no")
end
setElementData(resourceRoot,"map","prestart")
exports.killmessages:outputMessage("#66ffb3▒ #FFFFFFلقد بدأ ديربي سيرفر ستورم #66ffb3▒                                ",getRootElement(),0,0,0,true)
exports.killmessages:outputMessage("#66ffb3▒ #FFFFFFلدخول الديربي اكتب بالشات | ديربي #66ffb3▒                          ",getRootElement(),0,0,0,true)
RMoney = math.random("50000","300000")
setElementData(resourceRoot,"winMoney",tonumber(RMoney))
exports.killmessages:outputMessage("#66ffb3▒ #FFFFFFسيحصل الفائز في الديربي علي | " .. RMoney .. " $ #66ffb3▒                    ",getRootElement(),0,0,0,true)
setTimer(checkPlrs,30000,1)
end
function checkPlrs ()
c = 0
for i,p in pairs(getElementsByType("player"))do
if checkExistPlrOnDuel(p) then
c = c+1
end end
if tonumber(c) > 1 then
setElementData(resourceRoot,"map","yes")
for i,p in pairs(getElementsByType("player"))do
if checkExistPlrOnDuel(p) then
setElementCollisionsEnabled(getPedOccupiedVehicle(p),true)
OutPut("لقد بدأ الديربي يمكنك التحرك ..",p,0,255,0,true)
setElementFrozen(getPedOccupiedVehicle(p),false)
end end
else
endDerby()
setElementData(resourceRoot,"map","no")
exports.killmessages:outputMessage("#66ffb3▒ #ffffff لم يبدأ الديربي لعدم وجود لاعبين كافيين #66ffb3▒                    ",getRootElement(),255,255,0,true)
setTimer(newDuel,60000,1)
end
end
setTimer(newDuel,3000,1)
function onStartLoadSpawns ()
file = fileOpen("map.map")
localFile = fileOpen("map.xml")
fileWrite(localFile,"")
data = fileRead(file,999999)
fileWrite(localFile,data)
fileClose(localFile)
xml = xmlLoadFile("map.xml")
c = 0
for i,data in pairs(xmlNodeGetChildren(xml)) do
if  xmlNodeGetName(data) == "spawnpoint" then
c = c+1
v,xx,yy,zz,rxx,ryy,rzz = xmlNodeGetAttribute(data,"vehicle"),xmlNodeGetAttribute(data,"posX"),xmlNodeGetAttribute(data,"posY"),xmlNodeGetAttribute(data,"posZ"),xmlNodeGetAttribute(data,"rotX"),xmlNodeGetAttribute(data,"rotY"),xmlNodeGetAttribute(data,"rotZ")
table.insert(spawns,{id = c,model = v,x = xx,y = yy,z = zz,rx = rxx,ry = ryy,rz = rzz})
end
end
for i,data in pairs(xmlNodeGetChildren(xml)) do
if  xmlNodeGetName(data) == "object" then
m,xx,yy,zz,rxx,ryy,rzz = xmlNodeGetAttribute(data,"model"),xmlNodeGetAttribute(data,"posX"),xmlNodeGetAttribute(data,"posY"),xmlNodeGetAttribute(data,"posZ"),xmlNodeGetAttribute(data,"rotX"),xmlNodeGetAttribute(data,"rotY"),xmlNodeGetAttribute(data,"rotZ")
object = createObject(m,xx,yy,zz,rxx,ryy,rzz)
setElementDimension(object,30)
end end
end
setTimer(onStartLoadSpawns,3000,1)
function endDerby()
for i,p in pairs(getElementsByType("player"))do
if checkExistPlrOnDuel(p) then
killPed(p)
end end
for i,v in pairs(getElementsByType("vehicle"))do
if getElementData(v,"creatorDerby") then
destroyElement(v)
end end
end
setTimer(function()
for i,p in pairs(getElementsByType("player"))do
sea(p)
resetHan(p)
checkVeh(p)
checkModel(p)
end
end,1000,0)
outputChatBox("",getRootElement(),255,255,0,true)
function sea(p)
if checkExistPlrOnDuel(p) then
x,y,z = getElementPosition(p)
if tonumber(z) <= 0 then
killPed(p)
end
end
end
function checkVeh(p)
if (tonumber(getElementDimension(p)) == 30) and not (isPedInVehicle(p))then
killPed(p)
end
end
function resetHan(p)
if checkExistPlrOnDuel(p) then
setVehicleHandling (getPedOccupiedVehicle(p), true )
end
end
function checkModel(p)
if checkExistPlrOnDuel(p) and isPedInVehicle(p) then
if tonumber(getElementModel(getPedOccupiedVehicle(p))) ~= 502 then 
killPed(p)
end end
end

addEvent("JumpVehicle",true)
addEventHandler("JumpVehicle",root,
function (Vehicle)
	local speedx, speedy, speedz = getElementVelocity (Vehicle)
	setElementVelocity (Vehicle,speedx,speedy,0.3)
end)

addEvent( "Warning", true )
function Warningg ()
  OutPut( "يمنع فتح اللوحات اثناء مسابقة الديربي", source, 36, 218, 199 )
end
addEventHandler ( "Warning", getRootElement(), Warningg )

 

Link to comment
Just now, *AnGeL said:

spawns = {}setElementData(resourceRoot,"map","no")setElementData(resourceRoot,"winMoney","0")addEventHandler("onPlayerChat",getRootElement(),function(message)if tostring(message) == "ديربي" and checkDuel(source) == "prestart" and ( not checkExistPlrOnDuel(source) )   thensetPedGravity(map,0.008)online = countPlayersOnDerby()if tonumber(online)+1 < 32 thensetData(source,"onCrossMap","yes")exports.killmessages:outputMessage("#66ffb3▒ #ffffffتم الأنضمام للديربي .. انتظر قليلآ حتي قدوم اللاعبين#66ffb3▒                     ",source,0,0,0,true)setD(source)spawnOnMap(source)elseOutPut("#66ffb3▒ #ffffffعدد اللاعبين في الديربي كبير جدآ انتظر الديربي القادم ... #66ffb3▒                  ",source,0,0,0,true)endend end)function checkDuel(p)if tostring(getElementData(resourceRoot,"map")) == "yes" thenelseif tostring(getElementData(resourceRoot,"map")) == "no" thenexports.killmessages:outputMessage("#66ffb3▒ #ffffffالديربي لم يبدأ الان .. أنتظر قليلآ حتي يبدأ الديربي #66ffb3▒                 ",p,0,0,0,true)endreturn tostring(getElementData(resourceRoot,"map"))endfunction checkExistPlrOnDuel(p)per = getElementData(p,"onCrossMap")if tostring(per) == "yes" thenreturn trueelsereturn falseendendfunction setData(element,key,vlr)setElementData(element,key,vlr)endfunction setD(element)setElementDimension(element,30)endfunction spawnOnMap(p)count = countPlayersOnDerby()spawned = "no"for i,data in pairs(spawns)doif tonumber(data.id) == tonumber(count) thenspawned = "yes"v = createVehicle(502,data.x,data.y,data.z,data.rx,data.ry,data.rz)setElementDimension(v,30)setElementFrozen(v,true)setElementData(v,"creatorDerby","yes")breakendendif spawned == "no" thenrandomS = math.random("1","32")for i,data in pairs(spawns)doif tonumber(data.id) == tonumber(randomS) thenv = createVehicle(502,data.x,data.y,data.z,data.rx,data.ry,data.rz)setElementDimension(v,30)setElementFrozen(v,true)setElementData(v,"creatorDerby","yes")breakend endendtoggleControl(p,"enter_exit", false ) warpPedIntoVehicle(p,v)setCameraTarget(p,p)endfunction countPlayersOnDerby()c = -1for i,p in pairs(getElementsByType("player"))doif checkExistPlrOnDuel(p) thenc = c+1endend return tonumber(c)endfunction eventCheck ()if checkExistPlrOnDuel(source) thentoggleControl(source,"enter_exit",true ) setData(source,"onCrossMap","no")checkEnd()endendaddEventHandler("onPlayerWasted",getRootElement(),eventCheck)addEventHandler("onPlayerQuit",getRootElement(),eventCheck)addEventHandler("onPlayerJoin",getRootElement(),function()outputChatBox("",source,255,255,0,true)setData(source,"onCrossMap","no")end)for i,p in pairs(getElementsByType("player"))dosetData(p,"onCrossMap","no")endfunction checkEnd()c = 0for i,p in pairs(getElementsByType("player"))doif checkExistPlrOnDuel(p) thenc = c+1winner = pend endif tonumber(c) == 1 thengivePlayerMoney(winner,tonumber(getElementData(resourceRoot,"winMoney")))n = string.gsub(getPlayerName(winner), "#%x%x%x%x%x%x", "")exports.killmessages:outputMessage("#66ffb3❀⌠ #e6b800 " .. tonumber(getElementData(resourceRoot,"winMoney")) .. "$ #ffffff هو الفائز في هذا الديربي وحصل علي مبلغ : #e6b800 " .. n .. " #66ffb3⌡❀               ",getRootElement(),0,0,0,true)setElementData(resourceRoot,"map","no")endDerby()setTimer(newDuel,30000,1)endendfunction newDuel()for i,p in pairs(getElementsByType("player"))dosetData(p,"onCrossMap","no")endsetElementData(resourceRoot,"map","prestart")exports.killmessages:outputMessage("#66ffb3▒ #FFFFFFلقد بدأ ديربي سيرفر ستورم #66ffb3▒                                ",getRootElement(),0,0,0,true)exports.killmessages:outputMessage("#66ffb3▒ #FFFFFFلدخول الديربي اكتب بالشات | ديربي #66ffb3▒                          ",getRootElement(),0,0,0,true)RMoney = math.random("50000","300000")setElementData(resourceRoot,"winMoney",tonumber(RMoney))exports.killmessages:outputMessage("#66ffb3▒ #FFFFFFسيحصل الفائز في الديربي علي | " .. RMoney .. " $ #66ffb3▒                    ",getRootElement(),0,0,0,true)setTimer(checkPlrs,30000,1)endfunction checkPlrs ()c = 0for i,p in pairs(getElementsByType("player"))doif checkExistPlrOnDuel(p) thenc = c+1end endif tonumber(c) > 1 thensetElementData(resourceRoot,"map","yes")for i,p in pairs(getElementsByType("player"))doif checkExistPlrOnDuel(p) thensetElementCollisionsEnabled(getPedOccupiedVehicle(p),true)OutPut("لقد بدأ الديربي يمكنك التحرك ..",p,0,255,0,true)setElementFrozen(getPedOccupiedVehicle(p),false)end endelseendDerby()setElementData(resourceRoot,"map","no")exports.killmessages:outputMessage("#66ffb3▒ #ffffff لم يبدأ الديربي لعدم وجود لاعبين كافيين #66ffb3▒                    ",getRootElement(),255,255,0,true)setTimer(newDuel,60000,1)endendsetTimer(newDuel,3000,1)function onStartLoadSpawns ()file = fileOpen("map.map")localFile = fileOpen("map.xml")fileWrite(localFile,"")data = fileRead(file,999999)fileWrite(localFile,data)fileClose(localFile)xml = xmlLoadFile("map.xml")c = 0for i,data in pairs(xmlNodeGetChildren(xml)) doif  xmlNodeGetName(data) == "spawnpoint" thenc = c+1v,xx,yy,zz,rxx,ryy,rzz = xmlNodeGetAttribute(data,"vehicle"),xmlNodeGetAttribute(data,"posX"),xmlNodeGetAttribute(data,"posY"),xmlNodeGetAttribute(data,"posZ"),xmlNodeGetAttribute(data,"rotX"),xmlNodeGetAttribute(data,"rotY"),xmlNodeGetAttribute(data,"rotZ")table.insert(spawns,{id = c,model = v,x = xx,y = yy,z = zz,rx = rxx,ry = ryy,rz = rzz})endendfor i,data in pairs(xmlNodeGetChildren(xml)) doif  xmlNodeGetName(data) == "object" thenm,xx,yy,zz,rxx,ryy,rzz = xmlNodeGetAttribute(data,"model"),xmlNodeGetAttribute(data,"posX"),xmlNodeGetAttribute(data,"posY"),xmlNodeGetAttribute(data,"posZ"),xmlNodeGetAttribute(data,"rotX"),xmlNodeGetAttribute(data,"rotY"),xmlNodeGetAttribute(data,"rotZ")object = createObject(m,xx,yy,zz,rxx,ryy,rzz)setElementDimension(object,30)end endendsetTimer(onStartLoadSpawns,3000,1)function endDerby()for i,p in pairs(getElementsByType("player"))doif checkExistPlrOnDuel(p) thenkillPed(p)end endfor i,v in pairs(getElementsByType("vehicle"))doif getElementData(v,"creatorDerby") thendestroyElement(v)end endendsetTimer(function()for i,p in pairs(getElementsByType("player"))dosea(p)resetHan(p)checkVeh(p)checkModel(p)endend,1000,0)outputChatBox("",getRootElement(),255,255,0,true)function sea(p)if checkExistPlrOnDuel(p) thenx,y,z = getElementPosition(p)if tonumber(z) <= 0 thenkillPed(p)endendendfunction checkVeh(p)if (tonumber(getElementDimension(p)) == 30) and not (isPedInVehicle(p))thenkillPed(p)endendfunction resetHan(p)if checkExistPlrOnDuel(p) thensetVehicleHandling (getPedOccupiedVehicle(p), true )endendfunction checkModel(p)if checkExistPlrOnDuel(p) and isPedInVehicle(p) thenif tonumber(getElementModel(getPedOccupiedVehicle(p))) ~= 502 then killPed(p)end endendaddEvent("JumpVehicle",true)addEventHandler("JumpVehicle",root,function (Vehicle)	local speedx, speedy, speedz = getElementVelocity (Vehicle)	setElementVelocity (Vehicle,speedx,speedy,0.3)end)addEvent( "Warning", true )function Warningg ()  OutPut( "يمنع فتح اللوحات اثناء مسابقة الديربي", source, 36, 218, 199 )endaddEventHandler ( "Warning", getRootElement(), Warningg )

 

Result

map = nil
Tip :
source = player

Correction :

setPedGravity(source,0.008)

 

Edited by #Ram
  • Thanks 1
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...