Jump to content

*(طلب تصحيح كود ) [Solved]


Recommended Posts

السلام عليكم ورحمة الله وبركاته

اليوم مسوي مود حق الخروج من الوظيفة وتوقيف وتشغيل الوظيفة

المود كله تمام والحمد لله ,,

بس فيه مشكلة بسيطة

لما اجي اضغط تشغيل الوظيفة , بيرجع السكن لي + الألمنت داتا حقت الجوب

بس التيم مايرجعه , ويطلعني برا كل التيمات خخ

..

قلت يجوز فيه غلط رحت ضايف اوت بوت شات بوكس, رحت ضايف سطر 31

وفيه التحقق حق التيم , وبالفعل اشتغل وجاب اسم التيم ! ,, بس مدري عاد وش فيه ليه مايرجعني التيم

وذا الكود :)

-- Server.lua

  
  
addEvent("EndJobandStartJob",true) 
addEventHandler("EndJobandStartJob",root, 
function () 
    accountEndJob = getPlayerAccount ( source ) 
    teamName = getTeamName(getPlayerTeam(source)) 
if (teamName ~= "Unemployed") and not isPedInVehicle(source) then 
         setAccountData( accountEndJob,"getMyOccupation", tostring(getElementData( source, "Job"))) 
         setAccountData( accountEndJob,"getMySkin", tonumber(getElementModel(source))) 
         setAccountData( accountEndJob, "getMyTeam", tostring(getTeamName(getPlayerTeam(source)))) 
         setAccountData( accountEndJob, "getMyTagCouleur", getPlayerNametagColor(source)) 
                             setElementModel(source, 0) 
                             setClothes1() 
                             takeWeapon(source, 41 ) 
                             takeWeapon(source, 3 ) 
                             takeWeapon(source, 42 ) 
                             setPlayerTeam(source,unemployedTeam) 
                             setElementData(source, "Job",  false ) 
                             setPlayerNametagColor (source, 255,255,255 ) 
                             setAccountData( accountEndJob,"Job",tostring( getElementData(source, "Job", true ))) 
                       exports["TopBarChat"]:sendClientMessage ("You Are Ended Your Shift !",source, 255, 200, 0) 
  
elseif (teamName == "Unemployed") and not isPedInVehicle(source) then 
                              getSkinMy = getAccountData(accountEndJob, "getMySkin") 
                              getMyTeamS = getAccountData(accountEndJob, "getMyTeam") 
                              getOccupation = getAccountData(accountEndJob, "getMyOccupation") 
                              getTagC = getAccountData(accountEndJob, "getMyTagCouleur") 
                                setElementModel(source, tonumber(getSkinMy)) 
                                setPlayerTeam(source,tostring(getMyTeamS))  
outputChatBox("Your Team Has Been Changed To [ "..getMyTeamS.." ] [ "..tonumber(getTagC).." ] For Testing ",source,0,255,0) 
                                setPlayerNametagColor(source, tonumber(getTagC)) 
                                setElementData(source, "Job", tostring(getOccupation)) 
                exports["TopBarChat"]:sendClientMessage ("You Started Your Shift !",source, 255, 0, 0) 
          end 
end) 
  

ومشكورين مقدما :)

Edited by Guest
Link to comment

جرب

addEvent("EndJobandStartJob", true) 
addEventHandler("EndJobandStartJob", root, 
function() 
    local accountEndJob = getPlayerAccount(source) 
    local team = getPlayerTeam(source) 
    local teamName = team and getTeamName(team) or "" 
    if not isPedInVehicle(source) then 
        if (teamName ~= "Unemployed") then 
            setAccountData(accountEndJob,"getMyOccupation", tostring(getElementData(source, "Job"))) 
            setAccountData(accountEndJob,"getMySkin", getElementModel(source)) 
            setAccountData(accountEndJob, "getMyTeam", teamName) 
            local r, g, b = getPlayerNametagColor(source) 
            setAccountData(accountEndJob, "getMyTagCouleur", toJSON({r, g, b})) 
            setElementModel(source, 0) 
            setClothes1() 
            takeWeapon(source, 41) 
            takeWeapon(source, 3) 
            takeWeapon(source, 42) 
            setPlayerTeam(source, unemployedTeam) 
            setElementData(source, "Job",  false) 
            setPlayerNametagColor(source, 255, 255, 255) 
            setAccountData(accountEndJob, "Job", tostring(getElementData(source, "Job"))) 
            exports["TopBarChat"]:sendClientMessage("You Are Ended Your Shift !", source, 255, 200, 0) 
        elseif (teamName == "Unemployed") then 
            local getSkinMy = getAccountData(accountEndJob, "getMySkin") 
            local getMyTeamS = getAccountData(accountEndJob, "getMyTeam") 
            local getOccupation = getAccountData(accountEndJob, "getMyOccupation") 
            local getTagC = fromJSON(getAccountData(accountEndJob, "getMyTagCouleur")) 
            setElementModel(source, tonumber(getSkinMy)) 
            setPlayerTeam(source, getTeamFromName(getMyTeamS)) 
            outputChatBox("Your Team Has Been Changed To [ "..getMyTeamS.." ] For Testing ",source,0,255,0) 
            setPlayerNametagColor(source, getTagC[1], getTagC[2], getTagC[3]) 
            setElementData(source, "Job", getOccupation) 
            exports["TopBarChat"]:sendClientMessage ("You Started Your Shift !",source, 255, 0, 0) 
        end 
    end 
end) 

Link to comment
جرب
addEvent("EndJobandStartJob", true) 
addEventHandler("EndJobandStartJob", root, 
function() 
    local accountEndJob = getPlayerAccount(source) 
    local team = getPlayerTeam(source) 
    local teamName = team and getTeamName(team) or "" 
    if not isPedInVehicle(source) then 
        if (teamName ~= "Unemployed") then 
            setAccountData(accountEndJob,"getMyOccupation", tostring(getElementData(source, "Job"))) 
            setAccountData(accountEndJob,"getMySkin", getElementModel(source)) 
            setAccountData(accountEndJob, "getMyTeam", teamName) 
            local r, g, b = getPlayerNametagColor(source) 
            setAccountData(accountEndJob, "getMyTagCouleur", toJSON({r, g, b})) 
            setElementModel(source, 0) 
            setClothes1() 
            takeWeapon(source, 41) 
            takeWeapon(source, 3) 
            takeWeapon(source, 42) 
            setPlayerTeam(source, unemployedTeam) 
            setElementData(source, "Job",  false) 
            setPlayerNametagColor(source, 255, 255, 255) 
            setAccountData(accountEndJob, "Job", tostring(getElementData(source, "Job"))) 
            exports["TopBarChat"]:sendClientMessage("You Are Ended Your Shift !", source, 255, 200, 0) 
        elseif (teamName == "Unemployed") then 
            local getSkinMy = getAccountData(accountEndJob, "getMySkin") 
            local getMyTeamS = getAccountData(accountEndJob, "getMyTeam") 
            local getOccupation = getAccountData(accountEndJob, "getMyOccupation") 
            local getTagC = fromJSON(getAccountData(accountEndJob, "getMyTagCouleur")) 
            setElementModel(source, tonumber(getSkinMy)) 
            setPlayerTeam(source, getTeamFromName(getMyTeamS)) 
            outputChatBox("Your Team Has Been Changed To [ "..getMyTeamS.." ] For Testing ",source,0,255,0) 
            setPlayerNametagColor(source, getTagC[1], getTagC[2], getTagC[3]) 
            setElementData(source, "Job", getOccupation) 
            exports["TopBarChat"]:sendClientMessage ("You Started Your Shift !",source, 255, 0, 0) 
        end 
    end 
end) 

مشششششششكوووووووووووووور تاااااابل الكوود اشتغل :))

تسلم والله , تشرفت بمرورك :shock:

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