Jump to content

iMr.WiFi..!

Members
  • Posts

    2,382
  • Joined

  • Last visited

  • Days Won

    57

Everything posted by iMr.WiFi..!

  1. ليش ' onClientMarkerHit ' هذا احسن ' onMarkerHit '
  2. في شيء اسمه حاول
  3. طيب بما انك تعرف تتكلم كثير ليش ما تدوره بنفسك ؟
  4. في خطأ اتوقع ال P ماهي معرفة
  5. تبي تصير مبرمج ناجح ؟ سوي اكواد يعني اشياء قد شفنها وحاول تربطها مع بعض يعني تفكر كيف اسوي كذاو كذا وتنتج نتيجة مقبولة ويصلحها غيرك , هذا لو كنت تبي تنجح , ماتقول ماعرف احاول مافي شيء في القاموس مكتوب معرف احاول
  6. تعلم تتكلم باحترام setPlayerVoiceBroadcastTo مدري لو هو
  7. اممم انا مستغرب ليش تحط return عند الايند ؟ جرب addCommandHandler("buyhouse", function(thePlayer) if(getElementData(thePlayer, "house:lastvisit")) and (getElementData(thePlayer, "house:lastvisit") ~= false) then local house = getElementData(thePlayer, "house:lastvisit") if(house) then local id = house local owner = houseData[id]["OWNER"] if(owner ~= "None") then outputChatBox("You can't buy this house!", thePlayer, 255, 0, 0) else local houses = 0 for index, col in pairs(getElementsByType("colshape")) do if(getElementData(col, "house") == true) and (houseData[getElementData(col, "ID")]["OWNER"] == getPlayerName(thePlayer)) then houses = houses+1 if(houses == max_player_houses) then return outputChatBox("You have allready "..max_player_houses.." houses! Sell a house to buy this one.", thePlayer, 255, 0, 0) end end end local money = getPlayerMoney(thePlayer) local price = houseData[id]["PRICE"] if(tonumber(money) < tonumber(price)) then return outputChatBox("You have not enought money! You need "..(price-money).."$ more!", thePlayer, 255, 0, 0) end setHouseData(id, "OWNER", getPlayerName(thePlayer)) takePlayerMoney(thePlayer, tonumber(price)) takePlayerMoney(thePlayer, tonumber(money)) outputChatBox("Congratulations! You bought the house!", thePlayer, 0, 255, 0) setElementModel(houseData[id]["PICKUP"], 1272) setElementModel(houseData[id]["BLIP"], 32) end end end end)
  8. يابني هذا حدث اذا اللاعب حدد عليه وش فيك يخي ؟
  9. خليه يطلب ويتدلل وش تبي فيه ضض بعدين المبرمجين بيعتزلون وما بيكون في اي مبرمج وهو يتدلل يقول وين الطلب حقي ؟؟
  10. شوف الطريقة : سوي حدث 'onClientKey' وتحقق انه ضغط الزرين مغ بعض and -- ثم سوي bindKey
  11. الله الله ي لعبة على تزبيط ي لعبة على تخطيط ي لعبةة , addEventHandler("onClientGUIClick",root, function () if ( source == GUIEditor.button[1]) then if ( guiGetText ( GUIEditor.edit[1] ) and ( guiGetText( GUIEditor.edit[3] ) ~= '' ) ) then if guiComboBoxGetSelected ( com ) == true then local row = guiGridListAddRow (GUIEditor.gridlist[1]) guiGridListSetItemText (GUIEditor.gridlist[1],row,1,text,false,false) -- text مهي معرفة ؟ guiGridListSetItemText (GUIEditor.gridlist[1],row,2,guiGetText(GUIEditor.edit[1]),false,false) guiGridListSetItemText (GUIEditor.gridlist[1],row,3,guiGetText(GUIEditor.edit[1]),false,false) end end end end )
  12. لا تحط احداثيات Z لانها الارتفاع وشتبي بالارتفاع عند وضع رادار
  13. الكود ذا سيرفر ولا كلينت ؟
  14. -- # SSSSSSSSSSERVER addEventHandler('onPlayerJoin', root, function() outputChatBox('* ' .. getPlayerName(source) .. ' has joined the game', root, 255, 100, 100, true) end ) addEventHandler('onPlayerChangeNick', root, function(oldNick, newNick) outputChatBox('* ' .. oldNick .. ' is now known as ' .. newNick, root, 255, 100, 100, true) end ) addEventHandler('onPlayerQuit', root, function(reason) exports.killmessages:outputMessage('* ' .. getPlayerName(source) .. '#0091FF has left Server AL MLOok [' .. reason .. ']', root, 255, 100, 100, true) end )
  15. واضحة يخوي posX = X احداثيات posY = Y احداثيات sizeX = حجم من ناحية X sizeY = حجم من ناحية Y color = اللون dimension = العالم
  16. addCommandHandler("buyhouse", function(thePlayer) if(getElementData(thePlayer, "house:lastvisit")) and (getElementData(thePlayer, "house:lastvisit") ~= false) then local house = getElementData(thePlayer, "house:lastvisit") if(house) then local id = house local owner = houseData[id]["OWNER"] if(owner ~= "None") then outputChatBox("You can't buy this house!", thePlayer, 255, 0, 0) else local houses = 0 for index, col in pairs(getElementsByType("colshape")) do if(getElementData(col, "house") == true) and (houseData[getElementData(col, "ID")]["OWNER"] == getPlayerName(thePlayer)) then houses = houses+1 if(houses == max_player_houses) then outputChatBox("You have allready "..max_player_houses.." houses! Sell a house to buy this one.", thePlayer, 255, 0, 0) return end end end local money = getPlayerMoney(thePlayer) local price = houseData[id]["PRICE"] if(money < price) then outputChatBox("You have not enought money! You need "..( tonumber(price) - tonumber(money)).."$ more!", thePlayer, 255, 0, 0) return end setHouseData(id, "OWNER", getPlayerName(thePlayer)) takePlayerMoney(thePlayer, tonumber(price)) outputChatBox("Congratulations! You bought the house!", thePlayer, 0, 255, 0) setElementModel(houseData[id]["PICKUP"], 1272) setElementModel(houseData[id]["BLIP"], 32) end end end end) جرب
  17. يوم تشوف كلمة Client احذفها وحطها في سيرفر
  18. local textsToDraw = {} local hideown local showtime local characteraddition local maxbubbles local showthebubbles = true function income(message,messagetype) if source ~= getLocalPlayer() or not hideown then if messagetype == 2 or messagetype == 1 then if getPlayerTeam(source) == getPlayerTeam(getLocalPlayer()) then addText(source,message,messagetype) end else addText(source,message,messagetype) end end end function addText(source,message,messagetype) local notfirst = false for i,v in ipairs(textsToDraw) do if v[1] == source then v[4] = v[4] + 1 notfirst = true end end local infotable = {source,message,messagetype,0} table.insert(textsToDraw,infotable) if not notfirst then setTimer(removeText,showtime + (#message * characteraddition),1,infotable) end end function removeText(infotable) for i,v in ipairs(textsToDraw) do if v[1] == infotable[1] and v[2] == infotable[2] then for i2,v2 in ipairs(textsToDraw) do if v2[1] == v[1] and v[4] - v2[4] == 1 then setTimer(removeText,showtime + (#v2[2] * characteraddition),1,v2) end end table.remove(textsToDraw,i) break end end end function getTextsToRemove() for i,v in ipairs(textsToDraw) do if v[1] == source then removeText(v) end end end function handleDisplay() if showthebubbles then for i,v in ipairs(textsToDraw) do if isElement(v[1]) then if getElementHealth(v[1]) > 0 then local camPosXl, camPosYl, camPosZl = getPedBonePosition (v[1], 6) local camPosXr, camPosYr, camPosZr = getPedBonePosition (v[1], 7) local x,y,z = (camPosXl + camPosXr) / 2, (camPosYl + camPosYr) / 2, (camPosZl + camPosZr) / 2 --local posx,posy = getScreenFromWorldPosition(x,y,z+0.25) local cx,cy,cz = getCameraMatrix() local px,py,pz = getElementPosition(v[1]) local distance = getDistanceBetweenPoints3D(cx,cy,cz,px,py,pz) local posx,posy = getScreenFromWorldPosition(x,y,z+0.020*distance+0.10) local elementtoignore1 = getPedOccupiedVehicle(getLocalPlayer()) or getLocalPlayer() local elementtoignore2 = getPedOccupiedVehicle(v[1]) or v[1] if posx and distance <= 45 and ( isLineOfSightClear(cx,cy,cz,px,py,pz,true,true,false,true,false,true,true,elementtoignore1) or isLineOfSightClear(cx,cy,cz,px,py,pz,true,true,false,true,false,true,true,elementtoignore2) ) and ( not maxbubbles or v[4] < maxbubbles ) then -- change this when multiple ignored elements can be specified local width = dxGetTextWidth(v[2],1,"default") dxDrawRectangle(posx - (3 + (0.5 * width)),posy - (2 + (v[4] * 20)),width + 5,19,tocolor(0,0,0,255)) dxDrawRectangle(posx - (6 + (0.5 * width)),posy - (2 + (v[4] * 20)),width + 11,19,tocolor(0,0,0,40)) dxDrawRectangle(posx - (8 + (0.5 * width)),posy - (1 + (v[4] * 20)),width + 15,17,tocolor(0,0,0,255)) dxDrawRectangle(posx - (10 + (0.5 * width)),posy - (1 + (v[4] * 20)),width + 19,17,tocolor(0,0,0,40)) dxDrawRectangle(posx - (10 + (0.5 * width)),posy - (v[4] * 20) + 1,width + 19,13,tocolor(0,0,0,255)) dxDrawRectangle(posx - (12 + (0.5 * width)),posy - (v[4] * 20) + 1,width + 23,13,tocolor(0,0,0,40)) dxDrawRectangle(posx - (12 + (0.5 * width)),posy - (v[4] * 20) + 4,width + 23,7,tocolor(0,0,0,255)) local r,g,b = 255,255,255 if v[3] == 2 then r,g,b = getTeamColor(getPlayerTeam(v[1])) end dxDrawText(v[2],posx - (0.5 * width),posy - (v[4] * 20),posx - (0.5 * width),posy - (v[4] * 20),tocolor(r,g,b,255),1,"default","left","top",false,false,false) end end end end end end function getServerSettings() triggerServerEvent("onAskForBubbleSettings",getLocalPlayer()) end function saveSettings(settings) showtime = settings[1] characteraddition = settings[2] maxbubbles = settings[3] hideown = settings[4] addEvent("onChatbubblesMessageIncome",true) addEventHandler("onChatbubblesMessageIncome",getRootElement(),income) end function toggleBubblesOnOff() showthebubbles = not showthebubbles outputChatBox("Toggled chatbubbles " ..( not showthebubbles and "#FF0000off#FFFFFF." or "#00FF00on#FFFFFF." ),255,255,255,true) end addEventHandler("onClientPlayerQuit",getRootElement(),getTextsToRemove) addEventHandler("onClientRender",getRootElement(),handleDisplay) addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),getServerSettings) addEvent("onBubbleSettingsReturn",true) addEventHandler("onBubbleSettingsReturn",getRootElement(),saveSettings) addCommandHandler("chatbubbles",toggleBubblesOnOff) local showtime = tonumber(get("chatbubbles.DefaultTime")) local characteraddition = tonumber(get("chatbubbles.PerCharacterAddition")) local maxbubbles = get("chatbubbles.MaxBubbles") if maxbubbles == "false" then maxbubbles = false else maxbubbles = tonumber(maxbubbles) end local hideown = get("chatbubbles.HideOwn") if hideown == "true" then hideown = true else hideown = false end function sendMessageToClient(message,messagetype) if not wasEventCancelled() then if messagetype == 0 or messagetype == 1 or messagetype == 2 then triggerClientEvent("onChatbubblesMessageIncome",source,message,messagetype) end end end function returnSettings() local settings = { showtime, characteraddition, maxbubbles, hideown } triggerClientEvent(source,"onBubbleSettingsReturn",getRootElement(),settings) end addEventHandler("onPlayerChat",getRootElement(),sendMessageToClient) addEvent("onAskForBubbleSettings",true) addEventHandler("onAskForBubbleSettings",getRootElement(),returnSettings)
  19. addCommandHandler("buyhouse", function(thePlayer) if(getElementData(thePlayer, "house:lastvisit")) and (getElementData(thePlayer, "house:lastvisit") ~= false) then local house = getElementData(thePlayer, "house:lastvisit") if(house) then local id = house local owner = houseData[id]["OWNER"] if(owner ~= "None") then outputChatBox("You can't buy this house!", thePlayer, 255, 0, 0) else local houses = 0 for index, col in pairs(getElementsByType("colshape")) do if(getElementData(col, "house") == true) and (houseData[getElementData(col, "ID")]["OWNER"] == getPlayerName(thePlayer)) then houses = houses+1 if(houses == max_player_houses) then outputChatBox("You have allready "..max_player_houses.." houses! Sell a house to buy this one.", thePlayer, 255, 0, 0) return end end end local money = getPlayerMoney(thePlayer) local price = houseData[id]["PRICE"] if(money < price) then outputChatBox("You have not enought money! You need "..(price-money).."$ more!", thePlayer, 255, 0, 0) return end setHouseData(id, "OWNER", getPlayerName(thePlayer)) takePlayerMoney(thePlayer, tonumber(price)) takePlayerMoney(thePlayer, tonumber(money)) outputChatBox("Congratulations! You bought the house!", thePlayer, 0, 255, 0) setElementModel(houseData[id]["PICKUP"], 1272) setElementModel(houseData[id]["BLIP"], 32) end end end end)
  20. 'onClientKey' if getElementDimension cancelEvent
  21. انا اقول في ناس تطلب اكواد وبدون ماتتعلم ما اقصدك , بس لو تحاول تفهم اسرع من الاكواد لعبة كثيرين من الناس يشوفو الفنكشنات ويسونها انا ماقول الغلط هنا اقول بعدين ذا شخص بيكرر ذا شيء يعني راعي الموضوع مو اقصدك انت اقصد اي راعي موضوع , انا استعجلت احط اكواد وماهتميت لحدث اون كلينت رندر
  22. امسكك ,! local textsToDraw = {} local hideown local showtime local characteraddition local maxbubbles local showthebubbles = true function income(message,messagetype) if source ~= getLocalPlayer() or not hideown then if messagetype == 2 or messagetype == 1 then if getPlayerTeam(source) == getPlayerTeam(getLocalPlayer()) then addText(source,message,messagetype) end else addText(source,message,messagetype) end end end function addText(source,message,messagetype) local notfirst = false for i,v in ipairs(textsToDraw) do if v[1] == source then v[4] = v[4] + 1 notfirst = true end end local infotable = {source,message,messagetype,0} table.insert(textsToDraw,infotable) if not notfirst then setTimer(removeText,showtime + (#message * characteraddition),1,infotable) end end function removeText(infotable) for i,v in ipairs(textsToDraw) do if v[1] == infotable[1] and v[2] == infotable[2] then for i2,v2 in ipairs(textsToDraw) do if v2[1] == v[1] and v[4] - v2[4] == 1 then setTimer(removeText,showtime + (#v2[2] * characteraddition),1,v2) end end table.remove(textsToDraw,i) break end end end function getTextsToRemove() for i,v in ipairs(textsToDraw) do if v[1] == source then removeText(v) end end end function handleDisplay() if showthebubbles then for i,v in ipairs(textsToDraw) do if isElement(v[1]) then if getElementHealth(v[1]) > 0 then local camPosXl, camPosYl, camPosZl = getPedBonePosition (v[1], 6) local camPosXr, camPosYr, camPosZr = getPedBonePosition (v[1], 7) local x,y,z = (camPosXl + camPosXr) / 2, (camPosYl + camPosYr) / 2, (camPosZl + camPosZr) / 2 --local posx,posy = getScreenFromWorldPosition(x,y,z+0.25) local cx,cy,cz = getCameraMatrix() local px,py,pz = getElementPosition(v[1]) local distance = getDistanceBetweenPoints3D(cx,cy,cz,px,py,pz) local posx,posy = getScreenFromWorldPosition(x,y,z+0.020*distance+0.10) local elementtoignore1 = getPedOccupiedVehicle(getLocalPlayer()) or getLocalPlayer() local elementtoignore2 = getPedOccupiedVehicle(v[1]) or v[1] if posx and distance <= 45 and ( isLineOfSightClear(cx,cy,cz,px,py,pz,true,true,false,true,false,true,true,elementtoignore1) or isLineOfSightClear(cx,cy,cz,px,py,pz,true,true,false,true,false,true,true,elementtoignore2) ) and ( not maxbubbles or v[4] < maxbubbles ) then -- change this when multiple ignored elements can be specified local width = dxGetTextWidth(v[2],1,"default") dxDrawRectangle(posx - (3 + (0.5 * width)),posy - (2 + (v[4] * 20)),width + 5,19,tocolor(0,0,0,255)) dxDrawRectangle(posx - (6 + (0.5 * width)),posy - (2 + (v[4] * 20)),width + 11,19,tocolor(0,0,0,40)) dxDrawRectangle(posx - (8 + (0.5 * width)),posy - (1 + (v[4] * 20)),width + 15,17,tocolor(0,0,0,255)) dxDrawRectangle(posx - (10 + (0.5 * width)),posy - (1 + (v[4] * 20)),width + 19,17,tocolor(0,0,0,40)) dxDrawRectangle(posx - (10 + (0.5 * width)),posy - (v[4] * 20) + 1,width + 19,13,tocolor(0,0,0,255)) dxDrawRectangle(posx - (12 + (0.5 * width)),posy - (v[4] * 20) + 1,width + 23,13,tocolor(0,0,0,40)) dxDrawRectangle(posx - (12 + (0.5 * width)),posy - (v[4] * 20) + 4,width + 23,7,tocolor(0,0,0,255)) local r,g,b = 255,255,255 if v[3] == 2 then r,g,b = getTeamColor(getPlayerTeam(v[1])) end dxDrawText(v[2],posx - (0.5 * width),posy - (v[4] * 20),posx - (0.5 * width),posy - (v[4] * 20),tocolor(r,g,b,255),1,"default","left","top",false,false,false) end end end end end end function getServerSettings() triggerServerEvent("onAskForBubbleSettings",getLocalPlayer()) end function saveSettings(settings) showtime = settings[1] characteraddition = settings[2] maxbubbles = settings[3] hideown = settings[4] addEvent("onChatbubblesMessageIncome",true) addEventHandler("onChatbubblesMessageIncome",getRootElement(),income) end function toggleBubblesOnOff() showthebubbles = not showthebubbles outputChatBox("Toggled chatbubbles " ..( not showthebubbles and "#FF0000off#FFFFFF." or "#00FF00on#FFFFFF." ),255,255,255,true) end addEventHandler("onClientPlayerQuit",getRootElement(),getTextsToRemove) addEventHandler("onClientRender",getRootElement(),handleDisplay) addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),getServerSettings) addEvent("onBubbleSettingsReturn",true) addEventHandler("onBubbleSettingsReturn",getRootElement(),saveSettings) addCommandHandler("chatbubbles",toggleBubblesOnOff) local showtime = tonumber(get("chatbubbles.DefaultTime")) local characteraddition = tonumber(get("chatbubbles.PerCharacterAddition")) local maxbubbles = get("chatbubbles.MaxBubbles") if maxbubbles == "false" then maxbubbles = false else maxbubbles = tonumber(maxbubbles) end local hideown = get("chatbubbles.HideOwn") if hideown == "true" then hideown = true else hideown = false end function sendMessageToClient(message,messagetype) if not wasEventCancelled() then if messagetype == 0 or messagetype == 2 then triggerClientEvent("onChatbubblesMessageIncome",source,message,messagetype) end end end function returnSettings() local settings = { showtime, characteraddition, maxbubbles, hideown } triggerClientEvent(source,"onBubbleSettingsReturn",getRootElement(),settings) end addEventHandler("onPlayerChat",getRootElement(),sendMessageToClient) addEvent("onAskForBubbleSettings",true) addEventHandler("onAskForBubbleSettings",getRootElement(),returnSettings)
  23. يابني لا تفكر كل شيء ببساطة , ماتوقع احد بيسوي لك تدري ليش ؟ كثرت الامثال الي تطلب الاكواد وماتتعلم شيء
×
×
  • Create New...