pa3ck
Members-
Posts
1,141 -
Joined
-
Last visited
-
Days Won
7
Everything posted by pa3ck
-
And where did you define 'thePlayer'? thePlayer is not the same as localPlayer in client side... You will ALWAYS need to define the player element ( except when using functions that return source as a player element )
-
outputChatBox("You Now Take Job Killer",client )
-
local Enter = createMarker( -607.0859375 ,2600.5422363281 ,54.5, "cylinder", 1.5 ) local Exit = createMarker( -601.1005859375, 2600.1203613281, 53.0390625, "cylinder", 1.5 ) function EnterFunc( hitPlayer ) setElementPosition ( hitPlayer, -600.9814453125 ,-600.9814453125 ,55.5 ) -- set the x, y, z position where you want to be teleported end function ExitFunc( hitPlayer ) setElementPosition ( hitPlayer, -543.1064453125 ,2620.150390625 ,53.515625 ) -- same, set x, y and z. end addEventHandler( "onMarkerHit", Enter,EnterFunc ) addEventHandler( "onMarkerHit", Exit,ExitFunc )
-
It's server side, are you sure you defined the script as server in your meta.xml?
-
Remove local? Why would you need to remove it? That's nothing to do with MySQL... I suggest you start with easy scripts, don't go in to SQL if you don't know what's local for. Go step-by-step, don't rush it.
-
If you are in a vehicle and type /test it will load the power ( if it's in the SQL ) and set its handling. Go ahead and modify the script to load all of the vehicles, give it a try.
-
mysql = exports.mysql function loadpower ( thePlayer ) if exports.global:isPlayerLeadAdmin(thePlayer) then local veh = getPedOccupiedVehicle ( thePlayer ) local vehID = getElementData(veh, "dbid") local power = mysql:query_free("SELECT `power` FROM vehicles WHERE id="..vehID) power = tonumber ( power ) if power and veh then local success = setVehicleHandling ( veh, "engineAcceleration", power ) if success then exports.logs:dbLog(thePlayer, 40, veh, "SELECTPOWER: "..power.."") else outputChatBox ( "Setting power failed.", thePlayer, 255, 0, 0 ) end else outputChatBox ( "Setting power failed.", thePlayer, 255, 0, 0 ) end end end addCommandHandler( "test", loadpower ) -- If you use 'onResourceStart' then load and set the handlings for every vehicle with a loop
-
It's pretty straight forward. You need a function to retreive the handlings. Use 'SELECT' instead of 'INSERT' @ MySQL query, then set the handlings. It's nearly the same thing you've just done, if you could get this far, you will surely be able to do it.
-
Nope, it will do the same. @CodeLewis: check if the function toggleEditor has arguments. Maybe you can specify the player to show it. Otherwise, modify that function to do so. Huh? Why would it? hitElement is the element that has entered the marker, I don't get it why would it be the same.
-
marker = createMarker( 0, 0, 3, "cylinder", 1 ) addEventHandler('onClientMarkerHit', marker, function( hitElement) if hitElement == localPlayer or hitElement == getPedOccupiedVehicle ( localPlayer ) and getVehicleController( hitElement ) == localPlayer then exports.hedit:toggleEditor() end end)
-
That's impossible. Did you restart hedit after editing the meta.xml?
-
If you don't want the players to be able to use the command and bind ( command 'hedit' and the 'b' key ), go to this folder: hedit\client\gui. Open up 'guicreator.lua' and comment out lines 72, 73, so it should look like: --bindKey ( getUserConfig ( "usedKey" ), "down", toggleEditor ) --addCommandHandler ( getUserConfig ( "usedCommand" ), toggleEditor )
-
There is an other way. Go to the 'hedit' folder and open up your meta.xml file. Put this line anywhere and save it: function="toggleEditor" type="client"/> --> Client side only. You can now toggle the GUI from any resource like so: marker = createMarker( 0, 0, 3, "cylinder", 1 ) addEventHandler('onClientMarkerHit', marker, function() exports.hedit:toggleEditor() end)
-
executeCommandHandler - don't forget to define the player element.
-
You are only saving the 'power', you never retreive it from SQL, obviously, it won't load if you never wrote a function for it.
-
Try this map: http://oi60.tinypic.com/2jez9kw.jpg
-
Whats the difference? I don't know much about them.
-
"/do Description: IC emote . Used if you want to ask something roleplay wise or something what can't begin with your character name. Example 1: /do Is the door open? Result 1: * Is the door open? (( Firstname_Lastname )) Example 2: /do You can smell marijuana smoke from Mmartin. Result 2: * You can smell marijuana smoke from Mmartin. (( Firstname_Lastname ))" ~ LSRP
-
You can export functions. Just return your table like, pretend the resource is called 'wrCommon': plrMpState = { "something" } function exportTable( value ) if not value then return plrMpState else return plrMpState[ value ] end return false end Put this into your meta.xml: <export function="exportTable" type="client"/> <export function="exportTable" type="server"/> To get your values from the table use this in your scripts: plrMpState = exports.wrCommon:exportTable()
-
Always use debugscript, if you used it, you should have seen the error saying that these lines are incorrect: if source == guiGridListGetItemText(Para.gridlist[1],guiGridListGetSelectedItem(Para.gridlist[1])) ~= "Oyuncu sec" then local getComboPlayer = guiGridListGetItemText(Para.gridlist[1]),guiGridListGetSelectedItem(Para.gridlist[1])
-
And the last thing is getPlayerFromName
-
Relative: Left hand side of your screen is 0 and the right hand side of your screen is 1. So 0.5 is the centre. Absolute: As far as I know, it is counted in pixels, so, '20, 20' is going to be at the 20th pixel of your screen, if you get me. How to get the relative: Simple maths. Lets say, you want to draw a dxRectangle, starting at 0, 0 and you want the size to be half of the screen. Just do: local sX, sY = guiGetScreenSize() local rX, rY = sX * 0.5, sY * 0.5 -- 50% dxDrawRectangle(0, 0, rX, rY)
-
It's server side, right? Also, move this inside your function: local theVehicle = getPedOccupiedVehicle(localPlayer)
