Jump to content

* ارجوو المساعده ي شباب *


Recommended Posts

علعافيه ي شباب , بتمنى تساعدوني , لمشكله انوو لما احط رقصه ولاعب يضربني تتوقف , ثاني مشكله , انوو لما اضغط على لوحه

تووقف , يعني لازم بس على زر close تتووقف ,  

ثالث مشكله حل سطر 34 # وشككرا


--- ملف لكلينت ---

local resX, resY = guiGetScreenSize()

function makeAnimationGUI()
	animationWindow = guiCreateWindow(200, 90, 337, 369,"Animation System",false)
    guiSetVisible(animationWindow,false)
    animationCategoryList = guiCreateGridList(29, 64, 140, 254,false,animationWindow)
    guiSetAlpha(animationCategoryList, 1.100)
    animationList = guiCreateGridList(174, 64, 140, 254,false,animationWindow)
    guiSetAlpha(animationList, 1.100)
    column1 = guiGridListAddColumn(animationCategoryList,"Category",0.8)
    guiGridListSetItemColor(column1,5, 249, 255)
    column2 = guiGridListAddColumn(animationList,"Animation",0.8)
	stopButton = guiCreateButton(81, 330, 182, 26, "Stop", false, animationWindow)
	guiSetAlpha(stopButton, 1.100)
	
	    guiSetVisible (animationWindow,false)
        guiWindowSetMovable(animationWindow,true)
        guiWindowSetSizable(animationWindow,false)
        guiSetVisible(animationWindow,false)
        showCursor(false)
	
    addEventHandler("onClientGUIClick",stopButton,function() setPedAnimation(getLocalPlayer(),nil,nil) end)
        for k, v in ipairs (getElementsByType("animationCategory")) do
            local row = guiGridListAddRow(animationCategoryList)
            guiGridListSetItemText(animationCategoryList,row,column1,getElementID(v),false,false)
        end
addEventHandler("onClientGUIClick",animationCategoryList,getAnimations)
addEventHandler("onClientGUIClick",animationList,setAnimation)
end
addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),makeAnimationGUI)

bindKey('F3','down',
function()
guiSetVisible(animationWindow, not guiGetVisible(animationWindow))
showCursor(not isCursorShowing())
end
)

function getAnimations()
    selectedCategory = guiGridListGetItemText(animationCategoryList,guiGridListGetSelectedItem(animationCategoryList),1)
        if (selectedCategory ~= "") then
            guiGridListClear(animationList)
                for k, v in ipairs (getElementChildren(getElementByID(selectedCategory))) do
                    local row = guiGridListAddRow(animationList)
                    guiGridListSetItemText(animationList,row,column1,getElementID(v),false,false)
                end
        end
        if (selectedCategory == "") then
            guiGridListClear(animationList)
        end
end

function setAnimation()
    selectedAnimation = guiGridListGetItemText(animationList,guiGridListGetSelectedItem(animationList),1)
        if (selectedAnimation ~= "") then
            if (not isPlayerDead(getLocalPlayer())) then
                if (isPedInVehicle(getLocalPlayer()) == false) then
                    local animationBlock = getElementData(getElementByID(selectedAnimation),"block")
                    local animationID = getElementData(getElementByID(selectedAnimation),"code")
                    triggerServerEvent("setAnimation",getLocalPlayer(),animationBlock,animationID)
                else
                    outputChatBox("You cannot use animations while in a vehicle.",255,0,0)
                end
            else
                outputChatBox("You cannot use animations while you are dead.",255,0,0)
            end
        end
end


--- ملف سيرفر ---

function setAnimation(animationBlock,animationID)
setPedAnimation(source,animationBlock,animationID)
end
addEvent("setAnimation",true)
addEventHandler ("setAnimation",getRootElement(),setAnimation)

 

Edited by #NaMrOo'D
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...