Jump to content

ما هو الخطا


FAHD+18

Recommended Posts

السلام عليكم اليوم انا سويت لوحه ادمن مثلا وعايز اعطي لاعب تصليح او نيترو ! معرف ليش خطا  المشكلة الاولي اتحلت المشكلة التانية اني عايز اعمل زرار تصليح سيارة انا سويتة بس ما يشتغل اللوحة تفتح وكل شي بس اضغط علية ما يحصل شي هل انا مسوي شي غلط الرجاء المساعدة والكشف عن الخطا اوضح اكتر يعني عندما اضغط علي الزر واختار اللاعب من القريد لست يعطية تصليح انا مسوي كدا بس معرف شو المشكلة

local Key = "F1" 
GUIEditor = {
    edit = {},
    button = {},
    window = {},
    label = {},
    gridlist = {}
}

        GUIEditor.window[1] = guiCreateWindow(190, 166, 405, 305, "Admin x2", false)
        guiWindowSetSizable(GUIEditor.window[1], false)
        GUIEditor.gridlist[1] = guiCreateGridList(10, 62, 134, 233, false, GUIEditor.window[1])
        guiGridListAddColumn(GUIEditor.gridlist[1], "Players:", 0.9)
        GUIEditor.edit[1] = guiCreateEdit(18, 38, 116, 19, "", false, GUIEditor.window[1])
        GUIEditor.label[1] = guiCreateLabel(55, 23, 99, 15, "Search ", false, GUIEditor.window[1])
        guiSetFont(GUIEditor.label[1], "default-bold-small")
        GUIEditor.button[1] = guiCreateButton(172, 62, 184, 35, "Mute", false, GUIEditor.window[1])
        guiSetFont(GUIEditor.button[1], "default-bold-small")
        GUIEditor.edit[2] = guiCreateEdit(154, 118, 227, 30, "", false, GUIEditor.window[1])
        GUIEditor.label[2] = guiCreateLabel(47, -14, 170, 15, "What is Resson", false, GUIEditor.edit[2])
        GUIEditor.label[3] = guiCreateLabel(210, 97, 120, 15, "What is The Resson :", false, GUIEditor.window[1])
        guiSetFont(GUIEditor.label[3], "default-bold-small")
        GUIEditor.button[2] = guiCreateButton(164, 155, 94, 20, "Slap", false, GUIEditor.window[1])
        GUIEditor.button[3] = guiCreateButton(277, 155, 94, 20, "Kick", false, GUIEditor.window[1])
        GUIEditor.button[4] = guiCreateButton(163, 193, 208, 29, "Fly Car", false, GUIEditor.window[1])
        GUIEditor.button[5] = guiCreateButton(163, 232, 94, 20, "FIX", false, GUIEditor.window[1])
        GUIEditor.button[6] = guiCreateButton(277, 232, 94, 20, "Nitro", false, GUIEditor.window[1])
        GUIEditor.label[4] = guiCreateLabel(163, 170, 212, 15, "______________________________", false, GUIEditor.window[1])
        GUIEditor.label[5] = guiCreateLabel(297, 283, 148, 18, "Creat by FAHD v2", false, GUIEditor.window[1])
        guiLabelSetColor(GUIEditor.label[5], 254, 0, 0)   
        guiSetVisible ( GUIEditor.window[1], false )

bindKey ( Key, "down", 
    function ( )
        if guiGetVisible ( GUIEditor.window[1] ) then 
            guiSetVisible ( GUIEditor.window[1], false )
            showCursor ( false )
        else
            guiSetVisible ( GUIEditor.window[1], true )
            showCursor ( true )
        end
    end
)

function Players ( )
guiGridListClear ( GUIEditor.gridlist[1] )
for id, players in ipairs(getElementsByType("player")) do 
local Row = guiGridListAddRow ( GUIEditor.gridlist[1] )
guiGridListSetItemText ( GUIEditor.gridlist[1], Row ,1, getPlayerName ( players ), false, false )
end
end
addEventHandler ( 'onClientResourceStart' , resourceRoot , Players )
addEventHandler( "onClientPlayerJoin", root, Players )
addEventHandler( "onClientPlayerQuit", root, Players )
addEventHandler( "onClientPlayerChangeNick", root, Players )

addEventHandler("onClientGUIClick",root, 
function (    ) 
    if ( source == button[5] ) then 
        triggerServerEvent ( "fixVehicle", localPlayer )  
    end 
end ) 

يعني عندما اضغط علي الجريد لست اختار لاعب منها وادوس علي تصليح fix

السيارة تتصلح 

هل الكود صحيح او خطا

Client---

addEventHandler("onClientGUIClick",root, 
function (    ) 
    if ( source == button[5] ) then 
        triggerServerEvent ( "fixVehicle", localPlayer )  
    end 
end ) 


Server---

addEvent ( "fixVehicle", true) 
addEventHandler ( "fixVehicle", root, 
function (    ) 
        if ( isPedInVehicle ( source ) ) then 
                fixVehicle ( getPedOccupiedVehicle ( source ) )  
        end 
    end 
end ) 
الرجاء المساعدة ..وشكرا (مبرمج في جديد) في البداية لسا :(

واسف لو نزلت موضعين الرجاء اغلاق الموضوع التاني وشكرا 

 

Link to comment
--Client

addEventHandler("onClientGUIClick",root,
function ( )
if ( source == Button ) then
if ( guiGridListGetSelectedItem(List ) ~= -1 ) then
local plr = guiGridListGetItemText(List ,guiGridListGetSelectedItem(List ),1)

local player = getPlayerFromName ( plr )

triggerServerEvent ( "fixVehicle", localPlayer , plr ) 
end 
end ) 





 
-- Server
addEvent ( "fixVehicle", true)
 addEventHandler ( "fixVehicle", root,
 function ( plr )
 if ( isPedInVehicle ( plr ) ) then
 fixVehicle ( getPedOccupiedVehicle ( plr ) )
 end
 end
 end )

 

بدل list لقريد ليست حقك

 

Edited by [6ArH]#~Ecoo~
  • Like 1
Link to comment
--Client

addEventHandler("onClientGUIClick",root,
function ( )
if ( source == Button ) then
if ( guiGridListGetSelectedItem(GUIEditor.gridlist[1] ) ~= -1 ) then
local plr = guiGridListGetItemText(GUIEditor.gridlist[1] ,guiGridListGetSelectedItem(GUIEditor.gridlist[1] ),1)

local player = getPlayerFromName ( plr )

triggerServerEvent ( "fixVehicle", localPlayer , plr ) 
end 
end ) 





 

جربه ورد لي خبر

-- Server
addEvent ( "fixVehicle", true)
 addEventHandler ( "fixVehicle", root,
 function ( plr )
 if ( isPedInVehicle ( plr ) ) then
 fixVehicle ( getPedOccupiedVehicle ( plr ) )
 end
 end
 end )

 

 

Link to comment

p_349322191.png

ما اشتغلت 

شوف كدا الميتا وسلينت و السيرفر 

meta ---

<meta>
    <script src="S.lua" type="Server" cache="false"/>        
    <script src="C.lua" type="client" cache="false"/>        
</meta>

Client ---

local Key = "F1" 
GUIEditor = {
    edit = {},
    button = {},
    window = {},
    label = {},
    gridlist = {}
}

        GUIEditor.window[1] = guiCreateWindow(190, 166, 405, 305, "Admin x2", false)
        guiWindowSetSizable(GUIEditor.window[1], false)
        GUIEditor.gridlist[1] = guiCreateGridList(10, 62, 134, 233, false, GUIEditor.window[1])
        guiGridListAddColumn(GUIEditor.gridlist[1], "Players:", 0.9)
        GUIEditor.edit[1] = guiCreateEdit(18, 38, 116, 19, "", false, GUIEditor.window[1])
        GUIEditor.label[1] = guiCreateLabel(55, 23, 99, 15, "Search ", false, GUIEditor.window[1])
        guiSetFont(GUIEditor.label[1], "default-bold-small")
        GUIEditor.button[1] = guiCreateButton(172, 62, 184, 35, "Mute", false, GUIEditor.window[1])
        guiSetFont(GUIEditor.button[1], "default-bold-small")
        GUIEditor.edit[2] = guiCreateEdit(154, 118, 227, 30, "", false, GUIEditor.window[1])
        GUIEditor.label[2] = guiCreateLabel(47, -14, 170, 15, "What is Resson", false, GUIEditor.edit[2])
        GUIEditor.label[3] = guiCreateLabel(210, 97, 120, 15, "What is The Resson :", false, GUIEditor.window[1])
        guiSetFont(GUIEditor.label[3], "default-bold-small")
        GUIEditor.button[2] = guiCreateButton(164, 155, 94, 20, "Slap", false, GUIEditor.window[1])
        GUIEditor.button[3] = guiCreateButton(277, 155, 94, 20, "Kick", false, GUIEditor.window[1])
        GUIEditor.button[4] = guiCreateButton(163, 193, 208, 29, "Fly Car", false, GUIEditor.window[1])
        GUIEditor.button[5] = guiCreateButton(163, 232, 94, 20, "FIX", false, GUIEditor.window[1])
        GUIEditor.button[6] = guiCreateButton(277, 232, 94, 20, "Nitro", false, GUIEditor.window[1])
        GUIEditor.label[4] = guiCreateLabel(163, 170, 212, 15, "______________________________", false, GUIEditor.window[1])
        GUIEditor.label[5] = guiCreateLabel(297, 283, 148, 18, "Creat by FAHD v2", false, GUIEditor.window[1])
        guiLabelSetColor(GUIEditor.label[5], 254, 0, 0)   
        guiSetVisible ( GUIEditor.window[1], false )

bindKey ( Key, "down", 
    function ( )
        if guiGetVisible ( GUIEditor.window[1] ) then 
            guiSetVisible ( GUIEditor.window[1], false )
            showCursor ( false )
        else
            guiSetVisible ( GUIEditor.window[1], true )
            showCursor ( true )
        end
    end
)

function Players ( )
guiGridListClear ( GUIEditor.gridlist[1] )
for id, players in ipairs(getElementsByType("player")) do 
local Row = guiGridListAddRow ( GUIEditor.gridlist[1] )
guiGridListSetItemText ( GUIEditor.gridlist[1], Row ,1, getPlayerName ( players ), false, false )
end
end
addEventHandler ( 'onClientResourceStart' , resourceRoot , Players )
addEventHandler( "onClientPlayerJoin", root, Players )
addEventHandler( "onClientPlayerQuit", root, Players )
addEventHandler( "onClientPlayerChangeNick", root, Players )

addEventHandler("onClientGUIClick",root,
function ( )
if ( source == Button ) then
if ( guiGridListGetSelectedItem(GUIEditor.gridlist[1] ) ~= -1 ) then
local plr = guiGridListGetItemText(GUIEditor.gridlist[1] ,guiGridListGetSelectedItem(GUIEditor.gridlist[1] ),1)

local player = getPlayerFromName ( plr )

triggerServerEvent ( "fixVehicle", localPlayer , plr ) 
end 
end ) 
  
server ---
  
addEvent ( "fixVehicle", true)
 addEventHandler ( "fixVehicle", root,
 function ( plr )
 if ( isPedInVehicle ( plr ) ) then
 fixVehicle ( getPedOccupiedVehicle ( plr ) )
 end
 end
 end )

اسف اني تاعبك معي

Link to comment
--Client
addEventHandler("onClientGUIClick",root,
function ( )
if ( source == Button ) then
if ( guiGridListGetSelectedItem(GUIEditor.gridlist[1] ) ~= -1 ) then
local plr = guiGridListGetItemText(GUIEditor.gridlist[1] ,guiGridListGetSelectedItem(GUIEditor.gridlist[1] ),1)
local player = getPlayerFromName ( plr )
triggerServerEvent ( "fixVehicle", localPlayer , plr ) 
end 
end
end ) 
 

 

Link to comment
2 minutes ago, Brain said:

p_349zk3d51.png

غير الزرار ...
فيه عندك شئ اسمه

الكود بيكون كذا

addEventHandler("onClientGUIClick",root,
function ( )
if ( source == GUIEditor.button[5] ) then
if ( guiGridListGetSelectedItem(GUIEditor.gridlist[1] ) ~= -1 ) then
local plr = guiGridListGetItemText(GUIEditor.gridlist[1] ,guiGridListGetSelectedItem(GUIEditor.gridlist[1] ),1)
local player = getPlayerFromName ( plr )
triggerServerEvent ( "fixVehicle", localPlayer , plr ) 
end 
end
end ) 

 

Edited by Abu-Solo
Link to comment
local Key = "F1" 
GUIEditor = {
    edit = {},
    button = {},
    window = {},
    label = {},
    gridlist = {}
}

        GUIEditor.window[1] = guiCreateWindow(190, 166, 405, 305, "Admin x2", false)
        guiWindowSetSizable(GUIEditor.window[1], false)
        GUIEditor.gridlist[1] = guiCreateGridList(10, 62, 134, 233, false, GUIEditor.window[1])
        guiGridListAddColumn(GUIEditor.gridlist[1], "Players:", 0.9)
        GUIEditor.edit[1] = guiCreateEdit(18, 38, 116, 19, "", false, GUIEditor.window[1])
        GUIEditor.label[1] = guiCreateLabel(55, 23, 99, 15, "Search ", false, GUIEditor.window[1])
        guiSetFont(GUIEditor.label[1], "default-bold-small")
        GUIEditor.button[1] = guiCreateButton(172, 62, 184, 35, "Mute", false, GUIEditor.window[1])
        guiSetFont(GUIEditor.button[1], "default-bold-small")
        GUIEditor.edit[2] = guiCreateEdit(154, 118, 227, 30, "", false, GUIEditor.window[1])
        GUIEditor.label[2] = guiCreateLabel(47, -14, 170, 15, "What is Resson", false, GUIEditor.edit[2])
        GUIEditor.label[3] = guiCreateLabel(210, 97, 120, 15, "What is The Resson :", false, GUIEditor.window[1])
        guiSetFont(GUIEditor.label[3], "default-bold-small")
        GUIEditor.button[2] = guiCreateButton(164, 155, 94, 20, "Slap", false, GUIEditor.window[1])
        GUIEditor.button[3] = guiCreateButton(277, 155, 94, 20, "Kick", false, GUIEditor.window[1])
        GUIEditor.button[4] = guiCreateButton(163, 193, 208, 29, "Fly Car", false, GUIEditor.window[1])
        GUIEditor.button[5] = guiCreateButton(163, 232, 94, 20, "FIX", false, GUIEditor.window[1])
        GUIEditor.button[6] = guiCreateButton(277, 232, 94, 20, "Nitro", false, GUIEditor.window[1])
        GUIEditor.label[4] = guiCreateLabel(163, 170, 212, 15, "______________________________", false, GUIEditor.window[1])
        GUIEditor.label[5] = guiCreateLabel(297, 283, 148, 18, "Creat by FAHD v2", false, GUIEditor.window[1])
        guiLabelSetColor(GUIEditor.label[5], 254, 0, 0)   
        guiSetVisible ( GUIEditor.window[1], false )

bindKey ( Key, "down", 
    function ( )
        if guiGetVisible ( GUIEditor.window[1] ) then 
            guiSetVisible ( GUIEditor.window[1], false )
            showCursor ( false )
        else
            guiSetVisible ( GUIEditor.window[1], true )
            showCursor ( true )
        end
    end
)

function Players ( )
guiGridListClear ( GUIEditor.gridlist[1] )
for id, players in ipairs(getElementsByType("player")) do 
local Row = guiGridListAddRow ( GUIEditor.gridlist[1] )
guiGridListSetItemText ( GUIEditor.gridlist[1], Row ,1, getPlayerName ( players ), false, false )
end
end
addEventHandler ( 'onClientResourceStart' , resourceRoot , Players )
addEventHandler( "onClientPlayerJoin", root, Players )
addEventHandler( "onClientPlayerQuit", root, Players )
addEventHandler( "onClientPlayerChangeNick", root, Players )

addEventHandler("onClientGUIClick",root,
function ( )
if ( source == button[5] ) then
if ( guiGridListGetSelectedItem(GUIEditor.gridlist[1] ) ~= -1 ) then
local plr = guiGridListGetItemText(GUIEditor.gridlist[1] ,guiGridListGetSelectedItem(GUIEditor.gridlist[1] ),1)
local player = getPlayerFromName ( plr )
triggerServerEvent ( "fixVehicle", localPlayer , plr ) 
end 
end
end )

 

Link to comment
addEventHandler("onClientGUIClick",root,
function ( )
if ( source == GUIEditor.button[5] ) then
if ( guiGridListGetSelectedItem(GUIEditor.gridlist[1] ) ~= -1 ) then
local plr = guiGridListGetItemText(GUIEditor.gridlist[1] ,guiGridListGetSelectedItem(GUIEditor.gridlist[1] ),1)
triggerServerEvent ( "fixVehicle", localPlayer , plr ) 
end 
end
end ) 
  
  -- كلينت ^ + لا تغير اسم الزر

-- سيرفر

addEvent ( "fixVehicle", true)
addEventHandler ( "fixVehicle", root,
	function ( plr )
		local plr = getPlayerFromName ( plr )
		if ( isPedInVehicle ( plr ) ) then
			fixVehicle ( getPedOccupiedVehicle ( plr ) )
		end
 end )

 

  • Like 2
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...