AL-SAYED Posted February 4, 2013 Share Posted February 4, 2013 شباب شلون اخلي bindKey على سيرفر مو كلنت ؟ Link to comment
MrCor Posted February 4, 2013 Share Posted February 4, 2013 addEventHandler ( "onResourceStart", resourceRoot, function ( ) for _, thePlayer in ipairs ( getElementsByType ( "player" ) ) do bindKey ( thePlayer, "الزر", "down", اسم الفكشن ) end end ) Link to comment
iMr.Dawix~# Posted February 4, 2013 Share Posted February 4, 2013 Client and Server function االبيند كي يجي سيرفر وكلنت يعني ماتوقع فيه فرق bindKey ( player thePlayer, string key, string keyState, string commandName, string arguments ) Link to comment
TD[M]ER Posted February 5, 2013 Share Posted February 5, 2013 اللي يجي لون الكود ازرق يعني كلنت وسيرفر مثل bindKey برتقالي = سيرفر فقط مثل getServerName احمر = كلنت فقط مثل guiSetText Link to comment
AL-SAYED Posted February 5, 2013 Author Share Posted February 5, 2013 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
AL-SAYED Posted February 5, 2013 Author Share Posted February 5, 2013 [2013-02-06 16:13:19] WARNING: new_shop\server.lua:295: Bad argument @ 'bindKey' Link to comment
iPrestege Posted February 5, 2013 Share Posted February 5, 2013 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
AL-SAYED Posted February 5, 2013 Author Share Posted February 5, 2013 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
AL-SAYED Posted February 5, 2013 Author Share Posted February 5, 2013 [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
iPrestege Posted February 5, 2013 Share Posted February 5, 2013 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
3NAD Posted February 5, 2013 Share Posted February 5, 2013 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
TAPL Posted February 5, 2013 Share Posted February 5, 2013 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
iPrestege Posted February 5, 2013 Share Posted February 5, 2013 مشكور تابل عـ التعديل نسيت انة لازم حدث لـ تثبيت المفتاح ذا حق الكود حق التصليح ض/ ذذ 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now