Jump to content

طلب تعديل كود


Recommended Posts

السلام عليكم

ممكن تشوفون وش الخطأ في الكود ؟؟

myVehicles = { [470]=false,[560]=false,[562]=false,[487]=false } 
mySkins = { [115]=true } 
function enterVehicle ( thePlayer, seat, jacked ) 
    if ( myVehicles[getElementModel ( source )] ) and ( not mySkins[getElementModel ( thePlayer )] ) then 
        removePedFromVehicle ( thePlayer ) 
        outputChatBox ( "ممتلكات خاصة لايمكنك ركوب السيارة", thePlayer ) 
    end 
end 
addEventHandler ( "onVehicleEnter", getRootElement(), enterVehicle ) 

Edited by Guest
Link to comment

ادري بس انت حاط

false 

شوف ذذ الكود

car = createVehicle( ... ) 
MySerial = (سريالك هنا) 
function enter(thePlayer) 
   if(source==car and getPlayerSerial(thePlayer)~=MySerial)then 
      outputChatBox("املاك خاصه") 
         cancelEvent() 
      end 
end 
addEventHandler("OnVehicleStartEnter",root,enter 

Link to comment

جرب ذا

x,y,z = 0,0,0 
serial = "you serial here" 
MyCar = createVehicle(411,x,y,z) 
  
addEventHandler("onVehicleEnter",root, 
    function (player,seat) 
        if ( source == MyCar ) then 
            if ( getPlayerSerial(player) == serial ) then 
                outputChatBox("Welcome Back",player,0,255,0) 
            else 
                removePedFromVehicle(player) 
                outputChatBox("This Car is Not Your",player,255,0,0) 
            end 
        end 
    end 
) 

Link to comment
جرب ذا
x,y,z = 0,0,0 
serial = "you serial here" 
MyCar = createVehicle(411,x,y,z) 
  
addEventHandler("onVehicleEnter",root, 
    function (player,seat) 
        if ( source == MyCar ) then 
            if ( getPlayerSerial(player) == serial ) then 
                outputChatBox("Welcome Back",player,0,255,0) 
            else 
                removePedFromVehicle(player) 
                outputChatBox("This Car is Not Your",player,255,0,0) 
            end 
        end 
    end 
) 

الكود شغال مشكور بس المشكلة

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

يعني لما تركب ويكون سريالك غير يطلعك

انا ابيه يشيك على سريالك اذا غير يكنسل الوضيفة

ممكن تعدله

x,y,z = 1520.0999755859,2754,10.60000038147 
rx,ry,rz = 0,0,90 
serial = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 
MyCar = createVehicle(562,x,y,z,rx,ry,rz) 
  
addEventHandler("onVehicleEnter",root, 
    function (player,seat) 
        if ( source == MyCar ) then 
            if ( getPlayerSerial(player) == serial ) then 
                outputChatBox("Welcome Back",player,0,255,0) 
            else 
                removePedFromVehicle(player) 
                outputChatBox("This Car is Not Your",player,255,0,0) 
            end 
        end 
    end 
) 

Link to comment
  
theSerial = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 
createVehicle ( 562, 1520, 2754, 11, 0, 0, 90 ) 
  
addEventHandler ( "onVehicleStartEnter", getResourceRootElement ( getThisResource ( ) ), 
    function ( thePlayer ) 
        if getPlayerSerial ( thePlayer ) ~= theSerial then 
            outputChatBox ( "* Private Car !!", thePlayer, 255, 0, 0, true ) 
            cancelEvent ( ) 
        end 
    end 
) 
  

Link to comment
x,y,z = 1520.0999755859,2754,10.60000038147 
rx,ry,rz = 0,0,90 
serial = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 
MyCar = createVehicle(562,x,y,z,rx,ry,rz) 
  
addEventHandler("onVehicleEnter",root, 
    function (player,seat) 
        if ( source == MyCar ) then 
            if ( seat == 0 ) then 
                if ( getPlayerSerial(player) == serial ) then 
                    outputChatBox("Welcome Back",player,0,255,0) 
                else 
                    removePedFromVehicle(player) 
                    outputChatBox("This Car is Not Your",player,255,0,0) 
                end 
            else 
                outputChatBox("This Car is Not Your",player,255,0,0) 
            end 
        end 
    end 
) 

Link to comment
  
theSerial = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 
createVehicle ( 562, 1520, 2754, 11, 0, 0, 90 ) 
  
addEventHandler ( "onVehicleStartEnter", getResourceRootElement ( getThisResource ( ) ), 
    function ( thePlayer ) 
        if getPlayerSerial ( thePlayer ) ~= theSerial then 
            outputChatBox ( "* Private Car !!", thePlayer, 255, 0, 0, true ) 
            cancelEvent ( ) 
        end 
    end 
) 
  

كودك مو شغال

وش الخطأ في هاذه

  
    x,y,z = 1520.0999755859,2754,10.60000038147 
rx,ry,rz = 0,0,90 
serial = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 
MyCar = createVehicle(562,x,y,z,rx,ry,rz) 
  
addEventHandler("onVehicleEnter",root, 
    function (player,seat) 
        if ( source == MyCar ) then 
            if ( seat == 0 ) then 
                if ( getPlayerSerial(player) == serial ) then 
                    outputChatBox("Welcome Back",player,0,255,0) 
                else 
                    cancelEvent ( ) 
                    outputChatBox("This Car is Not Your",player,255,0,0) 
                end 
            else 
                outputChatBox("This Car is Not Your",player,255,0,0) 
            end 
        end 
    end 
) 

Link to comment
  
theSerial = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 
createVehicle ( 562, 1520, 2754, 11, 0, 0, 90 ) 
  
addEventHandler ( "onVehicleStartEnter", getResourceRootElement ( getThisResource ( ) ), 
    function ( thePlayer ) 
        if getPlayerSerial ( thePlayer ) ~= theSerial then 
            outputChatBox ( "* Private Car !!", thePlayer, 255, 0, 0, true ) 
            cancelEvent ( ) 
        end 
    end 
) 
  

Link to comment
  
theSerial = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 
createVehicle ( 562, 1520, 2754, 11, 0, 0, 90 ) 
  
addEventHandler ( "onVehicleStartEnter", getResourceRootElement ( getThisResource ( ) ), 
    function ( thePlayer ) 
        if getPlayerSerial ( thePlayer ) ~= theSerial then 
            outputChatBox ( "* Private Car !!", thePlayer, 255, 0, 0, true ) 
            cancelEvent ( ) 
        end 
    end 
) 
  

كودك مو شغال

تأكد انه سيرفر

 ="FileName.lua" type="server" /> 

Link to comment
مافيه كنسل لاكن في اقفال

في كنسل

https://wiki.multitheftauto.com/wiki/CancelEvent

حاولت اسويه بس ماضبط

ممكن تسويه لي

اذكر اني شفت في موضوع ان الكنسل ما ينفع مع افنت ركوب السياره

https://wiki.multitheftauto.com/wiki/OnVehicleStartEnter

Canceling

If this event is canceled, the player will not enter the vehicle.

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