Jump to content

مساعدة بكود


Aesony!

Recommended Posts

السلام عليكم

عندي ذي النافذة

local x,y = guiGetScreenSize() 
local width,height = 200, 100 
x = x-width 
y = y-height 
aesony = guiCreateWindow(x,y,width,height, "الوقت", false) 
wht = guiCreateLabel(50, 50, 95, 15, "", false, aesony) 
guiSetVisible (aesony, false) 
setTimer(function () 
local time = getRealTime ( ) 
local hours = time.hour + 1 
local minute = time.minute 
local second = time.second 
if hours > 13 then hours = hours - 13 end 
guiSetText(wht,"The time is : "..tostring(hours).." : "..tostring(minute).." : "..tostring(second)) 
end,1000,0) 
  
function asd() 
    if guiGetVisible (aesony ) then   
       guiSetVisible ( aesony, false )   
       showCursor(false)   
       guiSetInputEnabled(false) 
    else 
        guiSetVisible ( aesony, true )   
        showCursor(true)   
        guiSetInputEnabled(true) 
    end   
end   
bindKey("F4", "down", asd) 
  

بس ابغى الشخصية اللي العب فيها يوم افتح النافذة تسوي حركة وبنفس الوقت تاخذ سلاح وتكون عليه

بس محتاج شرح بسيط وارجو اكون وضحت :fadein:

Link to comment
  
-- Client Side 
local x,y = guiGetScreenSize() 
local width,height = 200, 100 
x = x-width 
y = y-height 
aesony = guiCreateWindow(x,y,width,height, "الوقت", false) 
wht = guiCreateLabel(50, 50, 95, 15, "", false, aesony) 
guiSetVisible (aesony, false) 
setTimer(function () 
local time = getRealTime ( ) 
local hours = time.hour + 1 
local minute = time.minute 
local second = time.second 
if hours > 13 then hours = hours - 13 end 
guiSetText(wht,"The time is : "..tostring(hours).." : "..tostring(minute).." : "..tostring(second)) 
end,1000,0) 
  
function asd(source) 
    if guiGetVisible (aesony ) then   
       guiSetVisible ( aesony, false )   
       showCursor(false)   
       guiSetInputEnabled(false) 
        triggerServerEvent ( 'onF4Stop', localPlayer ) 
    else 
        guiSetVisible ( aesony, true )   
        showCursor(true)   
        guiSetInputEnabled(true) 
        triggerServerEvent ( 'onF4Start', localPlayer ) 
    end   
end   
bindKey("F4", "down", asd) 
  

  
-- Server Side 
addEvent ('onF4Start', true) 
addEventHandler ('onF4Start', root, 
function () 
        setPedAnimation ( source, "DANCING", "dnce_m_b") -- DANCING is the catgory , dnce_m_b is the dance movement 
        giveWeapon ( source, 31, 200 ) -- 31 is the weaopn id , 200 is the ammo 
end 
) 
  
addEvent ('onF4Stop', true) 
addEventHandler ('onF4Stop', root, 
function () 
        setPedAnimation(source,false) 
end 
) 
  

هذي صفحة الآنميشن

https://wiki.multitheftauto.com/wiki/Animations

والآسلحه

https://wiki.multitheftauto.com/wiki/Weapon

Link to comment
  
-- Client Side 
local x,y = guiGetScreenSize() 
local width,height = 200, 100 
x = x-width 
y = y-height 
aesony = guiCreateWindow(x,y,width,height, "الوقت", false) 
wht = guiCreateLabel(50, 50, 95, 15, "", false, aesony) 
guiSetVisible (aesony, false) 
setTimer(function () 
local time = getRealTime ( ) 
local hours = time.hour + 1 
local minute = time.minute 
local second = time.second 
if hours > 13 then hours = hours - 13 end 
guiSetText(wht,"The time is : "..tostring(hours).." : "..tostring(minute).." : "..tostring(second)) 
end,1000,0) 
  
function asd(source) 
    if guiGetVisible (aesony ) then   
       guiSetVisible ( aesony, false )   
       showCursor(false)   
       guiSetInputEnabled(false) 
        triggerServerEvent ( 'onF4Stop', localPlayer ) 
    else 
        guiSetVisible ( aesony, true )   
        showCursor(true)   
        guiSetInputEnabled(true) 
        triggerServerEvent ( 'onF4Start', localPlayer ) 
    end   
end   
bindKey("F4", "down", asd) 
  

  
-- Server Side 
addEvent ('onF4Start', true) 
addEventHandler ('onF4Start', root, 
function () 
        setPedAnimation ( source, "DANCING", "dnce_m_b") -- DANCING is the catgory , dnce_m_b is the dance movement 
        giveWeapon ( source, 31, 200 ) -- 31 is the weaopn id , 200 is the ammo 
end 
) 
  
addEvent ('onF4Stop', true) 
addEventHandler ('onF4Stop', root, 
function () 
        setPedAnimation(source,false) 
end 
) 
  

هذي صفحة الآنميشن

https://wiki.multitheftauto.com/wiki/Animations

والآسلحه

https://wiki.multitheftauto.com/wiki/Weapon

X

الكود كلنت

و

giveWeapon 

الفنكشن سيرفر ._.

+

القسم غلط

شكلك شارب شي :x

رح شوف الكود مره ثانيه معلم آنا بأول الكود آن الاول كلينت والثاني سيرفر مايحتاج لها ذكاء

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