Jump to content

Bad Argument 'createVehicle' Thx 彡ṔĄ!И


Recommended Posts

Position = { 
    [1] = {x,y,z}, 
    [2] = {x,y,z}, 
    [3] = {x,y,z}, 
} 
  
addCommandHandler("set", 
function(player) 
    if getElementType(player) == 'player' then 
        Pos_X,Pos_Y,Pos_Z = unpack(Position[math.random(#Position)]) 
            setElementPosition(player,Pos_X,Pos_Y,Pos_Z) 
                local Position_X,Position_Y,Position_Z = getElementPosition(player) 
                    Car = createVehicle(605,Position_X,Position_Y,Position_Z) 
                        warpPedIntoVehicle(player,Car) 
        end 
    end 
) 

Bad argument @ 'createVehicle'[Expected number at argument2,got nil] 

:shock:

Edited by Guest
Link to comment
Position = { 
    [1] = {x,y,z}, 
    [2] = {x,y,z}, 
    [3] = {x,y,z}, 
} 
  
addCommandHandler("set", 
function(player) 
    if getElementType(player) == 'player' then 
        Pos_X,Pos_Y,Pos_Z = unpack(Position[math.random(#Position)]) 
            setElementPosition(player,Pos_X,Pos_Y,Pos_Z) 
                local Position_X,Position_Y,Position_Z = getElementPosition(player) 
                    Car = createVehicle(605,Position_X,Position_Y,Position_Z) 
                        warpPedIntoVehicle(player,Car) 
        end 
    end 
) 

Bad argument @ 'createVehicle'[Expected number at argument2,got nil] 

:shock:

لايوجد سيارة

ID = 605

هذه الغلط ذذ

Link to comment
Position = { 
    [1] = {x,y,z}, 
    [2] = {x,y,z}, 
    [3] = {x,y,z}, 
} 
  
addCommandHandler("set", 
function(player) 
    if getElementType(player) == 'player' then 
        Pos_X,Pos_Y,Pos_Z = unpack(Position[math.random(#Position)]) 
            setElementPosition(player,Pos_X,Pos_Y,Pos_Z) 
                local Position_X,Position_Y,Position_Z = getElementPosition(player) 
                    Car = createVehicle(605,Position_X,Position_Y,Position_Z) 
                        warpPedIntoVehicle(player,Car) 
        end 
    end 
) 

Bad argument @ 'createVehicle'[Expected number at argument2,got nil] 

:shock:

لايوجد سيارة

ID = 605

هذه الغلط ذذ

لا موجوده ذذ

Link to comment
Position = { 
    [1] = {x,y,z}, 
    [2] = {x,y,z}, 
    [3] = {x,y,z}, 
} 
  
addCommandHandler("set", 
function(player) 
    if getElementType(player) == 'player' then 
        Pos_X,Pos_Y,Pos_Z = unpack(Position[math.random(#Position)]) 
            setElementPosition(player,Pos_X,Pos_Y,Pos_Z) 
                local Position_X,Position_Y,Position_Z = getElementPosition(player) 
                    Car = createVehicle(605,Position_X,Position_Y,Position_Z) 
                        warpPedIntoVehicle(player,Car) 
        end 
    end 
) 

Bad argument @ 'createVehicle'[Expected number at argument2,got nil] 

لايوجد سيارة

ID = 605

هذه الغلط ذذ

لا موجوده ذذ

هههههههه سهران و مادري مخي وين راح

المهم انا جربت الكود و سويت للسيارة احداثيات و الكود تمام و شغال

يمكن المشكلة من الاحداثيات في الجدول :

  
Position = { 
    [1] = {2495.6311035156,-1670.9040527344,13.335947036743}, 
    [2] = {2478.4775390625,-1668.4677734375,13.330327033997}, 
    [3] = {2479.5393066406,-1655.3582763672,13.311396598816}, 
} 
  
addCommandHandler("set", 
function(player) 
    if getElementType(player) == 'player' then 
        Pos_X,Pos_Y,Pos_Z = unpack(Position[math.random(#Position)]) 
            setElementPosition(player,Pos_X,Pos_Y,Pos_Z) 
                local Position_X,Position_Y,Position_Z = getElementPosition(player) 
                    Car = createVehicle(605,Position_X,Position_Y,Position_Z) 
                        warpPedIntoVehicle(player,Car) 
        end 
  
    end 
  
) 
Link to comment
local Position = { 
    { x, y, z }, 
    { x, y, z }, 
    { x, y, z } 
} 
local vehicles = { } 
  
  
addCommandHandler( "set", 
    function( player ) 
        if isElement( vehicles[ player ] ) then 
            destroyElement( vehicles[ player ] ) 
        end 
        local Pos_X, Pos_Y, Pos_Z = unpack( Position[ math.random( #Position ) ] ) 
        setElementPosition( player, Pos_X, Pos_Y, Pos_Z ) 
        vehicles[ player ] = createVehicle( 605, Pos_X, Pos_Y, Pos_Z ) 
        if vehicles[ player ] then 
            warpPedIntoVehicle( player, vehicles[ player ] ) 
        end 
    end 
) 

Link to comment
local Position = { 
    { x, y, z }, 
    { x, y, z }, 
    { x, y, z } 
} 
local vehicles = { } 
  
  
addCommandHandler( "set", 
    function( player ) 
        if isElement( vehicles[ player ] ) then 
            destroyElement( vehicles[ player ] ) 
        end 
        local Pos_X, Pos_Y, Pos_Z = unpack( Position[ math.random( #Position ) ] ) 
        setElementPosition( player, Pos_X, Pos_Y, Pos_Z ) 
        vehicles[ player ] = createVehicle( 605, Pos_X, Pos_Y, Pos_Z ) 
        if vehicles[ player ] then 
            warpPedIntoVehicle( player, vehicles[ player ] ) 
        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...