Jump to content

تصحيح كود


Recommended Posts

السلام عليكم

انا اليوم عملت كود جسم وعضلات وكذا يعني المهم الكود

الحين احطه المشكله انه ما يعطي الجسم الي ابيه يقلي لازم تحط الفنكش في الكلينت بس انا حاططله الكود الي ابيه في السيرفر ومعرف كيف اخلي فنكش كلنت لسيرفر المهم

الكود

كلينت

:

  
GUIEditor = { 
    button = {}, 
    label = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        GUIEditor.button[1] = guiCreateButton(207, 344, 115, 31, "Muscles 100000$", false) 
  
  
        GUIEditor.button[2] = guiCreateButton(355, 344, 106, 33, "Skinny 50000$", false) 
  
  
        GUIEditor.button[3] = guiCreateButton(485, 344, 111, 33, "Paunch 75000", false) 
  
  
        GUIEditor.label[5] = guiCreateLabel(257, 180, 236, 19, "مود العضلات من قبل ...", false)     
    end 
) 
  
addEventHandler("onClientRender", root, 
    function() 
        dxDrawImage(172, 169, 456, 257, "progress.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
        dxDrawImage(209, 212, 113, 129, "mus.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
        dxDrawImage(358, 210, 103, 131, "n7ef.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
        dxDrawImage(488, 209, 108, 132, "krs.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
    end 
) 
addEventHandler ( "onClientGUIClick", root, 
function (  ) 
if source == GUIEditor.button[1] then 
triggerServerEvent("Muscles",getLocalPlayer()) 
end 
end 
) 
----------- 
addEventHandler ( "onClientGUIClick", root, 
function (  ) 
if source == GUIEditor.button[2] then 
triggerServerEvent("Skinny",getLocalPlayer()) 
end 
end 
) 
------------------ 
addEventHandler ( "onClientGUIClick", root, 
function (  ) 
if source == GUIEditor.button[3] then 
triggerServerEvent("Paunch",getLocalPlayer()) 
end 
end 
) 
------------------------------------------------ 
  
------------------------------------------------ 
guiSetVisible(GUIEditor_Window[1],false) 
  
  
bindKey("F5","down", function ( ) 
guiSetVisible(GUIEditor_Window[1], not guiGetVisible(GUIEditor_Window[1])) 
showCursor(guiGetVisible(GUIEditor_Window[1])) 
Opens() 
end) 

سيرفر

addEvent("Muscles", true) 
addEventHandler("Muscles", root, 
 function  (  ) 
 takePlayerMoney(source,100000) 
local stat = getPedStat ( getLocalPlayer(), 23 ) 
if stat < 1000 then 
 outputChatBox ( "You now own Muscles " ) 
end 
) 
------------------------------ 
addEvent("Skinny", true) 
addEventHandler("Skinny", root, 
 function  (  ) 
  takePlayerMoney(source,50000) 
local stat = getPedStat ( getLocalPlayer(), 25 ) 
if stat < 1000 then 
outputChatBox("You now own Skinny ") 
end 
) 
-------------------------- 
addEvent("Paunch", true) 
addEventHandler("Paunch", root, 
 function  (  ) 
 takePlayerMoney(source,75000) 
local stat = getPedStat ( getLocalPlayer(), 21 ) 
if stat < 1000 then 
outputChatBox("You now own Paunch ") 
end 
) 

وابي كمان الزر ما يشتغل ابدا

المشكله

حطات الدي بق شوفو شو طلع

[03:51:16] ERROR: Client ([...]11<+Pr1**<) triggered serverside event Skinny, but event is not added serverside 
[03:51:17] ERROR: Client ([...]111<+Pr1**<) triggered serverside event Paunch, but event is not added serverside 

Link to comment
لساته نفس شيئ

[04:41:23] ERROR: Client ([...]ErHaPe<+Pr0*-_-*<) triggered serverside event Paunch, but event is not added serverside

اعتقد يبي

triggerClientEvent 

بس معرف احطه

متأكد بس هالخطأ يطلع في الديبق ؟

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

Link to comment
يا شباب حد يساعدني ضروري

كل شيء صحيح بس شيل

getLocalPlayer 

source من سيرفر وحط بدالها

لان هذا الفنشكن من جانب كلنت بس

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

Link to comment
addEvent("Muscles", true) 
addEventHandler("Muscles", root, 
function () 
   takePlayerMoney(source, 100000) 
   local stat = getPedStat(source, 23) 
   if stat < 1000 then 
      outputChatBox("You now own Muscles ", source) 
   end 
end 
) 
------------------------------ 
addEvent("Skinny", true) 
addEventHandler("Skinny", root, 
function () 
   takePlayerMoney(source, 50000) 
   local stat = getPedStat(source , 25) 
   if stat < 1000 then 
      outputChatBox("You now own Skinny ", source) 
   end 
end 
) 
-------------------------- 
addEvent("Paunch", true) 
addEventHandler("Paunch", root, 
function () 
   takePlayerMoney(source, 75000) 
   local stat = getPedStat(source, 21) 
   if stat < 1000 then 
      outputChatBox("You now own Paunch", source) 
   end 
end 
) 

جرب الحين

كان عندك end ناقصه

Link to comment

جرب

addEvent("Muscles", true) 
addEventHandler("Muscles", root, 
function ( theplayer ) 
   takePlayerMoney(theplayer, 100000) 
   local stat = getPedStat(theplayer, 23) 
   if stat < 1000 then 
      outputChatBox("You now own Muscles ", theplayer) 
   end 
end 
) 
------------------------------ 
addEvent("Skinny", true) 
addEventHandler("Skinny", root, 
function ( theplayer ) 
   takePlayerMoney(theplayer, 50000) 
   local stat = getPedStat(theplayer , 25) 
   if stat < 1000 then 
      outputChatBox("You now own Skinny ", theplayer) 
   end 
end 
) 
-------------------------- 
addEvent("Paunch", true) 
addEventHandler("Paunch", root, 
function ( theplayer ) 
   takePlayerMoney(theplayer, 75000) 
   local stat = getPedStat(theplayer, 21) 
   if stat < 1000 then 
      outputChatBox("You now own Paunch", theplayer) 
   end 
end 
) 

بس ما اتوقع يشتغل :/

Link to comment
قال يساعدنا قال

نروح على منتديات صغيره اشرف لنا المهم انهم يساعدو

طيب ع الاقل اشكر الي بذل مجهود عشانكـ

والي مايبي يقعد مايلحقه الا ظله :arrowleft::arrowleft:

Link to comment

وش الكلنت حقك ذا

اول شي عامل اخفاء للنافذه و انت مو عامل نافذه

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

ثالث شي بسيرفر لزم تحقق من فلوس لاعب من اجل الاخطاء

edit #

Client

  
GUIEditor = { 
    button = {}, 
    window = {}, 
    label = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        GUIEditor.window[1] = guiCreateWindow(275, 39, 288, 447, "", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
        guiSetAlpha(GUIEditor.window[1], 1.00) 
        guiSetVisible ( GUIEditor.window[1], false ) 
        GUIEditor.button[1] = guiCreateButton(207, 344, 115, 31, "Muscles 100000$", false, GUIEditor.window[1]) 
        GUIEditor.button[2] = guiCreateButton(355, 344, 106, 33, "Skinny 50000$", false, GUIEditor.window[1]) 
        GUIEditor.button[3] = guiCreateButton(485, 344, 111, 33, "Paunch 75000", false, GUIEditor.window[1]) 
        GUIEditor.label[5] = guiCreateLabel(257, 180, 236, 19, "مود العضلات من قبل ...", false, GUIEditor.window[1])  
        guiSetVisible(GUIEditor_Window[1],false)    
    end 
) 
  
    function dxx() 
        dxDrawImage(172, 169, 456, 257, "progress.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
        dxDrawImage(209, 212, 113, 129, "mus.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
        dxDrawImage(358, 210, 103, 131, "n7ef.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
        dxDrawImage(488, 209, 108, 132, "krs.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
    end 
  
  
addEventHandler ( "onClientGUIClick", root, 
   function (  ) 
    if source == GUIEditor.button[1] then 
      triggerServerEvent( "Muscles", localPlayer )  
 end 
 end) 
  
  
addEventHandler ( "onClientGUIClick", root, 
   function (  ) 
    if source == GUIEditor.button[2] then 
      triggerServerEvent( "Skinny", localPlayer ) 
 end 
 end) 
  
  
addEventHandler ( "onClientGUIClick", root, 
  function (  ) 
  if source == GUIEditor.button[3] then 
     triggerServerEvent( "Paunch",localPlayer ) 
  end 
  end) 
  
local opened = false 
   function Open ( ) 
    if ( opened == false ) then 
         addEventHandler("onClientRender", root, dxx) 
         showCursor ( true ) 
         opened = true 
         guiSetVisible(GUIEditor_Window[1], true)  
    else 
        removeEventHandler ( "onClientRander", root,dxx) 
        showCursor ( false ) 
        opened = false 
        guiSetVisible(GUIEditor_Window[1], false)  
   end 
   end 
bindKey ("F10", "down", Open ) 

server

  
addEvent("Muscles", true) 
addEventHandler("Muscles", root, 
 function  ( thePlayer ) 
if getElementType ( thePlayer) == "player"  then 
 if ( getPlayerMoney (source) >= 4000 ) then 
 takePlayerMoney(source,4000) 
setPedStat(thePlayer, 23, 999) then 
outputChatBox ( "You now own Muscles " ) 
else 
 outputChatBox ( " ما معك فلوس" ) 
end 
end 
end 
) 
------------------------------ 
addEvent("Skinny", true) 
addEventHandler("Skinny", root, 
  function  (thePlayer) 
if getElementType ( thePlayer) == "player"  then 
 if ( getPlayerMoney (source) >= 4000 ) then 
 takePlayerMoney(source,4000) 
setPedStat(thePlayer, 23, 999) then 
outputChatBox ( "You now own Skinny " ) 
else 
 outputChatBox ( " ما معك فلوس" ) 
end 
end 
end) 
  
-------------------------- 
addEvent("Paunch", true) 
addEventHandler("Paunch", root, 
  function  (thePlayer) 
if getElementType ( thePlayer) == "player"  then 
 if ( getPlayerMoney (source) >= 4000 ) then 
 takePlayerMoney(source,4000) 
setPedStat(thePlayer, 23, 999) then 
outputChatBox ( "You now own Skinny " ) 
else 
 outputChatBox ( " ما معك فلوس" ) 
end 
end 
end) 

Edited by Guest
Link to comment
وش الكلنت حقك ذا

اول شي عامل اخفاء للنافذه و انت مو عامل نافذه

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

ثالث شي بسيرفر لزم تحقق من فلوس لاعب من اجل الاخطاء

edit #

Client

  
GUIEditor = { 
    button = {}, 
    window = {}, 
    label = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        GUIEditor.window[1] = guiCreateWindow(275, 39, 288, 447, "", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
        guiSetAlpha(GUIEditor.window[1], 1.00) 
        guiSetVisible ( GUIEditor.window[1], false ) 
        GUIEditor.button[1] = guiCreateButton(207, 344, 115, 31, "Muscles 100000$", false, GUIEditor.window[1]) 
        GUIEditor.button[2] = guiCreateButton(355, 344, 106, 33, "Skinny 50000$", false, GUIEditor.window[1]) 
        GUIEditor.button[3] = guiCreateButton(485, 344, 111, 33, "Paunch 75000", false, GUIEditor.window[1]) 
        GUIEditor.label[5] = guiCreateLabel(257, 180, 236, 19, "مود العضلات من قبل ...", false, GUIEditor.window[1])  
        guiSetVisible(GUIEditor_Window[1],false)    
    end 
) 
  
    function dxx() 
        dxDrawImage(172, 169, 456, 257, "progress.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
        dxDrawImage(209, 212, 113, 129, "mus.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
        dxDrawImage(358, 210, 103, 131, "n7ef.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
        dxDrawImage(488, 209, 108, 132, "krs.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
    end 
  
  
addEventHandler ( "onClientGUIClick", root, 
   function (  ) 
    if source == GUIEditor.button[1] then 
      triggerServerEvent( "Muscles", localPlayer )  
 end 
 end) 
  
  
addEventHandler ( "onClientGUIClick", root, 
   function (  ) 
    if source == GUIEditor.button[2] then 
      triggerServerEvent( "Skinny", localPlayer ) 
 end 
 end) 
  
  
addEventHandler ( "onClientGUIClick", root, 
  function (  ) 
  if source == GUIEditor.button[3] then 
     triggerServerEvent( "Paunch",localPlayer ) 
  end 
  end) 
  
local opened = false 
   function Open ( ) 
    if ( opened == false ) then 
         addEventHandler("onClientRender", root, dxx) 
         showCursor ( true ) 
         opened = true 
         guiSetVisible(GUIEditor_Window[1], true)  
    else 
        removeEventHandler ( "onClientRander", root,dxx) 
        showCursor ( false ) 
        opened = false 
        guiSetVisible(GUIEditor_Window[1], false)  
   end 
   end 
bindKey ("F10", "down", Open ) 

server

  
addEvent("Muscles", true) 
addEventHandler("Muscles", root, 
 function  ( thePlayer ) 
 if ( getPlayerMoney (source) >= 4000 ) then 
 takePlayerMoney(source,4000) 
setPedStat(thePlayer, 23, 999) then 
outputChatBox ( "You now own Muscles " ) 
else 
 outputChatBox ( " ما معك فلوس" ) 
end 
end 
) 
------------------------------ 
addEvent("Skinny", true) 
addEventHandler("Skinny", root, 
  function  (thePlayer) 
 if ( getPlayerMoney (source) >= 4000 ) then 
 takePlayerMoney(source,4000) 
setPedStat(thePlayer, 23, 999) then 
outputChatBox ( "You now own Skinny " ) 
else 
 outputChatBox ( " ما معك فلوس" ) 
end 
end) 
  
-------------------------- 
addEvent("Paunch", true) 
addEventHandler("Paunch", root, 
  function  (thePlayer) 
 if ( getPlayerMoney (source) >= 4000 ) then 
 takePlayerMoney(source,4000) 
setPedStat(thePlayer, 23, 999) then 
outputChatBox ( "You now own Skinny " ) 
else 
 outputChatBox ( " ما معك فلوس" ) 
end 
end) 

thePlayer مو معرف

Link to comment
وش الكلنت حقك ذا

اول شي عامل اخفاء للنافذه و انت مو عامل نافذه

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

ثالث شي بسيرفر لزم تحقق من فلوس لاعب من اجل الاخطاء

edit #

Client

  
GUIEditor = { 
    button = {}, 
    window = {}, 
    label = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        GUIEditor.window[1] = guiCreateWindow(275, 39, 288, 447, "", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
        guiSetAlpha(GUIEditor.window[1], 1.00) 
        guiSetVisible ( GUIEditor.window[1], false ) 
        GUIEditor.button[1] = guiCreateButton(207, 344, 115, 31, "Muscles 100000$", false, GUIEditor.window[1]) 
        GUIEditor.button[2] = guiCreateButton(355, 344, 106, 33, "Skinny 50000$", false, GUIEditor.window[1]) 
        GUIEditor.button[3] = guiCreateButton(485, 344, 111, 33, "Paunch 75000", false, GUIEditor.window[1]) 
        GUIEditor.label[5] = guiCreateLabel(257, 180, 236, 19, "مود العضلات من قبل ...", false, GUIEditor.window[1])  
        guiSetVisible(GUIEditor_Window[1],false)    
    end 
) 
  
    function dxx() 
        dxDrawImage(172, 169, 456, 257, "progress.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
        dxDrawImage(209, 212, 113, 129, "mus.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
        dxDrawImage(358, 210, 103, 131, "n7ef.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
        dxDrawImage(488, 209, 108, 132, "krs.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
    end 
  
  
addEventHandler ( "onClientGUIClick", root, 
   function (  ) 
    if source == GUIEditor.button[1] then 
      triggerServerEvent( "Muscles", localPlayer )  
 end 
 end) 
  
  
addEventHandler ( "onClientGUIClick", root, 
   function (  ) 
    if source == GUIEditor.button[2] then 
      triggerServerEvent( "Skinny", localPlayer ) 
 end 
 end) 
  
  
addEventHandler ( "onClientGUIClick", root, 
  function (  ) 
  if source == GUIEditor.button[3] then 
     triggerServerEvent( "Paunch",localPlayer ) 
  end 
  end) 
  
local opened = false 
   function Open ( ) 
    if ( opened == false ) then 
         addEventHandler("onClientRender", root, dxx) 
         showCursor ( true ) 
         opened = true 
         guiSetVisible(GUIEditor_Window[1], true)  
    else 
        removeEventHandler ( "onClientRander", root,dxx) 
        showCursor ( false ) 
        opened = false 
        guiSetVisible(GUIEditor_Window[1], false)  
   end 
   end 
bindKey ("F10", "down", Open ) 

server

  
addEvent("Muscles", true) 
addEventHandler("Muscles", root, 
 function  ( thePlayer ) 
 if ( getPlayerMoney (source) >= 4000 ) then 
 takePlayerMoney(source,4000) 
setPedStat(thePlayer, 23, 999) then 
outputChatBox ( "You now own Muscles " ) 
else 
 outputChatBox ( " ما معك فلوس" ) 
end 
end 
) 
------------------------------ 
addEvent("Skinny", true) 
addEventHandler("Skinny", root, 
  function  (thePlayer) 
 if ( getPlayerMoney (source) >= 4000 ) then 
 takePlayerMoney(source,4000) 
setPedStat(thePlayer, 23, 999) then 
outputChatBox ( "You now own Skinny " ) 
else 
 outputChatBox ( " ما معك فلوس" ) 
end 
end) 
  
-------------------------- 
addEvent("Paunch", true) 
addEventHandler("Paunch", root, 
  function  (thePlayer) 
 if ( getPlayerMoney (source) >= 4000 ) then 
 takePlayerMoney(source,4000) 
setPedStat(thePlayer, 23, 999) then 
outputChatBox ( "You now own Skinny " ) 
else 
 outputChatBox ( " ما معك فلوس" ) 
end 
end) 

thePlayer مو معرف

+

ماله داعي التحقق من نوع الالمنت

وعقب setPedState موجودة اند زايدة

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