Jump to content

Help !!


Recommended Posts

السلام عليكم

ممكن مساعدة في الكود

وين الخطاء في الكود :leftfighter1:

#Server Side 
addEvent("A",true)  
addEventHandler("A",root,  
function() 
    if ( getPlayerMoney (source) >= 250 ) then 
    takePlayerMoney(source, 250) 
    outputChatBox("*****************") 
    else 
    outputChatBox("*****************") 
end 
end) 

DebugScript 3 :Bad argument @ 'getPlayerMoney' [Expexted player at arugument 1, got nill]

DebugScript 3 :attempt to compare number with boolean

:oops:

Link to comment

جرب هذا

addEvent("A",true) 
addEventHandler("A",root, 
function(player) 
    local money = getPlayerMoney(player) 
    if ( money >= 250 ) then  
    takePlayerMoney(player , 250) 
    outputChatBox("*****************") 
    else 
    outputChatBox("*****************") 
end 
end) 

Link to comment
Client Side # 
  
function onGuiClick(button, state, absoluteX, absoluteY) 
     if source == GUIEditor.button[1] then 
          setElementPosition(localPlayer,1642.4000244141, -2238.3999023438, 12.39999961853) 
           triggerServerEvent("A", localPlayer)        
          setPedRotation(localPlayer,91.98) 
     end 
end 
addEventHandler("onClientGUIClick", root, onGuiClick) 

Link to comment

Client

function onGuiClick(button, state, absoluteX, absoluteY) 
     if source == GUIEditor.button[1] then 
           Elplayer = localPlayer 
           triggerServerEvent("A", localPlayer,Elplayer)        
     end 
end 
addEventHandler("onClientGUIClick", root, onGuiClick) 

Server

addEvent("A",true) 
addEventHandler("A", getRootElement(   ), function(Elplayer) 
      if ( getPlayerMoney(Elplayer) >= 250 ) then 
           takePlayerMoney(Elplayer,250) 
           outputChatBox("*****************", Elplayer) 
          setElementPosition(Elplayer,1642.4000244141, -2238.3999023438, 12.39999961853) 
         setPedRotation(Elplayer, 91.98) 
      else 
           outputChatBox("****************", Elplayer) 
       end 
end   ) 

Edited by Guest
Link to comment
جرب هذا
addEvent("A",true) 
addEventHandler("A",root, 
function(player) 
    local money = getPlayerMoney(player) 
    if ( money >= 250 ) then  
    takePlayerMoney(player , 250) 
    outputChatBox("*****************") 
    else 
    outputChatBox("*****************") 
end 
end) 

تستخدم

player بدلا من source

Link to comment

تم التعديل#

#Client Side: 
  
function onGuiClick(button, state, absoluteX, absoluteY) 
    Local = localPlayer 
    if source == GUIEditor.button[1] then 
        triggerServerEvent("A", Local)      
        setPedRotation(Local,91,98) 
    end 
end 
addEventHandler("onClientGUIClick", root, onGuiClick) 

#Server Side: 
  
addEvent("A",true) 
addEventHandler("A", getRootElement(),function(Local) 
local PlayerMoney = getPlayerMoney(Local) 
    if PlayerMoney >= 250 then 
        takePlayerMoney(Local, 250) 
        setElementPosition(Local,1642.4000244141, -2238.3999023438, 12.39999961853)  
            outputChatBox("*****************", Local, 255, 0, 0, true) 
          else 
            outputChatBox("****************", Local, 255, 0, 0,) 
    end 
end) 

Edited by Guest
Link to comment
#Client Side: 
  
function onGuiClick(button, state, absoluteX, absoluteY) 
    if source == GUIEditor.button[1] then 
        triggerServerEvent("A", getLocalPlayer())      
        setElementPosition(getLocalPlayer(),1642.4000244141, -2238.3999023438, 12.39999961853)  
        setPedRotation(getLocalPlayer(),91,98) 
    end 
end 
addEventHandler("onClientGUIClick", root, onGuiClick) 

#Server Side: 
  
addEvent("A",true) 
addEventHandler("A", getRootElement(),function() 
local PlayerMoney = getPlayerMoney(source) 
    if PlayerMoney >= 250 then 
        takePlayerMoney(source, 250) 
            outputChatBox("*****************", source, 255, 0, 0, true) 
          else 
            outputChatBox("****************", source, 255, 0, 0,) 
    end 
end) 

الحين صار مايسحب الفلوس

!!

Link to comment

Client

function onGuiClick(button, state, absoluteX, absoluteY) 
     if source == GUIEditor.button[1] then 
        triggerServerEvent("A", localPlayer)       
    end 
end 
addEventHandler("onClientGUIClick", root, onGuiClick) 
  
  
  
addEvent("B",true) 
addEventHandler("B", getRootElement(), 
    function() 
        setElementPosition(localPlayer,1642.4000244141, -2238.3999023438, 12.39999961853) 
        setPedRotation(localPlayer,91.98) 
    end 
 ) 

Server

addEvent("A",true) 
addEventHandler("A", getRootElement(), 
    function() 
        local PlayerMoney = getPlayerMoney(source) 
        if PlayerMoney >= 250 then 
           takePlayerMoney(source, 250) 
           triggerClientEvent("B", source)      
           outputChatBox("*****************", source, 255, 0, 0, true) 
        else 
           outputChatBox("****************", source, 255, 0, 0, true) 
      end 
  end 
) 

Link to comment
Client
function onGuiClick(button, state, absoluteX, absoluteY) 
     if source == GUIEditor.button[1] then 
        triggerServerEvent("A", localPlayer)       
    end 
end 
addEventHandler("onClientGUIClick", root, onGuiClick) 
  
  
  
addEvent("B",true) 
addEventHandler("B", getRootElement(), 
    function() 
        setElementPosition(localPlayer,1642.4000244141, -2238.3999023438, 12.39999961853) 
        setPedRotation(localPlayer,91.98) 
    end 
 ) 

Server

addEvent("A",true) 
addEventHandler("A", getRootElement(), 
    function() 
        local PlayerMoney = getPlayerMoney(source) 
        if PlayerMoney >= 250 then 
           takePlayerMoney(source, 250) 
           triggerClientEvent("B", source)      
           outputChatBox("*****************", source, 255, 0, 0, true) 
        else 
           outputChatBox("****************", source, 255, 0, 0, true) 
      end 
  end 
) 

تيتي مثل مارحتي جيتي !

Link to comment
Client
function onGuiClick(button, state, absoluteX, absoluteY) 
     if source == GUIEditor.button[1] then 
        triggerServerEvent("A", localPlayer)       
    end 
end 
addEventHandler("onClientGUIClick", root, onGuiClick) 
  
  
  
addEvent("B",true) 
addEventHandler("B", getRootElement(), 
    function() 
        setElementPosition(localPlayer,1642.4000244141, -2238.3999023438, 12.39999961853) 
        setPedRotation(localPlayer,91.98) 
    end 
 ) 

Server

addEvent("A",true) 
addEventHandler("A", getRootElement(), 
    function() 
        local PlayerMoney = getPlayerMoney(source) 
        if PlayerMoney >= 250 then 
           takePlayerMoney(source, 250) 
           triggerClientEvent("B", source)      
           outputChatBox("*****************", source, 255, 0, 0, true) 
        else 
           outputChatBox("****************", source, 255, 0, 0, true) 
      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...