Doffy Posted February 28, 2017 Posted February 28, 2017 ابي اول ما اللاعب يختار الرو من الي في الايديهات الي في الجدول ويضغط علي زر الشراء يعطيه سيارة وياخذ منه فلوس --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)
iMr.WiFi..! Posted February 28, 2017 Posted February 28, 2017 نسيت تضيف الحدث السطر العشرين امسح getElementPosition وعرفها x,y,z = getElementPosition x,y,z حطه بدل getElementPosition في السطر 20 وسوي بدل triggerEvent حطه triggerServerEvent
Doffy Posted February 28, 2017 Author Posted February 28, 2017 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 للمعلومة الي هو الزر حق الشراء
iMr.WiFi..! Posted February 28, 2017 Posted February 28, 2017 --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)
^iiEcoo'x_) Posted February 28, 2017 Posted February 28, 2017 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
iMr.WiFi..! Posted March 1, 2017 Posted March 1, 2017 15 hours ago, #_iMr.[E]coo said: عندك خطا صديقي بسطر 7 بدآل price cost تقدر تغير الاسم بعد الاستقبال يعني مو لازم يمشي نفس الاسم
^iiEcoo'x_) Posted March 1, 2017 Posted March 1, 2017 1 hour ago, iMr.WiFi..! said: تقدر تغير الاسم بعد الاستقبال يعني مو لازم يمشي نفس الاسم لا ي صديقي , يطلع خطا , لو تعرفه بعد الاستقبال لازم :- triggerServerEvent ("Vehicle",localPlayer,id,guiGridListGetItemText (BuyCars.gridlist[1],sel,2))
Master_MTA Posted March 2, 2017 Posted March 2, 2017 On ١/٣/٢٠١٧ at 15:30, #_iMr.[E]coo said: لا ي صديقي , يطلع خطا , لو تعرفه بعد الاستقبال لازم :- triggerServerEvent ("Vehicle",localPlayer,id,guiGridListGetItemText (BuyCars.gridlist[1],sel,2)) كلام الاخ وايفاي صحيح اهم شي يكون باي بارتمر حسب الرقم اللي سوا فيه تراقر وبكيفك تغير الاسم مافي مشاكل 1
^iiEcoo'x_) Posted March 2, 2017 Posted March 2, 2017 5 hours ago, Master_MTA said: كلام الاخ وايفاي صحيح اهم شي يكون باي بارتمر حسب الرقم اللي سوا فيه تراقر وبكيفك تغير الاسم مافي مشاكل ما كنت اعرف 1
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