Jump to content

الكود ما يعمل = تعديل


Recommended Posts

السلام عليكم ورحمه الله وبركاتة انا عندي مشكلة بسطية

أولا انا مصمم لوحة شوب للريس اللوحة دي اكس المشكلة هي عندما اضغط علي buyrepair

لا يحدث شيء ! مطلوب تعديل في الكود أي مبرمج لا يبخل لاهنتنم :(

الكودات :

client

function isMouseInPosition ( x, y, width, height ) 
    if ( not isCursorShowing ( ) ) then 
        return false 
    end 
    local sx, sy = guiGetScreenSize ( ) 
    local cx, cy = getCursorPosition ( ) 
    local cx, cy = ( cx * sx ), ( cy * sy ) 
    if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then 
        return true 
    else 
        return false 
    end 
end 
  
  
  
  
  
  
function dx_test() 
dxDrawRectangle(138, 178, 554, 33, tocolor(111, 6, 77, 255), false) 
dxDrawRectangle(153, 211, 520, 160, tocolor(0, 0, 0, 160), false) 
if ( isMouseInPosition (167, 333, 148, 28) ) then 
dxDrawRectangle(167, 333, 148, 28, tocolor(107, 5, 74, 255), false) 
else 
dxDrawRectangle(167, 333, 148, 28, tocolor(107, 5, 74, 180), false) 
end 
if ( isMouseInPosition (515, 333, 148, 28) ) then  
dxDrawRectangle(515, 333, 148, 28, tocolor(107, 5, 74, 255), false) 
else 
dxDrawRectangle(515, 333, 148, 28, tocolor(107, 5, 74, 180), false) 
end 
if ( isMouseInPosition (340, 333, 148, 28) ) then 
dxDrawRectangle(340, 333, 148, 28, tocolor(107, 5, 74, 255), false) 
else 
dxDrawRectangle(340, 333, 148, 28, tocolor(107, 5, 74, 180), false) 
end 
dxDrawText("Race Shop", 323, 178, 581, 201, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) 
dxDrawText("Buy ($900)", 210, 338, 334, 357, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) 
dxDrawText("Buy ($250)", 381, 338, 505, 357, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) 
dxDrawText("Buy ($1500)", 555, 338, 679, 357, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) 
dxDrawImage(189, 241, 102, 81, "img/Repair.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
dxDrawImage(520, 239, 143, 98, "img/flip.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
dxDrawImage(359, 230, 104, 98, "img/Nitro.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
dxDrawImage(520, 239, 143, 98, "img/flip.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
end 
  
  
  
sShowing = false 
bindKey("f1","down", function ( ) 
if ( sShowing == true ) then  
removeEventHandler("onClientRender",root,dx_test) 
showCursor ( false ) 
else 
addEventHandler("onClientRender",root,dx_test) 
showCursor ( true ) 
end 
sShowing = not sShowing  
end 
) 
  
addEventHandler("onClientClick",root, 
function ( button , state )  
if( button == "left" and state == "up" ) then  
if ( sShowing == true ) then 
if ( isMouseInPosition (167, 333, 148, 28) ) then  
triggerServerEvent ( "Repair", localPlayer ) 
end 
end 
end 
end 
) 
  

_______________________

#Meta

    

_______________________

server

addEvent( "Repair", true ) 
addEventHandler( "Repair", root, 
  function () 
        if ( getPlayerMoney (source) >= 5000 ) then 
        takePlayerMoney(source, 5000) 
        local Veh = getPedOccupiedVehicle ( source ) 
             if Veh then 
       fixVehicle(Veh) 
    end 
end 
) 
  

Link to comment


addEvent( "Repair", true ) 
addEventHandler( "Repair", root, 
function ()     
    if ( getPlayerMoney (source) >= 5000 ) then 
        takePlayerMoney(source, 5000) 
        local Veh = getPedOccupiedVehicle ( source ) 
        if Veh then 
            fixVehicle(Veh) 
        end 
    end 
end 
) 
  

ناقصك اند بملف السيرفر

Link to comment
:( ما اتحلت المشكلة ما اتغيرت اتمني حد ياخد الكودات يجربها ويحل المشكلة :( أي مبرمج محترف لو سمحتم المود يعمل من اف 1 :(

مو محمل اللعبة عالجهاز ذا والله

ممكن تقلي كل الدي بق الي يجيلك ؟

Link to comment

Clinet

  
function isMouseInPosition ( x, y, width, height ) 
    if ( not isCursorShowing ( ) ) then 
        return false 
    end 
    local sx, sy = guiGetScreenSize ( ) 
    local cx, cy = getCursorPosition ( ) 
    local cx, cy = ( cx * sx ), ( cy * sy ) 
    if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then 
        return true 
    else 
        return false 
    end 
end 
  
  
  
  
  
  
function dx_test() 
dxDrawRectangle(138, 178, 554, 33, tocolor(111, 6, 77, 255), false) 
dxDrawRectangle(153, 211, 520, 160, tocolor(0, 0, 0, 160), false) 
if ( isMouseInPosition (167, 333, 148, 28) ) then 
dxDrawRectangle(167, 333, 148, 28, tocolor(107, 5, 74, 255), false) 
else 
dxDrawRectangle(167, 333, 148, 28, tocolor(107, 5, 74, 180), false) 
end 
if ( isMouseInPosition (515, 333, 148, 28) ) then  
dxDrawRectangle(515, 333, 148, 28, tocolor(107, 5, 74, 255), false) 
else 
dxDrawRectangle(515, 333, 148, 28, tocolor(107, 5, 74, 180), false) 
end 
if ( isMouseInPosition (340, 333, 148, 28) ) then 
dxDrawRectangle(340, 333, 148, 28, tocolor(107, 5, 74, 255), false) 
else 
dxDrawRectangle(340, 333, 148, 28, tocolor(107, 5, 74, 180), false) 
end 
dxDrawText("Race Shop", 323, 178, 581, 201, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) 
dxDrawText("Buy ($900)", 210, 338, 334, 357, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) 
dxDrawText("Buy ($250)", 381, 338, 505, 357, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) 
dxDrawText("Buy ($1500)", 555, 338, 679, 357, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) 
dxDrawImage(189, 241, 102, 81, "img/Repair.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
dxDrawImage(520, 239, 143, 98, "img/flip.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
dxDrawImage(359, 230, 104, 98, "img/Nitro.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
dxDrawImage(520, 239, 143, 98, "img/flip.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
end 
  
  
  
sShowing = false 
bindKey("f1","down", function ( ) 
if ( sShowing == true ) then  
removeEventHandler("onClientRender",root,dx_test) 
showCursor ( false ) 
else 
addEventHandler("onClientRender",root,dx_test) 
showCursor ( true ) 
end 
sShowing = not sShowing  
end 
) 
  
addEventHandler("onClientClick",root, 
function ( button , state )  
if( button == "left" and state == "up" ) then  
if ( sShowing == true ) then 
if ( isMouseInPosition (167, 333, 148, 28) ) then  
triggerServerEvent ( "Repair", localPlayer ) 
end 
end 
end 
end 
) 
  
  

Server

  
  
addEvent( "Repair", true ) 
addEventHandler( "Repair", root, 
function ()     
    if ( getPlayerMoney (source) >= 5000 ) then 
        local Veh = getPedOccupiedVehicle ( source ) 
        if Veh then 
            takePlayerMoney(source, 5000) 
            fixVehicle(Veh) 
        else 
            outputChatBox('خطأ لاتملك مركبه',source,255,0,0,true) 
        end 
    else 
        outputChatBox('ليس لديك مال كافي للشراء',source,255,0,0,true) 
    end 
end 
) 
  
  
  

mete.xml

  

    

Edited by Guest
Link to comment

بالنسبة ي صاحب الموضوع كود سعد صحـيح بس بتكون عندك مشكلة وهي

اذا ماكانت معك مركبـة وضغطت عـلى إصلاح بيسحـب منـك فـلوس

عشـان تواجـه المشـكلة ذي بدل مـلف السـيرفر

addEvent( "Repair", true ) 
addEventHandler( "Repair", root, 
 function() 
    if (getPlayerMoney(source) >= 5000) then 
        local Veh = getPedOccupiedVehicle(source) 
        if Veh then 
            fixVehicle(Veh) 
            takePlayerMoney(source, 5000) 
        else 
            outputChatBox('خطأ لاتملك مركبه',source,255,0,0,true) 
        end 
    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...