Jump to content

missiontimer script


Recommended Posts

Posted

السلام عليكم

كيف آلحال

لآهنت ابي الآفنت حق missiontimer

لما ينتهي الوقت

يعني مثلا اذا انتهى الوقت الي انا مسويه

يطلع كلام او شيء

لاهنتم كيف او فيه افنت او شيء؟

Posted
g_MissionTimer = exports.missiontimer:createMissionTimer (g_TimeLimit,true,"%m:%s",0.5,20,true,"default-bold",1,255,255,255) 
  
addEvent("onMissionTimerElapsed",true) 
addEventHandler ( "onMissionTimerElapsed", g_MissionTimer, onTimeElapsed ) 
function onTimeElapsed() 
outputChatBox("finished") 
end 

أنتبه انه ثاني ارقمنت في سيت ايفت هاندلر ماهو روت

يكون التايمر الي انت صنعته ولو حطيته روت لازم تتحقق انه السورس هو التايمر الي انت صنعته

Posted

نفس آلمشكله ماضبط

هذا الكود الي سويته

addEvent("onMissionTimerElapsed",true) 
addEventHandler ( "onMissionTimerElapsed", g_MissionTimer[plr], onTimeElapsed ) 
function onTimeElapsed () 
outputChatBox ( "Sorry . .",255,0,0, true ) 
setElementData ( plr, "Mission", false ) 
destroyElement ( g_MissionTimer[plr] ) 
destroyElement ( marker[plr] ) 
destroyElement ( blip[plr] ) 
triggerServerEvent ( "lost", plr ) 
playSound ("Failed.mp3") 
    end   

وهذآ آلدي بق

http://i.imgur.com/odZ0e8y.png[/lua]

Posted

ضايف الأفنت قبل ما تسوي الفنكشن

plr مو معرف

سيرفر مو كلينت onMissionTimerElapsed الأفنت

onClientMissionTimerElapsed افنت الكلينت ذا

Posted

تم حل آلمشكله لآن آلفنكشن لما تضغط على زر يتسوى والافنت سويته اول مايشتغل المود عدلته شكرا

لكن جتني مشكله مع جدول ماركرات مسوي احداثيات وابي اجيب مكان عشوائي من الجدول يعني لكن مو راضي يضبط

هذا الجدول

local Pos = { 
"2256.3002929688, -32.617202758789, 25.854259490967", 
"202.38770, -171.71777, 1.57813", 
"1659.88159, -2750.91919, 5.61213", 
"-545.02142, -188.77968, 78.40625", 
"-425.84491, -438.46176, 17.12580" 
} 
  
local x, y, z = math.random(#Pos) 
marker[plr] = createMarker ( x, y, z ,"checkpoint", 5, 255, 0, 0 ) 
  

Posted

plr تأكد انك معرف

local Pos = { 
    {2256.3, -32.6, 25.855}, 
    {202.388, -171.7, 1.58}, 
    {1659.88, -2750.8, 5.61}, 
    {-545.02, -188.78, 78.4}, 
    {-425.85, -438.46176, 17.12} 
} 
  
local x, y, z = unpack(Pos[math.random(#Pos)]) 
marker[plr] = createMarker(x, y, z ,"checkpoint", 5, 255, 0, 0) 

Posted

ششكرآ مآقصرت

لكن بما ان موضوعي للحين في آلصفحه الاولى مايحتاج اسوي موضوع ثاني

عندي مشكله مع ماركر انا مسوي ماركر كلنت ولما يلمس الماركر تطلع له نافذه لكن المشكله النافذه تطلع للكل وش الحل ؟

  
addEventHandler("onClientMarkerHit", getRootElement(), 
function () 
if ( source == mrk ) then 
if isPedInVehicle(plr) then outputChatBox ("#8A010A You can not open the window and you're inside the car",plr,255,0,0,true) return end 
if getElementData ( plr, "Mission" ) == Yes  then outputChatBox ("#8A010A You already have this job",plr,255,0,0,true) return end 
 guiSetVisible ( wnd ,true ) 
 showCursor ( true ) 
 guiSetInputEnabled(true) 
   end 
end) 
  

Posted
addEventHandler("onClientMarkerHit", root, 
function(plr) 
    if plr == localPlayer and source == mrk then 
        if not isPedInVehicle(plr) then 
            if getElementData(plr, "Mission") ~= "Yes" then 
                guiSetVisible(wnd, true) 
                showCursor(true) 
                guiSetInputEnabled(true) 
            else 
                outputChatBox("#8A010A You already have this job", 255, 0, 0, true) 
            end 
        else 
            outputChatBox("#8A010A You can not open the window and you're inside the car", 255, 0, 0, true) 
        end 
    end 
end) 

Posted

يعطيك العافيه , لكن عندي سؤآل

آخبر شفت فنكشن انت حطيته

يجيب اعلى قيمه

يعني انا الحين ابي اجيب اللاعبين كلهم واجيب قتلاتهم واجيب اعلى واحد قتل واحطه ب ليبل وش الفنكشنات؟

Posted
  
 Scores = { } 
  
addEventHandler("onElementDataChange",getRootElement(), 
function (dataName) 
 if dataName == "Score" then 
for _,plrs in ipairs (getElementsByType ("player")) do 
frags = getElementData ( plrs, "Score" ) 
table.insert ( Scores, ( frag )) 
table.sort ( Scores ) 
outputChatBox (tostring ( unpack [Scores] )) 
        end 
    end 
end 
) 

كذا ؟

مع العلم اني انا بس ابي اجيب قيمه وحده الي هي اعلى قيمه !

Posted (edited)

جرب

 Scores = { } 
  
addEventHandler("onElementDataChange",root, 
function (dataName) 
    if dataName == "Score" then 
        for _,v in ipairs (getElementsByType ("player")) do 
            table.insert ( Scores, { getPlayerName(v), ( getElementData ( v, "Score" ) or 0 ) }) 
        end 
    table.sort (Scores,function (v1, v2)return v1[2] > v2[2]end) 
    outputChatBox (Scores[1][1].." - "..Scores[1][2]) 
    end 
end ) 
  
Edited by Guest

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