Jump to content

xX[تصحيح]Xx كود


Recommended Posts

السلام عليكم

ممكن مساعدة بالكود ذا

بروح الماركر يعطيني سلاب

  
spawns = {} 
setElementData(resourceRoot,"map","no") 
setElementData(resourceRoot,"winMoney","0") 
  
CrDerbyMarker = createMarker(x, y, z, "arrow", 1.1, 255, 0, 0, 170 ) 
  
addEventHandler('onMarkerHit', CrDerbyMarker, function(element) 
if getElementType(element) == 'player' and checkDuel(element) == "prestart" and ( not checkExistPlrOnDuel(element) ) then 
online = countPlayersOnDerby() 
if tonumber(online) +1 < 32 then 
setData(element,"onCrossMap","yes") 
outputChatBox("*[Car Race] It will begin the task || سوف تبدأ المهمة بعد قليل ",element,255,255,0,true) 
setD(element) 
spawnOnMap(element) 
else 
outputChatBox("*[Car Race] You still did not place || لم يبقى لك مكان",element,0,255,0,true) 
       end 
   end 
end) 
  
function checkDuel(p) 
if tostring(getElementData(resourceRoot,"map")) == "yes" then 
outputChatBox("*[Car Race] Start the Mission You can not log in || بدأت المهمة لا يمكنك الدخول",p,255,255,0,true) 
elseif tostring(getElementData(resourceRoot,"map")) == "no" then 
outputChatBox("*[Car Race] did not start the Mission || لم تبدأ المهمة ",p,255,255,0,true) 
if _mytimer and isTimer(_mytimer) then 
local _r,_e,_t = getTimerDetails(_mytimer) 
        if _r and _e and _t then 
            total = _r / 60 / 1000 
             ss = math.floor( _r / 1000 ) 
             seconds = tostring( math.fmod( ss, 60 ) ) 
            outputChatBox("*[Car Race]تبقـى: "..math.ceil(total)..":"..seconds.."") 
        end 
    end 
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) 
exports.killmessages:outputMessage(getPlayerName(p)..'  دخل إلى السباق ', root, 255, 0 ,0, true) 
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("*[Car Race] The Mission By A7TRAF",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("*[Car Race] [" .. n .. "] Won In Car Race and got The " .. tonumber(getElementData(resourceRoot,"winMoney")) .. "$ ##ff0000]",getRootElement(),255,255,0,true) 
setElementData(resourceRoot,"map","no") 
endDerby() 
_mytimer = setTimer(newDuel,60*1000*5,1) 
end 
end 
function newDuel() 
for i,p in pairs(getElementsByType("player"))do 
setData(p,"onCrossMap","no") 
end 
setElementData(resourceRoot,"map","prestart") 
outputChatBox("*[Car Race] Mission Start Go To Enter || لدخول مهمة السباق لمهمة إذهب للدخول المهمة",getRootElement(),255,255,0,true) 
RMoney = math.random("50000","300000") 
setElementData(resourceRoot,"winMoney",tonumber(RMoney)) 
outputChatBox("*[Car Race] The winner will get in the race for " .. 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("*[Car Race] Mission Started || بدأت المهمة ",p,0,255,0,true) 
setElementFrozen(getPedOccupiedVehicle(p),false) 
end end 
else 
endDerby() 
setElementData(resourceRoot,"map","no") 
outputChatBox("[Car Race]The mission did not start due to lack of players || لم تبدأ المهمة لعدم توافر لاعبين ",getRootElement(),255,255,0,true) 
_mytimer = setTimer(newDuel,60*1000*5,1) 
end 
end 
_mytimer = 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("*[Car Race] The Mission By A7TRAF",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 

ذا الماب يمكن الغلط بيه

"race,editor_main"> 
    "object (vgncarshade1) (1)" breakable="true" interior="0" alpha="255" model="3458" doublesided="false" scale="1" dimension="0" posX="5915.6001" posY="-3765.3999" posZ="0" rotX="0" rotY="0" rotZ="0"> 
    "object (vgncarshade1) (2)" breakable="true" interior="0" alpha="255" model="3458" doublesided="false" scale="1" dimension="0" posX="5875.2002" posY="-3765.5" posZ="0" rotX="0" rotY="0" rotZ="0"> 
    "object (vgncarshade1) (3)" breakable="true" interior="0" alpha="255" model="3458" doublesided="false" scale="1" dimension="0" posX="5933.2002" posY="-3788.1001" posZ="0" rotX="0" rotY="0" rotZ="90"> 
    "object (vgncarshade1) (4)" breakable="true" interior="0" alpha="255" model="3458" doublesided="false" scale="1" dimension="0" posX="5918.2998" posY="-3819.3" posZ="0" rotX="0" rotY="0" rotZ="40"> 
    "object (vgncarshade1) (5)" breakable="true" interior="0" alpha="255" model="3458" doublesided="false" scale="1" dimension="0" posX="5890.5" posY="-3819.3" posZ="0" rotX="0" rotY="0" rotZ="320"> 
    "object (vgncarshade1) (6)" breakable="true" interior="0" alpha="255" model="3458" doublesided="false" scale="1" dimension="0" posX="5856.8999" posY="-3807.2" posZ="0" rotX="0" rotY="0" rotZ="180"> 
    "object (vgncarshade1) (7)" breakable="true" interior="0" alpha="255" model="3458" doublesided="false" scale="1" dimension="0" posX="5857.5" posY="-3787.8" posZ="0" rotX="0" rotY="0" rotZ="90"> 
    "object (vgncarshade1) (8)" breakable="true" interior="0" alpha="255" model="3458" doublesided="false" scale="1" dimension="0" posX="5875.3999" posY="-3786.3999" posZ="0" rotX="0" rotY="0" rotZ="90"> 
    "object (vgncarshade1) (9)" breakable="true" interior="0" alpha="255" model="3458" doublesided="false" scale="1" dimension="0" posX="5914.2998" posY="-3787" posZ="0" rotX="0" rotY="0" rotZ="0"> 
    "object (vgncarshade1) (10)" breakable="true" interior="0" alpha="255" model="3458" doublesided="false" scale="1" dimension="0" posX="5853.6001" posY="-3784.1001" posZ="0" rotX="0" rotY="0" rotZ="0"> 
    "object (vgncarshade1) (11)" breakable="true" interior="0" alpha="255" model="3458" doublesided="false" scale="1" dimension="0" posX="5896.7998" posY="-3804.6001" posZ="0" rotX="0" rotY="0" rotZ="90"> 
    "object (vgncarshade1) (12)" breakable="true" interior="0" alpha="255" model="3458" doublesided="false" scale="1" dimension="0" posX="5913.3999" posY="-3783.2" posZ="0" rotX="0" rotY="0" rotZ="90"> 
    "object (vgncarshade1) (13)" breakable="true" interior="0" alpha="255" model="3458" doublesided="false" scale="1" dimension="0" posX="5925.7002" posY="-3817.3" posZ="0" rotX="0" rotY="0" rotZ="130"> 
    "object (vgncarshade1) (14)" breakable="true" interior="0" alpha="255" model="3458" doublesided="false" scale="1" dimension="0" posX="5885" posY="-3774.8" posZ="0" rotX="0" rotY="0" rotZ="129.996"> 
    "object (vgncarshade1) (17)" breakable="true" interior="0" alpha="255" model="3458" doublesided="false" scale="1" dimension="0" posX="5861.5" posY="-3747.1001" posZ="5.3" rotX="0" rotY="19.995" rotZ="309.995"> 
    "object (vgncarshade1) (18)" breakable="true" interior="0" alpha="255" model="3458" doublesided="false" scale="1" dimension="0" posX="5860.7002" posY="-3720.8" posZ="11.9" rotX="0" rotY="0" rotZ="40"> 
    "spawnpoint (Bloodring Banger) (1)" vehicle="504" posX="5936.3999" posY="-3830.2" posZ="2.5" rotX="0" rotY="0" rotZ="40">
    "spawnpoint (Bloodring Banger) (2)" vehicle="504" alpha="255" interior="0" posX="5934.2002" posY="-3796.3999" posZ="2.5" rotX="0" rotY="0" rotZ="359.996">
    "spawnpoint (Bloodring Banger) (3)" vehicle="504" alpha="255" interior="0" posX="5896.5" posY="-3806.2" posZ="2.5" rotX="0" rotY="0" rotZ="359.996">
    "spawnpoint (Bloodring Banger) (5)" vehicle="504" alpha="255" interior="0" posX="5839" posY="-3784.3" posZ="2.5" rotX="0" rotY="0" rotZ="269.995">
    "spawnpoint (Bloodring Banger) (6)" vehicle="504" alpha="255" interior="0" posX="5841.1001" posY="-3807.2" posZ="2.5" rotX="0" rotY="0" rotZ="269.995">
    "spawnpoint (Bloodring Banger) (7)" vehicle="504" alpha="255" interior="0" posX="5858.6001" posY="-3765.8999" posZ="2.5" rotX="0" rotY="0" rotZ="269.989">
    "spawnpoint (Bloodring Banger) (8)" vehicle="504" alpha="255" interior="0" posX="5901.2002" posY="-3765.1001" posZ="2.5" rotX="0" rotY="0" rotZ="89.989">
    "spawnpoint (Bloodring Banger) (9)" vehicle="504" alpha="255" interior="0" posX="5931.2002" posY="-3765" posZ="2.5" rotX="0" rotY="0" rotZ="89.995">
    "checkpoint () (1)" type="checkpoint" color="#00F9" size="2.25" nextid="checkpoint () (2)" posX="5913" posY="-3786.8999" posZ="1.6" rotX="0" rotY="0" rotZ="0">
    "checkpoint () (2)" type="checkpoint" color="#00F9" size="2.25" alpha="255" interior="0" nextid="checkpoint () (3)" posX="5923.2998" posY="-3815.8" posZ="1.6" rotX="0" rotY="0" rotZ="0">
    "checkpoint () (3)" type="checkpoint" color="#00F9" size="2.25" alpha="255" interior="0" nextid="checkpoint () (4)" posX="5880" posY="-3810.8" posZ="1.6" rotX="0" rotY="0" rotZ="0">
    "checkpoint () (4)" type="checkpoint" color="#00F9" size="2.25" alpha="255" interior="0" nextid="checkpoint () (5)" posX="5876.1001" posY="-3767.3999" posZ="1.6" rotX="0" rotY="0" rotZ="0">
    "checkpoint () (5)" type="checkpoint" color="#00F9" size="2.25" alpha="255" interior="0" nextid="checkpoint () (6)" posX="5897.8999" posY="-3787.7" posZ="1.6" rotX="0" rotY="0" rotZ="0">
    "checkpoint () (6)" type="checkpoint" color="#00F9" size="2.25" alpha="255" interior="0" nextid="checkpoint () (7)" posX="5913" posY="-3766" posZ="1.6" rotX="0" rotY="0" rotZ="0">
    "checkpoint () (7)" type="checkpoint" color="#00F9" size="2.25" alpha="255" interior="0" nextid="checkpoint () (8)" posX="5857.7002" posY="-3783.3999" posZ="1.6" rotX="0" rotY="0" rotZ="0">
    "checkpoint () (8)" type="checkpoint" color="#00F9" size="2.25" alpha="255" interior="0" nextid="checkpoint () (9)" posX="5932.1001" posY="-3786.8" posZ="1.6" rotX="0" rotY="0" rotZ="0">
    "checkpoint () (9)" type="checkpoint" color="#00F9" size="2.25" alpha="255" interior="0" nextid="checkpoint (Dinghy) (1)" posX="5848.2002" posY="-3731.8999" posZ="13.5" rotX="0" rotY="0" rotZ="0">
    "checkpoint (Dinghy) (1)" type="checkpoint" color="#00F9" vehicle="473" size="2.25" alpha="255" interior="0" nextid="checkpoint () (11)" posX="5874.2998" posY="-3709" posZ="13.5" rotX="0" rotY="0" rotZ="0">
    "checkpoint () (11)" type="ring" color="#00F9" size="5" alpha="255" interior="0" nextid="checkpoint () (12)" posX="5906.5" posY="-3678.1001" posZ="0" rotX="0" rotY="0" rotZ="150">
    "checkpoint () (12)" type="ring" color="#00F9" size="5" alpha="255" interior="0" nextid="checkpoint () (13)" posX="5951.8999" posY="-3707.7" posZ="0" rotX="0" rotY="0" rotZ="330">
    "checkpoint () (13)" type="ring" color="#00F9" size="5" alpha="255" interior="0" nextid="checkpoint () (14)" posX="6007.1001" posY="-3645.8" posZ="0" rotX="0" rotY="0" rotZ="330">
    "checkpoint () (14)" type="ring" color="#00F9" size="5" alpha="255" interior="0" nextid="checkpoint (Sunrise) (1)" posX="5972.7002" posY="-3577.5" posZ="0" rotX="0" rotY="0" rotZ="10">
    "checkpoint (Sunrise) (1)" type="ring" color="#00F9" vehicle="550" size="5" alpha="255" interior="0" nextid="checkpoint () (15)" posX="5903.5" posY="-3572.6001" posZ="0" rotX="0" rotY="0" rotZ="39.996">
    "object (vgnhseing42) (1)" breakable="true" interior="0" alpha="255" model="7494" doublesided="false" scale="1" dimension="0" posX="5865.1001" posY="-3587.3999" posZ="-2.9" rotX="0" rotY="0" rotZ="0"> 
    "racepickup (Hunter) (1)" type="vehiclechange" vehicle="425" respawn="0" posX="5848.8999" posY="-3556" posZ="1.6" rotX="0" rotY="0" rotZ="43.2">
    "racepickup (Hunter) (2)" type="vehiclechange" vehicle="425" respawn="0" alpha="255" interior="0" posX="5848.7998" posY="-3559" posZ="1.6" rotX="0" rotY="0" rotZ="300.06">
    "racepickup (Hunter) (3)" type="vehiclechange" vehicle="425" respawn="0" alpha="255" interior="0" posX="5848.8999" posY="-3561.7" posZ="1.6" rotX="0" rotY="0" rotZ="25.74">
    "racepickup (Hunter) (4)" type="vehiclechange" vehicle="425" respawn="0" alpha="255" interior="0" posX="5848.8999" posY="-3565" posZ="1.6" rotX="0" rotY="0" rotZ="80.28">
    "racepickup (Hunter) (5)" type="vehiclechange" vehicle="425" respawn="0" alpha="255" interior="0" posX="5849.1001" posY="-3568.2" posZ="1.6" rotX="0" rotY="0" rotZ="25.38">
    "racepickup (Hunter) (6)" type="vehiclechange" vehicle="425" respawn="0" alpha="255" interior="0" posX="5849" posY="-3571.7" posZ="1.6" rotX="0" rotY="0" rotZ="27.9">
    "racepickup (Hunter) (7)" type="vehiclechange" vehicle="425" respawn="0" alpha="255" interior="0" posX="5848.8999" posY="-3574.5" posZ="1.6" rotX="0" rotY="0" rotZ="7.74">
    "racepickup (Hunter) (8)" type="vehiclechange" vehicle="425" respawn="0" alpha="255" interior="0" posX="5848.7998" posY="-3577.3999" posZ="1.6" rotX="0" rotY="0" rotZ="90.54">
    "racepickup (Hunter) (9)" type="vehiclechange" vehicle="425" respawn="0" alpha="255" interior="0" posX="5848.7998" posY="-3580.8" posZ="1.6" rotX="0" rotY="0" rotZ="87.48">
    "racepickup (Hunter) (10)" type="vehiclechange" vehicle="425" respawn="0" alpha="255" interior="0" posX="5849.1001" posY="-3585" posZ="1.6" rotX="0" rotY="0" rotZ="223.38">
    "object (vgnhseing42) (2)" breakable="true" interior="0" alpha="255" model="7494" doublesided="false" scale="1" dimension="0" posX="5741" posY="-3577.3" posZ="7.3" rotX="0" rotY="0" rotZ="0"> 
    "object (vgnhseing42) (3)" breakable="true" interior="0" alpha="255" model="7494" doublesided="false" scale="1" dimension="0" posX="5735.2002" posY="-3577.3999" posZ="13.8" rotX="0" rotY="0" rotZ="0"> 
    "object (vgnhseing42) (4)" breakable="true" interior="0" alpha="255" model="7494" doublesided="false" scale="1" dimension="0" posX="5728.5" posY="-3577.5" posZ="20.3" rotX="0" rotY="0" rotZ="0"> 
    "object (laeexaminerbuild1) (1)" breakable="true" interior="0" alpha="255" model="5408" doublesided="false" scale="1" dimension="0" posX="5737.7998" posY="-3566.3" posZ="46.5" rotX="0" rotY="0" rotZ="0"> 
    "object (laehospital1) (1)" breakable="true" interior="0" alpha="255" model="5403" doublesided="false" scale="1" dimension="0" posX="5738.6001" posY="-3565.8" posZ="85" rotX="0" rotY="0" rotZ="0"> 
    "object (twintjail1_LAn) (1)" breakable="true" interior="0" alpha="255" model="4079" doublesided="false" scale="1" dimension="0" posX="5733.5" posY="-3562.5" posZ="135.39999" rotX="0" rotY="0" rotZ="0"> 
    "checkpoint () (15)" type="ring" color="#FFF60099" size="5" posX="5742" posY="-3564.2" posZ="137.39999" rotX="0" rotY="0" rotZ="0">

  

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...