Jump to content

تصحيح كود


Recommended Posts

المشكلة الاولى ههنا

1- اما اكتب اسم اللاعب او الاى دى الخاص بيه غلط! يجيلى اخطاء

2- اما اكتب /kiss LiOneLMeSsI او /Kiss 1 اقصد يعنى اما اعمل الانيميشن بدون تواجد لاعب اخر بس يكون الانيميشن يتعمل علىيا انا...المشكلة هنا انه بيعمل الانيميشن وانا عاوزى ما يعمل الانيميشن الا فى تواجد لاعب اخر وليس انا...وشئ اخر اريد "التحقق اذا كان اللاعب الاخر يقف امام اللاعب الخاص بى فى وجهه.....اذا ليم يكن واقف فى وجهه لا يمكن عمل ال انيميشن

    function kiss (thePlayer, cmd, arg) 
    if arg then 
    local id = tonumber(arg) 
    if id then 
            otherPlayer = exports.ID_System:getPlayerFromID(id) 
    else 
            otherPlayer = getPlayerFromName (arg) 
    end 
    local x, y, z = getElementPosition(thePlayer) 
    local tx, ty, tz = getElementPosition(otherPlayer) 
                if otherPlayer ~= player then 
                if (getPedOccupiedVehicle(thePlayer) == false and getPedOccupiedVehicle(otherPlayer) == false) then 
                if (getDistanceBetweenPoints3D(x, y, z, tx, ty, tz)<1) then 
                setPedAnimation (thePlayer, "KISSING", "Grlfrd_Kiss_03", -1, true, false, false ) 
                setPedAnimation (otherPlayer, "KISSING", "Grlfrd_Kiss_03", -1, true, false, false ) 
                bindKey (thePlayer, "space", "down", StopCommand) 
                end 
            end 
        end 
    end 
end 
addCommandHandler ("kiss", kiss) 
  
    function StopCommand ( source ) 
    setPedAnimation ( source ) 
    unbindKey ( source, "space", "down", StopCommand) 
    end 

  
[00:45:20] WARNING: Animation_system\Kiss_Anim\anim.lua:12: Bad argument @ 'getE 
lementPosition' [Expected element at argument 1, got boolean] 
[00:45:20] WARNING: Animation_system\Kiss_Anim\anim.lua:14: Bad 'ped' pointer @ 
'getPedOccupiedVehicle'(1) 
[00:45:20] WARNING: Animation_system\Kiss_Anim\anim.lua:14: Bad argument @ 'getP 
edOccupiedVehicle' 
[00:45:20] WARNING: Animation_system\Kiss_Anim\anim.lua:15: Bad argument @ 'getD 
istanceBetweenPoints3D' 
[00:45:20] ERROR: Animation_system\Kiss_Anim\anim.lua:15: attempt to compare boo 
lean with number 
  
  

Link to comment
المشكلة الاولى ههنا

1- اما اكتب اسم اللاعب او الاى دى الخاص بيه غلط! يجيلى اخطاء

2- اما اكتب /kiss LiOneLMeSsI او /Kiss 1 اقصد يعنى اما اعمل الانيميشن بدون تواجد لاعب اخر بس يكون الانيميشن يتعمل علىيا انا...المشكلة هنا انه بيعمل الانيميشن وانا عاوزى ما يعمل الانيميشن الا فى تواجد لاعب اخر وليس انا...وشئ اخر اريد "التحقق اذا كان اللاعب الاخر يقف امام اللاعب الخاص بى فى وجهه.....اذا ليم يكن واقف فى وجهه لا يمكن عمل ال انيميشن

    function kiss (thePlayer, cmd, arg) 
    if arg then 
    local id = tonumber(arg) 
    if id then 
            otherPlayer = exports.ID_System:getPlayerFromID(id) 
    else 
            otherPlayer = getPlayerFromName (arg) 
    end 
    local x, y, z = getElementPosition(thePlayer) 
    local tx, ty, tz = getElementPosition(otherPlayer) 
                if otherPlayer ~= player then 
                if (getPedOccupiedVehicle(thePlayer) == false and getPedOccupiedVehicle(otherPlayer) == false) then 
                if (getDistanceBetweenPoints3D(x, y, z, tx, ty, tz)<1) then 
                setPedAnimation (thePlayer, "KISSING", "Grlfrd_Kiss_03", -1, true, false, false ) 
                setPedAnimation (otherPlayer, "KISSING", "Grlfrd_Kiss_03", -1, true, false, false ) 
                bindKey (thePlayer, "space", "down", StopCommand) 
                end 
            end 
        end 
    end 
end 
addCommandHandler ("kiss", kiss) 
  
    function StopCommand ( source ) 
    setPedAnimation ( source ) 
    unbindKey ( source, "space", "down", StopCommand) 
    end 

  
[00:45:20] WARNING: Animation_system\Kiss_Anim\anim.lua:12: Bad argument @ 'getE 
lementPosition' [Expected element at argument 1, got boolean] 
[00:45:20] WARNING: Animation_system\Kiss_Anim\anim.lua:14: Bad 'ped' pointer @ 
'getPedOccupiedVehicle'(1) 
[00:45:20] WARNING: Animation_system\Kiss_Anim\anim.lua:14: Bad argument @ 'getP 
edOccupiedVehicle' 
[00:45:20] WARNING: Animation_system\Kiss_Anim\anim.lua:15: Bad argument @ 'getD 
istanceBetweenPoints3D' 
[00:45:20] ERROR: Animation_system\Kiss_Anim\anim.lua:15: attempt to compare boo 
lean with number 
  
  

اى رد :/ ?

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