Jump to content

bindkey


AL-SAYED

Recommended Posts

  
addEventHandler ( "onResourceStart", resourceRoot, 
    function ( ) 
        for _, thePlayer in ipairs ( getElementsByType ( "player" ) ) do 
            bindKey ( thePlayer, "الزر", "down", اسم الفكشن ) 
        end 
    end 
) 

Link to comment
bindKey("R", "down", 
function() 
 if isPedInVehicle(source) then 
      if ( getPlayerMoney (source) >= 10000 ) then 
        takePlayerMoney(source, 10000) 
        rx, ry, rz = getVehicleRotation (getPedOccupiedVehicle(source))      
        setVehicleRotation (getPedOccupiedVehicle(source), rx +180, ry, rz +180) 
        outputChatBox("Car Successfully fliped", source, 255, 255, 0, true) 
      else 
        outputChatBox("Not enough money.", source, 255, 0, 0, true) 
      end      
    else 
      outputChatBox("You are not in a vehicle", source, 255, 0, 0, true) 
    end 
    end 
    ) 
  

شلون اخليه يسوي

يقلب السيارة

Link to comment
function Flip(player) 
if isPedInVehicle (player) then 
      if ( getPlayerMoney (player) >= 10000 ) then 
        takePlayerMoney(player, 10000) 
        rx, ry, rz = getVehicleRotation (getPedOccupiedVehicle(player)) 
        setVehicleRotation (getPedOccupiedVehicle(player), rx +180, ry, rz +180) 
        outputChatBox("Car Successfully fliped", player, 255, 255, 0, true) 
      else 
        outputChatBox("Not enough money.", player, 255, 0, 0, true) 
      end      
    else 
      outputChatBox("You are not in a vehicle", player, 255, 0, 0, true) 
        end 
    end 
  for k,v in ipairs(getElementsByType("player")) do 
        bindKey(v, "r", "down", Flip ) 
end 

-- Not Tested But Should Work . ماجربتة بس المفترض يشتغل على "السيرفر" ذذ

Link to comment
  
function Repair(player) 
if isPedInVehicle(source) then 
      if ( getPlayerMoney (source) >= 5000 ) then 
        takePlayerMoney(source, 5000) 
        fixVehicle(getPedOccupiedVehicle(source)) 
        outputChatBox("Vehicle Successfully Fixed", source, 255, 255, 0, true) 
      else 
        outputChatBox("Not enough money.", source, 255, 0, 0, true) 
      end      
    else 
      outputChatBox("You are not in a vehicle", source, 255, 0, 0, true) 
    end 
end 
  for k,v in ipairs(getElementsByType("player")) do 
        bindKey(v, "k", "down", Repair ) 
end 

لما خليت كود التصليح يجي لي

You are not in a vehicle

Link to comment

[2013-02-06 17:34:55] WARNING: new_shop\server.lua:275: Bad argument @ 'isPedInVehicle'

[2013-02-06 17:34:55] WARNING: new_shop\server.lua:275: Bad argument @ 'isPedInVehicle'

[2013-02-06 17:34:55] WARNING: new_shop\server.lua:275: Bad argument @ 'isPedInVehicle'

[2013-02-06 17:34:56] WARNING: new_shop\server.lua:275: Bad argument @ 'isPedInVehicle'

[2013-02-06 17:34:56] WARNING: new_shop\server.lua:275: Bad argument @ 'isPedInVehicle'

[2013-02-06 17:35:04] WARNING: new_shop\server.lua:275: Bad argument @ 'isPedInVehicle'

[2013-02-06 17:35:05] WARNING: new_shop\server.lua:275: Bad argument @ 'isPedInVehicle'

[2013-02-06 17:35:05] WARNING: new_shop\server.lua:275: Bad argument @ 'isPedInVehicle'

[2013-02-06 17:35:05] WARNING: new_shop\server.lua:275: Bad argument @ 'isPedInVehicle'

[2013-02-06 17:36:16] WARNING: new_shop\server.lua:275: Bad argument @ 'isPedInVehicle'

[2013-02-06 17:36:18] WARNING: new_shop\server.lua:275: Bad argument @ 'isPedInVehicle'

[2013-02-06 17:36:18] WARNING: new_shop\server.lua:275: Bad argument @ 'isPedInVehicle'

[2013-02-06 17:36:18] WARNING: new_shop\server.lua:275: Bad argument @ 'isPedInVehicle'

Link to comment
function Repair(player) 
if ( getPlayerMoney (player) >= 5000 ) then 
        takePlayerMoney(player, 5000) 
 local vehicle = getPedOccupiedVehicle(player) 
  if vehicle then 
      fixVehicle(vehicle) 
        outputChatBox("Vehicle Successfully Fixed", player, 255, 255, 0, true) 
      else 
        outputChatBox("Not enough money.", player, 255, 0, 0, true) 
      end      
    else 
      outputChatBox("You are not in a vehicle", player, 255, 0, 0, true) 
    end 
end 
  for k,v in ipairs(getElementsByType("player")) do 
        bindKey(v, "k", "down", Repair ) 
end 

Link to comment
addEventHandler ( "onResourceStart", resourceRoot, 
    function ( ) 
        for _, v in ipairs ( getElementsByType ( "player" ) ) do 
            bindKey ( v, "r", "down", Flip ) 
        end 
    end 
) 
  
addEventHandler ( "onPlayerJoin", root, 
    function ( ) 
        bindKey ( source, "r", "down", Flip ) 
    end 
) 
  
function Flip ( ) 
    if isPedInVehicle ( source ) then 
        if ( getPlayerMoney ( source ) >= 10000 ) then 
            takePlayerMoney ( source, 10000 ) 
            rx, ry, rz = getVehicleRotation ( getPedOccupiedVehicle( source ) )     
            setVehicleRotation ( getPedOccupiedVehicle ( source ), rx +180, ry, rz +180) 
            outputChatBox ( "Car Successfully fliped", source, 255, 255, 0, true ) 
        else 
            outputChatBox ( "Not enough money.", source, 255, 0, 0, true ) 
        end     
    else 
        outputChatBox ( "You are not in a vehicle", source, 255, 0, 0, true ) 
    end 
end 

Link to comment
addEventHandler ( "onResourceStart", resourceRoot, 
    function ( ) 
        for _, v in ipairs ( getElementsByType ( "player" ) ) do 
            bindKey ( v, "r", "down", Flip ) 
        end 
    end 
) 
  
addEventHandler ( "onPlayerJoin", root, 
    function ( ) 
        bindKey ( source, "r", "down", Flip ) 
    end 
) 
  
function Flip ( player ) 
    if isPedInVehicle ( player ) then 
        if ( getPlayerMoney ( player ) >= 10000 ) then 
            takePlayerMoney ( player, 10000 ) 
            rx, ry, rz = getVehicleRotation ( getPedOccupiedVehicle( player ) )     
            setVehicleRotation ( getPedOccupiedVehicle ( player ), rx +180, ry, rz +180) 
            outputChatBox ( "Car Successfully fliped", player, 255, 255, 0, true ) 
        else 
            outputChatBox ( "Not enough money.", player, 255, 0, 0, true ) 
        end     
    else 
        outputChatBox ( "You are not in a vehicle", player, 255, 0, 0, true ) 
    end 
end 

Link to comment

مشكور تابل عـ التعديل نسيت انة لازم حدث لـ تثبيت المفتاح :shock:

ذا حق الكود حق التصليح ض/ ذذ

addEventHandler ( "onResourceStart", resourceRoot, 
    function ( ) 
        for _, v in ipairs ( getElementsByType ( "player" ) ) do 
            bindKey ( v, "k", "down", Repair ) 
        end 
    end 
) 
  
addEventHandler ( "onPlayerJoin", root, 
    function ( ) 
        bindKey ( source, "k", "down", Repair ) 
    end 
) 
  
function Repair(player) 
if ( getPlayerMoney (player) >= 5000 ) then 
        takePlayerMoney(player, 5000) 
 local vehicle = getPedOccupiedVehicle(player) 
  if vehicle then 
      fixVehicle(vehicle) 
        outputChatBox("Vehicle Successfully Fixed", player, 255, 255, 0, true) 
      else 
        outputChatBox("Not enough money.", player, 255, 0, 0, true) 
      end      
    else 
      outputChatBox("You are not in a vehicle", 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...