
Hero192
Members-
Posts
512 -
Joined
-
Last visited
Everything posted by Hero192
-
Can you please do it for me i tried alot of time before i post any thing but i fails
-
I fixed the code but i get only distance for one marker and not all markers and i want to show the cash based on distances to the gridlist help me please local moneyTable = { {1111}, -- How to remplace the argument [1] in theTable by distance numbers as price {1111}, {1111}, {1111}, } markerpos = {} playerpos = {} addEventHandler("onResourceStart",resourceRoot, function () for index, data in pairs(markers) do local busmarker = createMarker(data.x, data.y, data.z-1, "cylinder", 1.5,247,187, 7, 120) markerpos = { getElementPosition( busmarker ) } addEventHandler("onMarkerHit",busmarker,onMarkerHit) end end) addEvent ("warpplayer",true) addEventHandler ("warpplayer",root, function () local px, py, pz = unpack ( playerpos ) local mx, my, mz = unpack ( markerpos ) playerpos = { getElementPosition( source ) } local distance = getDistanceBetweenPoints2D ( px, py , mx, my ) local cash = math.floor(distance / 2) if ( getPlayerMoney ( source ) < cash ) then outputChatBox (" You need ".. cash .."$ to use this service.", source, 255,0,0) else takePlayerMoney (source, cash ) end end)
-
Anyone?
-
Hey guys, today im making transport marker and i want make the price be as distance between player Position and markers Position Also i want the distance price shows on the gridlist i tried that but doesn't works anymore.. Please guys help me out Please try to help me i really stuck here --Server side: local markers = { --Markers table [1]={x=2220.43, y=2469.49, z=10.82, bx=2221.24, by=2468.76, blip=8, dim=0, int=0}, [2]={x=1625.00, y=1850.43, z=10.82, bx=1625.00, by=1850.43, blip=8, dim=0, int=0}, [3]={x= 1718.26, y=1484.68, z=10.82, bx=1718.26, by=1484.68, blip=8, dim=0, int=0}, [4]={x=1214.07, y=-1316.54, z=13.56, bx=1214.07, by=-1316.54, blip=8, dim=0, int=0}, } local moneyTable = { [1]={1111}, -- How to remplace the argument [1] in theTable by distance numbers as price [2]={1111}, [3]={1111}, [4]={1111}, } addEventHandler("onResourceStart",resourceRoot, function () for index, data in pairs(markers) do local zx, zy = getElementPosition(source) distance = getDistanceBetweenPoints2D(zx, zy, data.x, data.y) -- i tried but i failed local busmarker = createMarker(data.x, data.y, data.z-1, "cylinder", 1.5, 247,187, 7, 120) addEventHandler("onMarkerHit",busmarker,onMarkerHit) end end) addEvent ("warpplayer",true) addEventHandler ("warpplayer",root, function (ID) local cash = math.floor(distance / 2) if ( getPlayerMoney ( source ) < cash ) then outputChatBox (" You need ".. cash .."$ to use this service.", source, 255,0,0) else takePlayerMoney (source, cash ) end end) function onMarkerHit(hitPlayer) if ( getElementType ( hitPlayer ) == 'player' and not isPedInVehicle ( hitPlayer ) and not isPedDead ( hitPlayer ) ) then triggerClientEvent(hitPlayer,"showgui",hitPlayer,moneyTable) end end --Please try to help me i really stuck here
-
Thanks you and thanks all who tried to help me Please i need example i really im out of ideas about storing password / get them ,i need example to start working and get idea from it i hope you can help me
-
yes im not using /register, im using custom login system, how to store it and get it? by XML as you said
-
How to store it? what's the ways to do that, i have no idea about storing password and how to get the password after storing it im sure it's possible because in other servers if someone lost his account pass he tell you ,your password
-
I won't store players password i just i want to get them or see them by an cmd, I want to make command for admins and when i type the command like /player[Name] pass it will output text like that outputChatBox (.. accountPassword.. " is the password of the account name" ..accountName,player) it's just an example i have to define them but i don't know what's the function to get players password Another example: Simply , like if someone his account password is "123456" , if (Admin) typed the cmd ,the password of this guy will output in the chat only him who can see it
-
Hey guys, i know it's possible alot of servers get player accounts password so how to do this?
-
i added an custom row to the gridlist it's section row ,when i add it other rows triggered from an table became not selectable when i selecte them and i click on the button nothing happen and when i remove this custom row it works, the music works correctly.. Any idea? Here's the part of my code where the problem is exist addEvent ("callGUI", true) addEventHandler ("callGUI", root, function (Music) guiSetVisible (window, true) guiGridListClear(grid) showCursor (true) guiGridListSetItemText ( grid, guiGridListAddRow ( grid ), 1, "MyMusiclist", true, true ) --im talking about this row!! for index, v in ipairs (Music) do local row = guiGridListAddRow (grid) guiGridListSetItemText (grid, row, 1, v[1], false, false) end end)
-
EDIT: thanks about the idea i made it QUESTIONS: Why you used resourceRoot and not root or getElementRoot() ? and why we need to create an empty table like that ? Sound = {} Sound [source]
-
Hi Guys,i tried to get the arguments of this table named "Music" but it doesn't works i sent the table by trigger in a function but in another function it didn't works here's the table server sided: --server side: local Music = { { "Hip Hop Radio", "http://mp3uplink.duplexfx.com:8054/listen.pls" }, { "Electo", "http://stream.electroradio.ch:26630/" }, { "Reggae", "http://184.107.197.154:8002" }, { "Rap", "http://173.245.71.186:80" }, } --client side: function () local row,col = guiGridListGetSelectedItem( grid ) if Music [row+1][2] then sound = playSound3D (Music [row+1][2], x,y,z,true) setSoundVolume ( sound , 1 ) end end
-
Why i get this warning in line .. ? and can anyone clear this code speakerBox = {} addEvent ( "onPlayerPlaceSpeakerBox", true ) addEventHandler ( "onPlayerPlaceSpeakerBox", root, function (isCar ) if ( isElement ( speakerBox [source] ) ) then local x, y, z = getElementPosition ( speakerBox [source] ) destroyElement ( speakerBox [source] ) end local x, y, z = getElementPosition ( source ) local rx, ry, rz = getElementRotation ( source ) speakerBox [source] = createObject ( 2229, x-0.5, y+1, z-1, 0, 0, rx ) triggerClientEvent ( root, "onPlayerStartSpeakerBoxSound", root,source,isCar,defaultMusic) if ( isCar ) then local car = getPedOccupiedVehicle ( source ) local box = speakerBox [source] attachElements ( box, car, 0.25, -3.3, -0.5, -0.5, 0, 0 ) end end)
-
Anyone?
-
When the player spawn the vehicle i checked with the function isTimer like what you said if the timer still running or not but doesn't works Also please can you look at the elemnt datas because im not sure of myself if they're correct i still have no experience with elementdatas. addEvent("spawner",true) addEventHandler("spawner",root, function (player, vehicleID, marker) local x, y, z = getElementPosition(marker) Vehicles[player] = createVehicle(vehicleID, x, y, z+2, 0, 0, markers[marker][3]) warpPedIntoVehicle(player, Vehicles[player]) local Vehicle = Vehicles[player] local disableGhostMode= getElementData(player, "disableGhostMode") if not disableGhostMode then return end if isTimer disableGhostMode[player] then --Here where is the problem... setElementAlpha ( Vehicle, 150 ) else setElementAlpha ( Vehicle, 250 ) end end)
-
I tried what JR10 said but i failed can anyone help me?
-
Anyone please,im stuck here i tried alot of time but i out without result
-
Hey guys, i made an hospital system with spawn protection also i made vehicle spawner ,so my problem is i want to check if the disableGhostMode function is still running and the timer isn't false i mean 0sec. 1st code part is the spawnprotection its in hospital resource. 2nd code part is the vehicle spawner system in other resource, and its what im looking for, i want to know how to do an getElementData and setElementData in this situation to check if the timer is still not 0 sec or false if it still working not false then when a player spawn a car from the spawner system the vehicle be with 140ALPHA too and if the timer is on the 0sec then the vehicle should back to 255 ALPHA. --1st code part is the spawnprotection function enableGhostMode(player) setElementData( player, "spawnProtection", true ) toggleControl ( player,"fire", false ) toggleControl ( player,"next_weapon", false ) toggleControl ( player,"previous_weapon", false ) setElementAlpha( player, 170 ) end function disableGhostMode(player) setElementData(player,"disableGhostMode",disableGhostMode) setTimer( setElementData, 15000, 1, player, "spawnProtection", false ) setTimer( toggleControl, 15000, 1, player,"fire", true ) setTimer( toggleControl, 15000, 1, player,"next_weapon", true ) setTimer( toggleControl, 15000, 1, player,"previous_weapon", true ) setTimer( setElementAlpha, 15000, 1,player, 255 ) end --2nd code part is the vehicle spawner system addEvent("spawner",true) addEventHandler("spawner",root, function (player, vehicleID, marker) local x, y, z = getElementPosition(marker) Vehicles[player] = createVehicle(vehicleID, x, y, z+2, 0, 0, markers[marker][3]) warpPedIntoVehicle(player, Vehicles[player]) local Vehicle = Vehicles[player] local disableGhostMode= getElementData(player, "disableGhostMode") if not disableGhostModethen return end if (disableGhostMode== true) then setElementAlpha ( Vehicle, 150 ) else setElementAlpha ( Vehicle, 250 ) end end) I hope someone can help me because i stuck here.. thanks in advance
-
Why when i click on the ped it output to the chat a double messages not one addEventHandler ( 'onClientClick', root, function ( button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement ) if ( clickedElement ) and ( getElementType ( clickedElement ) == 'ped' ) then for i=1, #deliverys do if ( clickedElement == deliverys[i] ) then local x, y, z = getElementPosition(localPlayer) if getDistanceBetweenPoints3D(x, y, z, worldX, worldY, worldZ)<=5 then if ( getElementData ( localPlayer, "Job" ) ~= 'Criminal' ) then outputChatBox(" You must be criminal.",255,0,0) return end setElementData(deliverys[i], "del", true) if getElementData(deliverys[i],"del") then if ( guiGetVisible ( Window ) == false ) then guiSetVisible ( Window,true ) end end end end end end end)
-
I don't know how can you give me an example?
-
Hey guys, i want to get a number for each gridlist created and this number shows in the gridlist at the Column: "ID" i used the function guiGridListGetRowCount but i don't know how to use it in this situation.. please give me a hand local client = getLocalPlayer() window = guiCreateWindow(487,214,398,270,"Spawner",false) guiWindowSetSizable(window,false) guiSetVisible(window,false) grid = guiCreateGridList(9,21,380,212,false,window) guiGridListAddColumn(grid,"ID:",0.9) yes = guiCreateButton(28,238,148,23,"Spawn",false,window) no = guiCreateButton(224,238,148,23,"Close",false,window) addEvent("gui",true) addEventHandler("gui",root, function (Table) theMarker = marker guiSetVisible(window,true) showCursor(true) guiGridListClear(grid) for i,v in pairs(Table) do local row = guiGridListAddRow(grid) local guiGridListSetItemText(grid, row, 1, guiGridListGetRowCount(v), false, false) guiGridListSetItemText(grid, row, 2, getVehicleNameFromModel(v), false, false) end end)
-
Okay thanks , now we made the ghost system so how we can use this by getElementData from spawner system when the player spawn a car his vehicle should be with the ghost system , if the timer of ghostmod still not false i mean not 0 so the vehicle should be with the ghost mod too if the ghost mod ended then the vehicle will back to 255 ALPHA , i hope you can solve for me this because thats what i need
-
Thanks can you help me to create the setElementData of isSpawnProtectionEnabled to use the getElementData because i tried it and i failed , i hope you give me a hand on that