Jump to content

iPrestege

Members
  • Posts

    10,056
  • Joined

  • Days Won

    27

Everything posted by iPrestege

  1. Try this ; function aOnDraw ( ) dxDrawText ( 'Good Job ,Here is 10000$',247.0,332.0,917.0,373.0,tocolor(150,0,0,255),2.0,'pricedown','left','top',false,false,false ) setTimer ( function ( ) if getElementData ( localPlayer,'aOnDraw' ) == true then removeEventHandler ( 'onClientRender',root,aOnDraw ) setElementData ( localPlayer,'aOnDraw',false ) end end,3000,1 ) end addEvent ( 'onDelivered',true ) addEventHandler ( 'onDelivered',root, function ( ) local aDraw = getElementData ( localPlayer,'aOnDraw' ) if not aDraw or aDraw ~= true then addEventHandler ( 'onClientRender',root,aOnDraw ) setElementData ( localPlayer,'aOnDraw',true ) end end )
  2. رأيي انك تقولي لية بتعطينا ببلاش مافية احد يعطي شيء ببلاش
  3. Look's very awesome i've like that so keep the good job!
  4. The errors in your code you have to fix is : In the server side line 27 and 29 You are using triggerServerEvent but it's a client side function and i don't know why are you triggering it twice so it should be just after taking the money like this : triggerClientEvent ( player,'onDelivered',player ) In the client side from line 72 To 78 all wrong replace it like this you have to use 'onClientRender' To draw a text try the following : local aOnDraw = false function aOnDraw ( ) dxDrawText ( 'Good Job ,Here is 10000$',247.0,332.0,917.0,373.0,tocolor(150,0,0,255),2.0,'pricedown','left','top',false,false,false ) aOnDraw = true setTimer ( function ( ) if aOnDraw == true then removeEventHandler ( 'onClientRender',root,aOnDraw ) aOnDraw = false end end,5000,1 ) end addEvent ( 'onDelivered',true ) addEventHandler ( 'onDelivered',root, function ( ) if aOnDraw == false then addEventHandler ( 'onClientRender',root,aOnDraw ) end end ) And about your question how to create a table for the same marker do as the following : local aMyPositions = { { x,y,z }; { x,y,z }; { x,y,z }; { x,y,z }; }; for _,aV in ipairs ( aMyPositions ) do marker = createMarker ( aV[1],aV[2],aV[3],'cylinder',1,255,0,0,0 ); end None of my code's are tasted so try it and if there's any errors warnings in the debug post it here.
  5. local aRender = false function aGetPing ( ) if getPlayerPing ( localPlayer ) >= 100 then if aWindow and guiGetVisible ( aWindow ) == true and aRender == false then removeEventHandler( 'onClientRender',root,aGetPing ) guiSetVisible ( aWindow,false ) exports [ 'guimessages' ]:outputClient ( '[Bank-System] : #FF0000Bug Abuse Detected!',0,255,255 ) aRender = true setTimer ( function ( ) if aRender == true then addEventHandler ( 'onClientRender',root,aGetPing ) aRender = false end end,50,0 ) end end end addEventHandler ( 'onClientRender',root,aGetPing ) حطة بملف المود حق البنك وبدل aWindow بالنافذه حقتك اللي تبي تخفيها وجرب
  6. if you ever read the wiki as Dealman said you will know how to use it but i think you didn't even read the wiki examples because if you did you will know how to use that function but you are looking for someone to make it for you so yeah i waste my time in this topic trying give you some help.
  7. , وين المود؟ الرابط حقة من الكومنتي؟
  8. Because you are creating the table with the wrong way and you are using my script so it should be like this : executeSQLQuery( 'CREATE TABLE IF NOT EXISTS Marker_System ( posX, posY, posZ, r, g, b, ID)' ) Full server code from my resource : --][ -- ** Vehicle Marker System -- ** Ver (1) -- ** Scripted By Mr.Pres[T]ege -- ** 26 Fep --][ rRoot = getResourceRootElement(getThisResource()) Cars = {} antiFloodMarker = {} local cmd = 'RemoveMarker' --- Delete Marker Command local allowedGroup = 'Admin' local vehicleIDS = { -- Vehicle ID 602, 545 , 517, 401, 410, 518, 527, 436, 589, 580, 419, 439, 549, 526, 491,474, 445, 467, 604, 426, 507, 547, 585,405, 587, 409 } addEventHandler( 'onResourceStart', rRoot, function( ) executeSQLQuery( 'CREATE TABLE IF NOT EXISTS Marker_System ( posX, posY, posZ, r, g, b, ID)' ) for i, player in ipairs( getElementsByType( 'player' ) ) do if isObjectInACLGroup( 'user.'..getAccountName( getPlayerAccount( player ) ), aclGetGroup( allowedGroup ) ) then setElementData( player, 'OpenMakerPanel', true) else setElementData( player, 'OpenMakerPanel', nil) end end creatMarkerSystem() end ) function creatMarkerSystem() local GetAllMarker = executeSQLQuery( "SELECT * FROM Marker_System" ) if ( type ( GetAllMarker ) == "table" and #GetAllMarker > 0 ) then for i = 1, #GetAllMarker do local n = {GetAllMarker[i]["posX"], GetAllMarker[i]["posY"], GetAllMarker[i]["posZ"], GetAllMarker[i]["r"], GetAllMarker[i]["g"],GetAllMarker[i]["b"]} for ii = 1, #n do n[ ii ] = tonumber( n[ ii ] ) end local marker = createMarker( n[1], n[2], n[3], 'cylinder', 1.25, n[4], n[5], n[6], 255 ) setElementData( marker, 'id', i ) setElementData( marker, 'giveCarSystem', true ) end end end addEventHandler( 'onMarkerHit', rRoot, function( player ) if getElementType( player ) == 'player' and not getPedOccupiedVehicle( player ) then if getElementData( source, 'giveCarSystem' ) then randomCarID = tonumber(vehicleIDS[math.random(#vehicleIDS)]) if Cars[player] and getElementType(Cars[player]) == "vehicle" then destroyElement(Cars[player]) end x,y,z = getElementPosition(player) Cars[player] = createVehicle(randomCarID, x+1,y,z) if Cars[player] then warpPedIntoVehicle(player,Cars[player]) end end end end) addEventHandler( 'onPlayerJoin', root, function() setElementData( source, 'OpenMakerPanel', nil) end ) addEventHandler( 'onPlayerLogin', root, function( _, acc ) if isObjectInACLGroup( 'user.'..getAccountName( acc ), aclGetGroup( allowedGroup ) ) then setElementData( source, 'OpenMakerPanel', true) else setElementData( source, 'OpenMakerPanel', nil) end end ) addEventHandler( 'onPlayerLogout', root, function( _, acc ) triggerClientEvent( source, 'LogOutSetVisible', root) setElementData( source, 'OpenMakerPanel', nil) end ) addEvent( 'CreateMarker', true ) addEventHandler( 'CreateMarker', root, function( X, Y, Z, r, g, b) if antiFloodMarker[source] then return outputChatBox( "Please wait 6 seconds before creating new marker", source, 255, 255, 0 ) end antiFloodMarker[source] = true if getPedOccupiedVehicle( source ) then Z = Z else Z = Z - 1 end local AllMarker = executeSQLQuery( "SELECT * FROM Marker_System" ) id = #AllMarker + 1 executeSQLQuery( "INSERT INTO Marker_System ( posX, posY, posZ, r, g, b, ID ) VALUES ( "..X..", "..Y..", "..Z..", "..r..", "..g..", "..b..", "..id..")" ) local marker = createMarker( X, Y, Z, 'cylinder', 1.25, r, g, b, 255 ) setElementData( marker, 'giveCarSystem', true ) setElementData( marker, 'id', id ) outputChatBox( "Marker Was Created", source, 255, 255, 0 ) setTimer(removeFlood, 6000, 1, source) end ) function removeFlood(plr) if antiFloodMarker[plr] then antiFloodMarker[plr] = false end end addEventHandler("onPlayerQuit",root,function() if Cars[source] then destroyElement(Cars[source]) Cars[source] = nil end end) addEventHandler("onVehicleExplode",root,function() setTimer(destroyElement,2000,1,source) end) addCommandHandler( cmd, function(player, Command) if isObjectInACLGroup( 'user.'..getAccountName( getPlayerAccount( player ) ), aclGetGroup( allowedGroup ) ) then local mrker = getMarkerByHit( player ) if mrker then local id = tonumber ( getElementData( mrker, 'id') or 0 ) if id == 0 then return end if executeSQLQuery("DELETE FROM `Marker_System` WHERE `ID`=?", id) then destroyElement( mrker ) outputChatBox( "Marker Was Deleted", player, 255, 255, 0 ) else outputChatBox( "error", player, 255, 255, 0 ) end end else outputChatBox( "Access denied", player, 255, 255, 0 ) end end ) function getMarkerByHit( plr ) for i, v in ipairs( getElementsByType( 'marker', rRoot ) ) do if isElementWithinMarker(plr, v) then return v end end return false,outputChatBox( "Error: Please enter the marker", plr, 255, 255, 0 ) end
  9. So i think this what are you trying to do so read this example very well and understand it. local aMarkerOne = createMarker ( .... ) local aMarkerTwo = createMarker ( .... ) setElementData ( aMarkerOne,'aVehicles',1 ) setElementData ( aMarkerTwo,'aVehicles',2 ) local aMyVehicles = { [1] = { aID,aID,aID }; [2] = { aID,aID,aID }; } addEventHandler ( 'onClientMarkerHit',resourceRoot, function ( aHit ) if ( source == aMarkerOne or source == aMarkerTwo ) then if ( aHit and aHit == localPlayer and not isPedInVehicle( aHit ) and getElementData ( source,'aVehicles' ) ) then guiSetVisible ( aWnd,true ); guiGridListClear ( aGrid ); for _,aV in ipairs ( aMyVehicles [ getElementData ( source,'aVehicles' ) ] ) do guiGridListSetItemText ( aGrid,guiGridListAddRow ( aGrid ),1,getVehicleNameFromModel ( aV ),false,false ); end end end end ); Hope that help you make your script . @Best-Killer
  10. Try this and it should work ; function myTeamColor ( Player ) local ab = '#ffffff' if ab then local r,g,b = hex2rgb ( ab ) outputChatBox( 'your team color is : '..r..','..g..','..b..'',Player,g,b ) end end addCommandHandler ( 'myteamcolor',myTeamColor ) function hex2rgb(hex) hex = hex:gsub("#","") return tonumber("0x"..hex:sub(1,2)), tonumber("0x"..hex:sub(3,4)), tonumber("0x"..hex:sub(5,6)) end
  11. -- وعليكم السلام .. -- استعمل الوظائف التالية مع الاحداث : addEventHandler ( 'onClientGUIClick' ) triggerServerEvent getPlayerMoney takePlayerMoney giveWeapon
  12. هذي وظائف وحدث + استعمل : addEventHandler ( 'onResourceStart' ) getElementsType setElementData نسيت احط لكم هذي .. وسوي الاكواد
  13. حط داتا للاعب اول مايدخل السيرفر تحقق من سريالك : addEventHandler ( 'onPlayerJoin' ) getPlayerSerial setElementData -- وفي الادمنية ابحث عن الزر اللي يسوي الـ Warp Player To -- وابحث عن الحدث اللي يوم يضغط والتحقق وسوي تحقق اذا كان عنده داتا يطلع خطأ ومايسوي شيء --
  14. What you mean? create account here? you already have account in the forum and if you want to register a new account : https://forum.multitheftauto.com/register/ and please be more clear about what you are asking for.
  15. يسحبه كيف؟ رتبه ولا مكان؟
  16. for sure it will give you one result try it like this : local aR,aG,aB = hex2rgb ( ab )
  17. So you are saying i didn't respect you? really? i asked you to read the wiki and the examples and you post how to do it , It's all in the wiki and in the examples i think you know how to do it now and that's why you asked to lock this topic anyway if you are not going to read the wiki you will not become a scripter ever so good luck!
  18. remove tostring and tonumber . and use ipairs instead of pairs.
  19. I HAVE ASKED YOU IN THE PREVIOUS POST TO READ THE : O WIKI PAGE : Using guiGetScreenSize to fit GUI & DX drawing in all resolutions To get the precise coordinates of a GUI element or DX drawings, you need to decide which edges of the screen you want to have them positioned against, then you just need to find the difference between your screen size and your position values. For example, there is a DX text. It fits on 1024x768 resolution. function DXtext () dxDrawText(tostring "Hello World!",684.0,731.0,732.0,766.0,tocolor(0,255,255,175),1.0,"bankgothic","left","top",false,false,false) end addEventHandler ( "onClientRender", getRootElement(), DXtext ) Now if you want it to fit on all resolutions. Then follow these steps: 1. Add width and height variables to get GUI's screen size, here we use sWidth and sHeight. local sWidth,sHeight = guiGetScreenSize() -- The variables dxDrawText( "Hello World!",684.0,731.0,732.0,766.0,tocolor(0,255,255,175),1.0,"bankgothic","left","top",false,false,false) 2. Divide each of the DX text's position values by the screen size manually (remembering the resolution is 1024x768): Left position value is 684, 684/1024 = 0.668 Top position value is 731, 731/768 = 0.952 Right position values is 732, 732/1024 = 0.715 Bottom position value is 766, 766/768 = 0.997 You may want to use a calculator to help you count. 3. Now with the answer above remove all of the position values and replace it with the width or height variable multiplied by the answer. Which would be: local sWidth,sHeight = guiGetScreenSize() -- The variables dxDrawText("Hello World!",sWidth*0.668, sHeight*0.952, sWidth*0.715, sHeight*0.997,tocolor(0,255,255,175),1.0,"bankgothic","left","top",false,false,false) So the final results will be a DX text which will fit on all resolutions which will be: function DXtext () local sWidth,sHeight = guiGetScreenSize() -- The variables dxDrawText("Hello World!",sWidth*0.668, sHeight*0.952, sWidth*0.715, sHeight*0.997,tocolor(0,255,255,175),1.0,"bankgothic","left","top",false,false,false) end addEventHandler ( "onClientRender", getRootElement(), DXtext ) We can also do it by ourself doing some calculations in the code. This works in all resolution, adjusting the scale to all screen-sizes. local sx, sy = guiGetScreenSize( ) addEventHandler( "onClientRender", root, function( ) dxDrawText( "Hello World!", sx*( 684/1024 ), sy*( 731/768 ), sx*( 732/1024 ), sy( 766/768 ), tocolor(0,255,255,175), sx/1000*1.0,"bankgothic","left","top",false,false,false ) end )
  20. اطرح مود الساعات كامل والمفروض يشتغل عموماً جرب كذا وشوف تزيد ساعاتك ولالا استخدم الكوماند aAdd addCommandHandler ( 'aAdd', function ( aPlayer ) if aPlayer then aPlayTime = getElementData ( aPlayer,'PlayTime' ) or 0 setElementData ( aPlayer,'PlayTime',aPlayTime + 15 ); outputChatBox ( '* تم زيادة ساعاتك بمقدار 15 ساعه',aPlayer ) end end ); شوف يزيد او لا واطرح ملف السيرفر حق حفظ الساعات الى الان شاك ان الداتا عندك خطا مدري يعني المود منتشر فعادي اطرحة
  21. You can try this : aMyModels = { -- { FilePath Without.txd,ModelID }; { 'des_nw',11429 }; { 'des_nwTwo',11500 }; -- That's just an example. }; addEventHandler ( 'onClientResourceStart',resourceRoot, function ( ) for _,aV in ipairs ( aMyModels ) do if fileExists( ''..aV[1]..'.txd' ) then engineImportTXD ( engineLoadTXD ( ''..aV[1]..'.txd' ),aV[2] ); end end end );
  22. اعتقد ان playtime عندك هي PlayTime تاكد من الداتا
×
×
  • Create New...