Jump to content

*| مساعدة |*


Doffy

Recommended Posts

ابي اول ما اللاعب يختار الرو من الي في الايديهات الي في الجدول ويضغط علي زر الشراء يعطيه سيارة وياخذ منه فلوس
 

--Client
function buyV()
local sel = guiGridListGetSelectedItem (BuyCars.gridlist[1])
if sel ~= -1 and  source == takecar then 
local cost = guiGridListGetItemText (BuyCars.gridlist[1],sel,2)
local id = guiGridListGetItemData (BuyCars.gridlist[1],sel,1)
if getPlayerMoney() <= tonumber(cost) then return outputChatBox ("Sorry, you don't have enough money.",255,0,0) end
triggerServerEvent ("Vehicle",localPlayer,id,cost)
triggerEvent ("whenPlayerBuyVehicle",localPlayer)
guiSetVisible(wnd,false)
showCursor(false)
end
end
--Server
s={}
addEvent ("Vehicle",true)
addEventHandler ("Vehicle",root,
function (id,price)
takePlayerMoney (source,price)
if isElement(s[source]) then destroyElement(s[source]) end
s[source] = createVehicle (id,getElementPosition(source))
warpPedIntoVehicle (source,s[source])
end)

 

Link to comment
13 minutes ago, iMr.WiFi..! said:

نسيت تضيف الحدث 

السطر العشرين

امسح 

getElementPosition

وعرفها 

x,y,z = getElementPosition

x,y,z حطه

بدل getElementPosition في السطر 20

وسوي بدل 

triggerEvent

حطه

triggerServerEvent

ما نفع

--ServerSide
x,y,z = getElementPosition

s={}
addEvent ("Vehicle",true)
addEventHandler ("Vehicle",root,
function (id,price)
takePlayerMoney (source,price)
if isElement(s[source]) then destroyElement(s[source]) end
s[source] = createVehicle (id,x,y,z(source))
warpPedIntoVehicle (source,s[source])
end)
--ClientSide
function buyV()
local sel = guiGridListGetSelectedItem (BuyCars.gridlist[1])
if sel ~= -1 and  source == takecar then 
local cost = guiGridListGetItemText (BuyCars.gridlist[1],sel,2)
local id = guiGridListGetItemData (BuyCars.gridlist[1],sel,1)
if getPlayerMoney() <= tonumber(cost) then return outputChatBox ("Sorry, you don't have enough money.",255,0,0) end
triggerServerEvent ("Vehicle",localPlayer,id,cost)
triggerServerEvent ("whenPlayerBuyVehicle",localPlayer)
guiSetVisible(wnd,false)
showCursor(false)
end
end

 

takecar للمعلومة 
الي هو الزر حق الشراء

Link to comment
--ServerSide


s = { }
addEvent ("Vehicle",true)
addEventHandler ("Vehicle",root,
function (id,price)
takePlayerMoney (source,price)
if isElement(s[source]) then return destroyElement(s[source]) end
x,y,z = getElementPosition(source)
s[source] = createVehicle (id,x,y,z)
warpPedIntoVehicle (source,s[source])
end)
--ClientSide
function buyV()
local sel = guiGridListGetSelectedItem (BuyCars.gridlist[1])
if sel ~= -1 and  source == takecar then 
local cost = guiGridListGetItemText (BuyCars.gridlist[1],sel,2)
local id = guiGridListGetItemData (BuyCars.gridlist[1],sel,1)
if getPlayerMoney() < tonumber(cost) then return outputChatBox ("Sorry, you don't have enough money.",255,0,0) end
triggerServerEvent ("Vehicle",localPlayer,id,cost)
--triggerServerEvent ("whenPlayerBuyVehicle",localPlayer)
guiSetVisible(wnd,false)
showCursor(false)
end
end
addEventHandler("onClientGUIClick",root,buyV)

 

Link to comment
6 hours ago, iMr.WiFi..! said:

--ServerSide


s = { }
addEvent ("Vehicle",true)
addEventHandler ("Vehicle",root,
function (id,price)
takePlayerMoney (source,price)
if isElement(s[source]) then return destroyElement(s[source]) end
x,y,z = getElementPosition(source)
s[source] = createVehicle (id,x,y,z)
warpPedIntoVehicle (source,s[source])
end)
--ClientSide
function buyV()
local sel = guiGridListGetSelectedItem (BuyCars.gridlist[1])
if sel ~= -1 and  source == takecar then 
local cost = guiGridListGetItemText (BuyCars.gridlist[1],sel,2)
local id = guiGridListGetItemData (BuyCars.gridlist[1],sel,1)
if getPlayerMoney() < tonumber(cost) then return outputChatBox ("Sorry, you don't have enough money.",255,0,0) end
triggerServerEvent ("Vehicle",localPlayer,id,cost)
--triggerServerEvent ("whenPlayerBuyVehicle",localPlayer)
guiSetVisible(wnd,false)
showCursor(false)
end
end
addEventHandler("onClientGUIClick",root,buyV)

 

عندك خطا صديقي بسطر 7

بدآل price 

cost

Link to comment
1 hour ago, iMr.WiFi..! said:

تقدر تغير الاسم بعد الاستقبال يعني مو لازم يمشي نفس الاسم

لا ي صديقي , يطلع خطا ,

لو تعرفه بعد الاستقبال لازم :-

triggerServerEvent ("Vehicle",localPlayer,id,guiGridListGetItemText (BuyCars.gridlist[1],sel,2))

 

Link to comment
On ١‏/٣‏/٢٠١٧ at 15:30, #_iMr.[E]coo said:

لا ي صديقي , يطلع خطا ,

لو تعرفه بعد الاستقبال لازم :-


triggerServerEvent ("Vehicle",localPlayer,id,guiGridListGetItemText (BuyCars.gridlist[1],sel,2))

 

كلام الاخ وايفاي صحيح اهم شي يكون باي بارتمر

حسب الرقم اللي سوا فيه تراقر وبكيفك تغير الاسم مافي مشاكل

  • Like 1
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...