Jump to content

x[ مشكلة ]x طلب سيارة واحدة فقط


Recommended Posts

السلام عليكم

انا عندي ذا الكود

function r() 
local a = getLocalPlayer() 
local x, y, z = getElementPosition ( a ) 
createVehicle (411, x, y, z + 200 ) 
end 
addCommandHandler( "nob", r ) 

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

Link to comment

  
Car = {} 
  
function create(p) 
    pos = {getElementPosition(p)} 
    if isElement(Car[p]) then destroyElement(Car[p]) end     
    Car[p] = createVehicle(411,pos[1]+2 ,pos[2] ,pos[3]) 
    outputChatBox(' تم الحصول علي سيارة ',p ,0,255,0) 
end 
addCommandHandler('nob',create) 
  

ملف سيرفر

Edited by Guest
Link to comment
function create(p) 
    pos = {getElementPosition(p)} 
    if isElement(Car[p]) then destroyElement(Car[p]) end     
    Car[p] = createVehicle(411,pos[1]+2 ,pos[2] ,pos[3]) 
    outputChatBox(' تم الحصول علي سيارة ',p ,0,255,0) 
end 
addCommandHandler('nob',create) 
  

ملف سيرفر

Link to comment

Car = { } 
  
addCommandHandler('nob', 
function ( Player ) 
    if ( isElement(Car[Player]) ) then destroyElement(Car[Player]) end    
        Pos = { getElementPosition(Player)} 
        Car[Player] = createVehicle(411,Pos[1]+2 ,Pos[2] ,Pos[3]) 
        outputChatBox(' تم الحصول علي سيارة ',Player , 0, 255 ,0 , true ) 
end ) 
  

اها عالاعموم الكود

Link to comment

-- # Server Side  
  
local Table = { }; 
  
addEventHandler("onPlayerChat",root, function ( Message , Type ) 
if ( Type == 0 and Message == "سيارة" or Message == "سياره" ) then  
if ( isElement ( Table [ source ] ) ) then destroyElement ( Table [ source ] ) end  
local Position = { getElementPosition ( source ) }; 
Table [ source ] = createVehicle ( 411 , Position [ 1 ] , Position [ 2 ] , Position [ 3 ] ) 
warpPedIntoVehicle ( source , Table [ source ] ) 
    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...