Jump to content

طلب فنكشات


EH10

Recommended Posts

السلام عليكم

طلب فنكشات

لوحة فيها ايديت وفيها زر

وفيها قريد ليست وزرين اظهار واخفاء

عندما تكتب بالايديت رقم السياره تجي في القريد ليست وتقدر تظهرها وتخفيها على كيفك

واذا خرجت من السيرفر ودخلت تختفي

مثال اخر

انا كتبت رقم السياره ضغطت زر اختيار وتجي السياره في القريد ليست واضغط على السياره واضغط اظهار واذا طفشت منها اقدر اظيف سياره ثانية

Link to comment

لو ممكن يجي تسوي لي string.len و tonumber

سهلة تراها .. اسهل شي بـ الكود

tonumber( guiGetText( element ) ) 
string.len 

: عشان تتحق من كم رقم كتب مو يجلس يكتب مليون رقم .. تتحق انه كتب 3 ارقام فقط ذذ

Link to comment
Event: "onClientGUIChanged"
guiGetText 
tonumber 
string.len 
guiGridListAddRow 
guiGridListSetItemText 

صـحح الـكـود الأول *

Edits = guiCreateEdit(0,0,0,0,"",true) 
    guiEditSetMaxLength( Edits، 3  ​​) 
LiSethH = guiCreateGridList ( 0, 0, 0, 0, true ) 
local Columen = guiGridListAddColumn( LiSethH, "Vehicles", 0.80 ) 
  local Row = guiGridListAddRow ( LiSethH ) 
  guiGridListSetItemText ( LiSethH, Row, Columen, getVehicleName(source), false, false ) 
addEventHandler("onClientGUIChanged", Edits, 
 function ( element ) 
        tonumber( guiGetText( element ) ) 
    end 
) 
Link to comment

local Edit = guiCreateEdit( 0, 0, 0, 0, "", true ) 
local list = guiCreateGridList ( 0, 0, 0, 0, true ) 
guiGridListAddColumn( list, "Vehicles", 0.80 ) 
guiEditSetMaxLength( Edit, 3 ) 
  
addEventHandler( "onClientGUIChanged", resourceRoot, function ( element )       
     if ( element == Edit ) then 
            if not ( tonumber( guiGetText( element ) ) ) then 
               return guiSetText( element, "" ) 
          else     
              Row = guiGridListAddRow( list ) 
              guiGridListSetItemText( list, Row, 1, "Car ID "..tonumber( guiGetText( element ) ), false, false ) 
             end 
       end 
end ) 
  
Link to comment

Event: "onClientGUIClick"

guiGridListGetSelectedItem 
guiGridListGetItemText 
table 
isElement 
destroyElement 
createVehicle 
warpPedIntoVehicle 

# Client Side

local Edit = guiCreateEdit( 0, 0, 0, 0, "", true ) 
local list = guiCreateGridList ( 0, 0, 0, 0, true ) 
guiGridListAddColumn( list, "Vehicles", 0.80 ) 
guiEditSetMaxLength( Edit, 3 ) 
  
addEventHandler( "onClientGUIClick", Button, 
function () 
    guiGridListGetSelectedItem( list ) 
    Row = guiGridListAddRow( list ) 
    guiGridListGetItemText( list, Row, 1 ) 
    triggerServerEvent( "onVehiclehit", localPlayer) 
        end 
) 

# Server Side

local vehicle = {} 
  
addEvent( "onVehiclehit", true ) 
addEventHandler( "onVehiclehit", root, 
function () 
    if ( isElement ( vehicle[source] ) ) then destroyElement ( vehicle[source] ) end 
    vehicle[source] = createVehicle ( id, x, y, z ) 
    warpPedIntoVehicle ( source, vehicle[source] ) 
         end 
) 

Event: "onPlayerQuit"

isElement 
destroyElement 

addEventHandler( "onPlayerQuit", root, 
function () 
    if ( isElement ( source ) ) then destroyElement ( source ) end 
         end 
) 

مـمـكن تـصـحيـح للـأكـواد

Link to comment

Event: "onClientGUIClick"

guiGridListGetSelectedItem 
guiGridListGetItemText 
table 
isElement 
destroyElement 
createVehicle 
warpPedIntoVehicle 

# Client Side

local Edit = guiCreateEdit( 0, 0, 0, 0, "", true ) 
local list = guiCreateGridList ( 0, 0, 0, 0, true ) 
guiGridListAddColumn( list, "Vehicles", 0.80 ) 
guiEditSetMaxLength( Edit, 3 ) 
  
addEventHandler( "onClientGUIClick", Button, 
function () 
    guiGridListGetSelectedItem( list ) 
    Row = guiGridListAddRow( list ) 
    guiGridListGetItemText( list, Row, 1 ) 
    triggerServerEvent( "onVehiclehit", localPlayer) 
        end 
) 

# Server Side

local vehicle = {} 
  
addEvent( "onVehiclehit", true ) 
addEventHandler( "onVehiclehit", root, 
function () 
    if ( isElement ( vehicle[source] ) ) then destroyElement ( vehicle[source] ) end 
    vehicle[source] = createVehicle ( id, x, y, z ) 
    warpPedIntoVehicle ( source, vehicle[source] ) 
         end 
) 

Event: "onPlayerQuit"

isElement 
destroyElement 

addEventHandler( "onPlayerQuit", root, 
function () 
    if ( isElement ( source ) ) then destroyElement ( source ) end 
         end 
) 

مـمـكن تـصـحيـح للـأكـواد

السورس غلط

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