Jump to content

Recommended Posts

  • Replies 72
  • Created
  • Last Reply

Top Posters In This Topic

Client Side

addEventHandler ( 'onClientResourceStart', resourceRoot, 
    function ( ) 
        Image = guiCreateStaticImage( 500, 450, 250, 250, '4.png', false ) 
        guiSetAlpha ( Image, 0.7 ) 
        addEventHandler ( 'onClientGUIClick', Image, onImageClick ) 
    end 
) 
  
function onImageClick( ) 
    triggerServerEvent ( 'setTeam', getLocalPlayer ( ) ) 
end 

Server Side

createTeam ( 'Test-Team' ) 
  
addEvent ( 'setTeam', true ) 
addEventHandler ( 'setTeam', getRootElement ( ), 
    function ( ) 
        setPlayerTeam ( source, getTeamFromName ( 'Test-Team' ) ) 
    end 
) 

أنت مشكلتك في الميتا حطه كذا

>     ="Client.lua" type="client" />    ="Server.lua" type="server" />     src="4.png"/>    >

غير أسم ملف الكلنت إلى Client.lua

والسيرفر إلى Server.lua

Link to comment

تقدر تستخدم

spawnPlayer 

وتقدر تستخدم

setElementPosition (localPlayer,x,y,z) 

بنسبه لسلاح

giveWeapon(source,id,amount) 

واذا تبيه يختار اجابري شيل من نافذتك

guiSetVisible (GUIEditor_Window[1], false,) 

GUIEditor_Window[1] -- اسم النافذه

Link to comment
addEvent ( 'setTeam', true ) 
addEventHandler ( 'setTeam', getRootElement ( ), 
    function ( ) 
        local x, y, z, skinID = 0, 0, 0, 26 
        giveWeapon ( source, 31, 200 ) 
        spawnPlayer ( source, x, y, z, 0, skinID, 0, 0, getTeamFromName ( 'Test-Team' ) ) 
    end 
) 

صعب ؟

Link to comment

CILENT

addEventHandler ( 'onClientResourceStart', resourceRoot, 
    function ( ) 
        Image = guiCreateStaticImage( 500, 450, 250, 250, 'w.png', false ) 
        addEventHandler ( 'onClientGUIClick', Image, onImageClick ) 
    end 
) 
  
function onImageClick( ) 
    triggerServerEvent ( 'setTeam', getLocalPlayer ( ) ) 
end 

SERVER

team = createTeam("team",0,0,0) 
addEvent("setTeam",true) 
addEventHandler("setTeam", root, 
function() 
setPlayerTeam(source,team) 
end) 

META

<meta> 
    <script src="1.lua" type="client" /> 
    <script src="2.lua" type="server" /> 
    <file src="w.png"/>   
</meta> 

تابل

انا امبي ان دش اللاعب يختار فريق من الصورة(اجباري ياخذ فريق او مايدش السيرفر)و

واذا الصورة تختفي اذا اخذ فريق

واذا ضغط F9

تطلع قائمة الصور يختار فريقة

وشكرا ^_^مقدما

Link to comment
Image = guiCreateStaticImage(500, 450, 250, 250, "w.png", false) 
showCursor(true) 
  
function onImageClick() 
     triggerServerEvent("setTeam", localPlayer) 
     guiSetVisible(Image, false) 
     showCursor(false) 
end 
addEventHandler("onClientGUIClick", Image, onImageClick) 
  
bindKey("F9", "down", 
function() 
     if not guiGetVisible(Image) then 
          guiSetVisible(Image, true) 
          showCursor(true) 
     end 
end) 

team = createTeam("team", 0, 0, 0) 
  
addEvent("setTeam",true) 
addEventHandler("setTeam", root, 
function() 
     setPlayerTeam(source, team) 
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...