Jump to content

تصحيح الكود


Recommended Posts

السلام عليكم ورحمة الله وبركاته

ما حل الخطأ بالكود؟

Begin() 
  
function Begin( ) 
 local Player = getRandomPlayer () 
 blip = createBlipAttachedTo ( player, 47) 
 setElementData( player, 'pplayer', true) 
 outputChatBox( '*kill'..getPlayerName( player ) ..' To Win $50000', root, 128, 128, 128) 
end 
  
  
addEventHandler("onPlayerWasted",root, function( _, Killer ) 
    if ( Killer and Killer ~= source and getElementType( Killer ) == "player") then 
        givePlayerMoney( Killer, 50000 ) 
        destroyElement(blip) 
        setElementData( source, 'pplayer', false) 
        outputChatBox('* '..getPlayerName( Killer )..' Killed ' ..getPlayerName( source )..' and win $50000.',root, 128, 128, 128 ) 
            setTimer( Begin,60000,1) 
    end 
end) 

debugscript 3

ERROR: Missio-New\Mission.lua:1: attempt to call global 'Begin' (a nill value)

Link to comment
function Begin( ) 
 local Player = getRandomPlayer () 
 blip = createBlipAttachedTo ( player, 47) 
 setElementData( Player , 'pplayer', true) 
 outputChatBox( '*kill'..getPlayerName( Player ) ..' To Win $50000', root, 128, 128, 128) 
end 
 Begin() 
  
addEventHandler("onPlayerWasted",root,  
function( _, Killer ) 
    if ( Killer and Killer ~= source and getElementType( Killer ) == "player") then 
        givePlayerMoney( Killer, 50000 ) 
        destroyElement(blip) 
        setElementData( source, 'pplayer', false) 
        outputChatBox('* '..getPlayerName( Killer )..' Killed ' ..getPlayerName( source )..' and win $50000.',root, 128, 128, 128 ) 
            setTimer( Begin,60000,1) 
    end 
end 
) 

Link to comment
function Begin( ) 
 local Player = getRandomPlayer () 
 blip = createBlipAttachedTo ( player, 47) 
 setElementData( Player , 'pplayer', true) 
 outputChatBox( '*kill'..getPlayerName( Player ) ..' To Win $50000', root, 128, 128, 128) 
end 
 Begin() 
  
addEventHandler("onPlayerWasted",root,  
function( _, Killer ) 
    if ( Killer and Killer ~= source and getElementType( Killer ) == "player") then 
        givePlayerMoney( Killer, 50000 ) 
        destroyElement(blip) 
        setElementData( source, 'pplayer', false) 
        outputChatBox('* '..getPlayerName( Killer )..' Killed ' ..getPlayerName( source )..' and win $50000.',root, 128, 128, 128 ) 
            setTimer( Begin,60000,1) 
    end 
end 
) 

يجيني

خطأ بكود صنع علامة

الارقمنت الاول

Link to comment

تم حل المشكلة

الخطا بالاسم

اول حرف كبير :)

شكراً لك

--------------------------------------

خطأ بمود اخر

ERROR: GiveGLA'Gives-S.lua:6: attempt to perform arithmetic on a boolean value [DUP ×2]

addEvent("gla", true) 
addEventHandler("gla",root, 
function (player,gla) 
    if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)),aclGetGroup("Console")) then 
            for _,v in ipairs (getElementsByType("player")) do 
            setElementData(v, "GLA",getElementData(v,"GLA") + tonumber(gla)) 
            outputChatBox("#ff0000*#ffff00[Admin]#ff0000 The Console  #ffff00( " .. getPlayerName(player).. ") Give Players "..tonumber(gla).." Lanuhcer",v, 0, 150, 255, true) 
            end 
            else 
            outputChatBox("#ff0000*#ffff00[Admin]#ff0000 You do not have access to this.", player, 255, 0, 0,true) 
    end 
end) 
  

Link to comment
اطرح اكواد التريجر

و اتأكد ان الداتا رقم

client دي كلينت

  
givegla = guiCreateWindow(173, 58, 460, 316, "توزيع الانشرات من صنع جابر", false) 
guiWindowSetSizable(givegla, false) 
guiSetAlpha(givegla, 1.00) 
guiSetVisible(givegla,false) 
thegla = guiCreateEdit(121, 55, 201, 76, "الكمية", false, givegla) 
buttongive = guiCreateButton(160, 172, 123, 37, "اعطاء الاعبين", false, givegla) 
guiSetProperty(buttongive, "NormalTextColour", "FFFFFFFF") 
closegla = guiCreateButton(394, 25, 56, 24, "x", false, givegla) 
guiSetProperty(closegla, "NormalTextColour", "FFFFFFFF") 
  
  
  
addCommandHandler("GiveGLA", function() 
guiSetVisible(givegla,true) 
showCursor(true) 
end) 
  
addEventHandler("onClientGUIClick",root, function() 
    if (source == closegla) then 
        guiSetVisible(givegla,false) 
        showCursor(false) 
    end 
end) 
  
addEventHandler("onClientGUIClick",root, function() 
    if (source == buttongive) then 
local gla = guiGetText(thegla) 
        triggerServerEvent("gla",localPlayer,getLocalPlayer(),gla) 
    end 
end) 
  

Link to comment
اطرح اكواد التريجر

و اتأكد ان الداتا رقم

client دي كلينت

  
givegla = guiCreateWindow(173, 58, 460, 316, "توزيع الانشرات من صنع جابر", false) 
guiWindowSetSizable(givegla, false) 
guiSetAlpha(givegla, 1.00) 
guiSetVisible(givegla,false) 
thegla = guiCreateEdit(121, 55, 201, 76, "الكمية", false, givegla) 
buttongive = guiCreateButton(160, 172, 123, 37, "اعطاء الاعبين", false, givegla) 
guiSetProperty(buttongive, "NormalTextColour", "FFFFFFFF") 
closegla = guiCreateButton(394, 25, 56, 24, "x", false, givegla) 
guiSetProperty(closegla, "NormalTextColour", "FFFFFFFF") 
  
  
  
addCommandHandler("GiveGLA", function() 
guiSetVisible(givegla,true) 
showCursor(true) 
end) 
  
addEventHandler("onClientGUIClick",root, function() 
    if (source == closegla) then 
        guiSetVisible(givegla,false) 
        showCursor(false) 
    end 
end) 
  
addEventHandler("onClientGUIClick",root, function() 
    if (source == buttongive) then 
local gla = guiGetText(thegla) 
        triggerServerEvent("gla",localPlayer,getLocalPlayer(),gla) 
    end 
end) 
  

جرب

givegla = guiCreateWindow(173, 58, 460, 316, "توزيع الانشرات من صنع جابر", false) 
guiWindowSetSizable(givegla, false) 
guiSetAlpha(givegla, 1.00) 
guiSetVisible(givegla,false) 
thegla = guiCreateEdit(121, 55, 201, 76, "الكمية", false, givegla) 
buttongive = guiCreateButton(160, 172, 123, 37, "اعطاء الاعبين", false, givegla) 
guiSetProperty(buttongive, "NormalTextColour", "FFFFFFFF") 
closegla = guiCreateButton(394, 25, 56, 24, "x", false, givegla) 
guiSetProperty(closegla, "NormalTextColour", "FFFFFFFF") 
  
  
  
addCommandHandler("GiveGLA", function() 
guiSetVisible(givegla,true) 
showCursor(true) 
end) 
  
addEventHandler("onClientGUIClick",root, function() 
    if (source == closegla) then 
        guiSetVisible(givegla,false) 
        showCursor(false) 
    end 
end) 
  
addEventHandler("onClientGUIClick",root, function() 
    if (source == buttongive) then 
local gla = guiGetText(localPlayer) 
        triggerServerEvent("gla",localPlayer,gla) 
    end 
end) 

Link to comment
اطرح اكواد التريجر

و اتأكد ان الداتا رقم

client دي كلينت

  
givegla = guiCreateWindow(173, 58, 460, 316, "توزيع الانشرات من صنع جابر", false) 
guiWindowSetSizable(givegla, false) 
guiSetAlpha(givegla, 1.00) 
guiSetVisible(givegla,false) 
thegla = guiCreateEdit(121, 55, 201, 76, "الكمية", false, givegla) 
buttongive = guiCreateButton(160, 172, 123, 37, "اعطاء الاعبين", false, givegla) 
guiSetProperty(buttongive, "NormalTextColour", "FFFFFFFF") 
closegla = guiCreateButton(394, 25, 56, 24, "x", false, givegla) 
guiSetProperty(closegla, "NormalTextColour", "FFFFFFFF") 
  
  
  
addCommandHandler("GiveGLA", function() 
guiSetVisible(givegla,true) 
showCursor(true) 
end) 
  
addEventHandler("onClientGUIClick",root, function() 
    if (source == closegla) then 
        guiSetVisible(givegla,false) 
        showCursor(false) 
    end 
end) 
  
addEventHandler("onClientGUIClick",root, function() 
    if (source == buttongive) then 
local gla = guiGetText(thegla) 
        triggerServerEvent("gla",localPlayer,getLocalPlayer(),gla) 
    end 
end) 
  

جرب

givegla = guiCreateWindow(173, 58, 460, 316, "توزيع الانشرات من صنع جابر", false) 
guiWindowSetSizable(givegla, false) 
guiSetAlpha(givegla, 1.00) 
guiSetVisible(givegla,false) 
thegla = guiCreateEdit(121, 55, 201, 76, "الكمية", false, givegla) 
buttongive = guiCreateButton(160, 172, 123, 37, "اعطاء الاعبين", false, givegla) 
guiSetProperty(buttongive, "NormalTextColour", "FFFFFFFF") 
closegla = guiCreateButton(394, 25, 56, 24, "x", false, givegla) 
guiSetProperty(closegla, "NormalTextColour", "FFFFFFFF") 
  
  
  
addCommandHandler("GiveGLA", function() 
guiSetVisible(givegla,true) 
showCursor(true) 
end) 
  
addEventHandler("onClientGUIClick",root, function() 
    if (source == closegla) then 
        guiSetVisible(givegla,false) 
        showCursor(false) 
    end 
end) 
  
addEventHandler("onClientGUIClick",root, function() 
    if (source == buttongive) then 
local gla = guiGetText(localPlayer) 
        triggerServerEvent("gla",localPlayer,gla) 
    end 
end) 

الدي بق نفسه

Link to comment

كودك صح

المشكلة عندك عشان الداتا مش رقم

استخدم

  
addEventHandler ("onPlayerJoin",root, 
function () 
setElementData (source,"GLA",0) 
end 
) 
  
  
addEvent("gla", true) 
addEventHandler("gla",root, 
function (player,gla) 
    if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)),aclGetGroup("Console")) then 
            for _,v in ipairs (getElementsByType("player")) do 
            setElementData(v, "GLA",getElementData(v,"GLA") + tonumber(gla)) 
            outputChatBox("#ff0000*#ffff00[Admin]#ff0000 The Console  #ffff00( " .. getPlayerName(player).. ") Give Players "..tonumber(gla).." Lanuhcer",v, 0, 150, 255, true) 
            end 
            else 
            outputChatBox("#ff0000*#ffff00[Admin]#ff0000 You do not have access to this.", player, 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...