Jump to content

اخواتي حد يصلح لى هدا المود بالله


Recommended Posts

الكلينت

function centerWindow (center_window)
    local screenW, screenH = guiGetScreenSize()
    local windowW, windowH = guiGetSize(center_window, false)
    local x, y = (screenW - windowW) /2,(screenH - windowH) /2
    guiSetPosition(center_window, x, y, false)
end

        GUI = guiCreateWindow(530, 297, 281, 85, "Hours All", false)
        guiWindowSetSizable(GUI, false)
        guiSetVisible(GUI, false)
        centerWindow (GUI)
        
        Label = guiCreateLabel(10, 33, 58, 15, "Amount $::", false, GUI)
        Hours_Edit = guiCreateEdit(78, 31, 82, 21, "", false, GUI)
        guiEditSetMaxLength(Hours_Edit, 8)
        Boton_Send = guiCreateButton(170, 31, 47, 21, "Send", false, GUI)
        guiSetProperty(Boton_Send, "NormalTextColour", "FFAAAAAA")
        CopyRight = guiCreateLabel(10, 60, 261, 15, "Hours All", false, GUI)
        guiSetFont(CopyRight, "default-bold-small")
        guiLabelSetColor(CopyRight, 254, 120, 21)
        guiLabelSetHorizontalAlign(CopyRight, "center", false)
        Boton_Cancelar = guiCreateButton(223, 31, 47, 21, "Cancel", false, GUI)
        guiSetProperty(Boton_Cancelar, "NormalTextColour", "FFAAAAAA")    
        


function Open ()
    guiSetVisible(GUI, true)
    showCursor(true)
end
addEvent("Abrir", true)
addEventHandler("Abrir", getLocalPlayer(), Open)

function close ()
    guiSetVisible(GUI, false)
    showCursor(false)
end
addEventHandler("onClientGUIClick", Boton_Cancelar, close, false)

function sendm ()
    name = getPlayerName(getLocalPlayer())
    cantidad = guiGetText(Hours_Edit)
    triggerServerEvent("SendHours1",getRootElement(),cantidad,name)
end
addEventHandler("onClientGUIClick", Boton_Send, sendm, false)

 

===
Server
====


 

function onAdmins ( thePlayer )
local cuenta = getAccountName( getPlayerAccount(thePlayer) )
    if isObjectInACLGroup("user."..cuenta, aclGetGroup("Console")) then
        triggerClientEvent ( "Abrir", thePlayer)
    else
    end
end
addCommandHandler("Hours", onAdmins)

function Enviar (cantidad, name)
    givePlayerHours(getRootElement(), tonumber(cantidad))
    outputChatBox("تم توزيع ساعات للآعبين .."..cantidad, getRootElement(), 255, 255, 255, true)
end
addEvent("SendHours1", true)
addEventHandler("SendHours1", getRootElement(), Enviar)

Link to comment

اولا القصة الخطأ 
@!#NssoR_)
ثانيا استخدم 
p_7379mjwn1.png
مشان نفهم اكوادك
ثالثا 

52 minutes ago, HelpGuys said:

function Enviar (cantida
d, name)
    givePlayerHours(getRootElement(), tonumber(cantidad))
    outputChatBox("تم توزيع ساعات للآعبين .."..cantidad, getRootElement(), 255, 255, 255, true)
end
addEvent("SendHours1", true)
addEventHandler("SendHours1", getRootElement(), Enviar)

انت الان مش معرف الي هتعطيهم الساعات 
وبعدين من وين جبت هاد الفنكشن الجديد ؟.
givePlayerHours
ماحد علمني عنه ذا :) 
علي العموم الكود يصير كذا
 

function Enviar (cantidad, name)

for i,v in ipairs(getElementsByType("player")) do

setElementData(v, "PlayTime", getElementData(v,"PlayTime") or 0 ) + cantidad

end

outputChatBox("ساعة ["..cantidad.."] قامت الادارة بأعطاء حميع اللاعبين",root,255,255,255,true)

end

addEvent("SendHours1", true)

addEventHandler("SendHours1", getRootElement(), Enviar)

انا كتبت الكود بسرعة معرف اذا هو غلط او لا 
لو اني كتبته غلط احد يصححه له
ويلا برب شوي وراجع
 

Edited by #Himoo
Link to comment
1 hour ago, #Himoo said:

اولا القصة الخطأ 
@!#NssoR_)
ثانيا استخدم 
p_7379mjwn1.png
مشان نفهم اكوادك
ثالثا 

انت الان مش معرف الي هتعطيهم الساعات 
وبعدين من وين جبت هاد الفنكشن الجديد ؟.
givePlayerHours
ماحد علمني عنه ذا :) 
علي العموم الكود يصير كذا
 


function Enviar (cantidad, name)

for i,v in ipairs(getElementsByType("player")) do

setElementData(v, "PlayTime", getElementData(v,"PlayTime") or 0 ) + cantidad

end

outputChatBox("ساعة ["..cantidad.."] قامت الادارة بأعطاء حميع اللاعبين",root,255,255,255,true)

end

addEvent("SendHours1", true)

addEventHandler("SendHours1", getRootElement(), Enviar)

انا كتبت الكود بسرعة معرف اذا هو غلط او لا 
لو اني كتبته غلط احد يصححه له
ويلا برب شوي وراجع
 

اخي الغالي انا حطيت هذا في Server
طيب والحين كيف اطلع لوحة؟

function centerWindow (center_window)
    local screenW, screenH = guiGetScreenSize()
    local windowW, windowH = guiGetSize(center_window, false)
    local x, y = (screenW - windowW) /2,(screenH - windowH) /2
    guiSetPosition(center_window, x, y, false)
end

        GUI = guiCreateWindow(530, 297, 281, 85, "Hours All Chat", false)
        guiWindowSetSizable(GUI, false)
        guiSetVisible(GUI, false)
        centerWindow (GUI)
        
        Label = guiCreateLabel(10, 33, 58, 15, "Amount $::", false, GUI)
        Hours_Edit = guiCreateEdit(78, 31, 82, 21, "", false, GUI)
        guiEditSetMaxLength(Hours_Edit, 8)
        Boton_Send = guiCreateButton(170, 31, 47, 21, "Send", false, GUI)
        guiSetProperty(Boton_Send, "NormalTextColour", "FFAAAAAA")
        CopyRight = guiCreateLabel(10, 60, 261, 15, "Created By TounsiPro", false, GUI)
        guiSetFont(CopyRight, "default-bold-small")
        guiLabelSetColor(CopyRight, 254, 120, 21)
        guiLabelSetHorizontalAlign(CopyRight, "center", false)
        Boton_Cancelar = guiCreateButton(223, 31, 47, 21, "Cancel", false, GUI)
        guiSetProperty(Boton_Cancelar, "NormalTextColour", "FFAAAAAA")    
        


function Open ()
    guiSetVisible(GUI, true)
    showCursor(true)
end
addEvent("Abrir", true)
addEventHandler("Abrir", getLocalPlayer(), Open)

function close ()
    guiSetVisible(GUI, false)
    showCursor(false)
end
addEventHandler("onClientGUIClick", Boton_Cancelar, close, false)

function sendm ()
    name = getPlayerName(getLocalPlayer())
    cantidad = guiGetText(Hours_Edit)
    triggerServerEvent("SendHours1",getRootElement(),cantidad,name)
end
addEventHandler("onClientGUIClick", Boton_Send, sendm, false)

function centerWindow (center_window)
    local screenW, screenH = guiGetScreenSize()
    local windowW, windowH = guiGetSize(center_window, false)
    local x, y = (screenW - windowW) /2,(screenH - windowH) /2
    guiSetPosition(center_window, x, y, false)
end

        GUI = guiCreateWindow(530, 297, 281, 85, "Hours All Chat", false)
        guiWindowSetSizable(GUI, false)
		guiSetVisible(GUI, false)
		centerWindow (GUI)
		
        Label = guiCreateLabel(10, 33, 58, 15, "Amount $::", false, GUI)
        Hours_Edit = guiCreateEdit(78, 31, 82, 21, "", false, GUI)
        guiEditSetMaxLength(Hours_Edit, 8)
        Boton_Send = guiCreateButton(170, 31, 47, 21, "Send", false, GUI)
        guiSetProperty(Boton_Send, "NormalTextColour", "FFAAAAAA")
        CopyRight = guiCreateLabel(10, 60, 261, 15, "Created By TounsiPro", false, GUI)
        guiSetFont(CopyRight, "default-bold-small")
        guiLabelSetColor(CopyRight, 254, 120, 21)
        guiLabelSetHorizontalAlign(CopyRight, "center", false)
        Boton_Cancelar = guiCreateButton(223, 31, 47, 21, "Cancel", false, GUI)
        guiSetProperty(Boton_Cancelar, "NormalTextColour", "FFAAAAAA")    
		


function Open ()
	guiSetVisible(GUI, true)
	showCursor(true)
end
addEvent("Abrir", true)
addEventHandler("Abrir", getLocalPlayer(), Open)

function close ()
	guiSetVisible(GUI, false)
	showCursor(false)
end
addEventHandler("onClientGUIClick", Boton_Cancelar, close, false)

function sendm ()
	name = getPlayerName(getLocalPlayer())
	cantidad = guiGetText(Hours_Edit)
	triggerServerEvent("SendHours1",getRootElement(),cantidad,name)
end
addEventHandler("onClientGUIClick", Boton_Send, sendm, false)

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

Link to comment
19 hours ago, #Himoo said:

اولا القصة الخطأ 
@!#NssoR_)
ثانيا استخدم 
p_7379mjwn1.png
مشان نفهم اكوادك
ثالثا 

انت الان مش معرف الي هتعطيهم الساعات 
وبعدين من وين جبت هاد الفنكشن الجديد ؟.
givePlayerHours
ماحد علمني عنه ذا :) 
علي العموم الكود يصير كذا
 


function Enviar (cantidad, name)

for i,v in ipairs(getElementsByType("player")) do

setElementData(v, "PlayTime", getElementData(v,"PlayTime") or 0 ) + cantidad

end

outputChatBox("ساعة ["..cantidad.."] قامت الادارة بأعطاء حميع اللاعبين",root,255,255,255,true)

end

addEvent("SendHours1", true)

addEventHandler("SendHours1", getRootElement(), Enviar)

انا كتبت الكود بسرعة معرف اذا هو غلط او لا 
لو اني كتبته غلط احد يصححه له
ويلا برب شوي وراجع
 

17 hours ago, HelpGuys said:

رد ي اخي

 

Link to comment
On 1/7/2018 at 18:40, HelpGuys said:

اخي الغالي انا حطيت هذا في Server
طيب والحين كيف اطلع لوحة؟

function centerWindow (center_window)
    local screenW, screenH = guiGetScreenSize()
    local windowW, windowH = guiGetSize(center_window, false)
    local x, y = (screenW - windowW) /2,(screenH - windowH) /2
    guiSetPosition(center_window, x, y, false)
end

        GUI = guiCreateWindow(530, 297, 281, 85, "Hours All Chat", false)
        guiWindowSetSizable(GUI, false)
        guiSetVisible(GUI, false)
        centerWindow (GUI)
        
        Label = guiCreateLabel(10, 33, 58, 15, "Amount $::", false, GUI)
        Hours_Edit = guiCreateEdit(78, 31, 82, 21, "", false, GUI)
        guiEditSetMaxLength(Hours_Edit, 8)
        Boton_Send = guiCreateButton(170, 31, 47, 21, "Send", false, GUI)
        guiSetProperty(Boton_Send, "NormalTextColour", "FFAAAAAA")
        CopyRight = guiCreateLabel(10, 60, 261, 15, "Created By TounsiPro", false, GUI)
        guiSetFont(CopyRight, "default-bold-small")
        guiLabelSetColor(CopyRight, 254, 120, 21)
        guiLabelSetHorizontalAlign(CopyRight, "center", false)
        Boton_Cancelar = guiCreateButton(223, 31, 47, 21, "Cancel", false, GUI)
        guiSetProperty(Boton_Cancelar, "NormalTextColour", "FFAAAAAA")    
        


function Open ()
    guiSetVisible(GUI, true)
    showCursor(true)
end
addEvent("Abrir", true)
addEventHandler("Abrir", getLocalPlayer(), Open)

function close ()
    guiSetVisible(GUI, false)
    showCursor(false)
end
addEventHandler("onClientGUIClick", Boton_Cancelar, close, false)

function sendm ()
    name = getPlayerName(getLocalPlayer())
    cantidad = guiGetText(Hours_Edit)
    triggerServerEvent("SendHours1",getRootElement(),cantidad,name)
end
addEventHandler("onClientGUIClick", Boton_Send, sendm, false)


function centerWindow (center_window)
    local screenW, screenH = guiGetScreenSize()
    local windowW, windowH = guiGetSize(center_window, false)
    local x, y = (screenW - windowW) /2,(screenH - windowH) /2
    guiSetPosition(center_window, x, y, false)
end

        GUI = guiCreateWindow(530, 297, 281, 85, "Hours All Chat", false)
        guiWindowSetSizable(GUI, false)
		guiSetVisible(GUI, false)
		centerWindow (GUI)
		
        Label = guiCreateLabel(10, 33, 58, 15, "Amount $::", false, GUI)
        Hours_Edit = guiCreateEdit(78, 31, 82, 21, "", false, GUI)
        guiEditSetMaxLength(Hours_Edit, 8)
        Boton_Send = guiCreateButton(170, 31, 47, 21, "Send", false, GUI)
        guiSetProperty(Boton_Send, "NormalTextColour", "FFAAAAAA")
        CopyRight = guiCreateLabel(10, 60, 261, 15, "Created By TounsiPro", false, GUI)
        guiSetFont(CopyRight, "default-bold-small")
        guiLabelSetColor(CopyRight, 254, 120, 21)
        guiLabelSetHorizontalAlign(CopyRight, "center", false)
        Boton_Cancelar = guiCreateButton(223, 31, 47, 21, "Cancel", false, GUI)
        guiSetProperty(Boton_Cancelar, "NormalTextColour", "FFAAAAAA")    
		


function Open ()
	guiSetVisible(GUI, true)
	showCursor(true)
end
addEvent("Abrir", true)
addEventHandler("Abrir", getLocalPlayer(), Open)

function close ()
	guiSetVisible(GUI, false)
	showCursor(false)
end
addEventHandler("onClientGUIClick", Boton_Cancelar, close, false)

function sendm ()
	name = getPlayerName(getLocalPlayer())
	cantidad = guiGetText(Hours_Edit)
	triggerServerEvent("SendHours1",getRootElement(),cantidad,name)
end
addEventHandler("onClientGUIClick", Boton_Send, sendm, false)

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

ورني السيرفر كامل ...

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