-
Posts
976 -
Joined
-
Last visited
Everything posted by Scooby
-
im not sure that would work BinSlayer1, the last time i tried that, the marker detection area didnt seem to move with whatever its attached to (player/vehicle), it seems to still get triggered from wherever the marker was when it was attached to the handler. (maybe someone could clarify this? ) i suppose a colshape could be created just a bigger than the size of the vehicle at the time the vehicle is damaged, then checked to see if another vehicle is within the shape, or by checking the distance to the next closest vehicle at the time its damaged... however neither would be very accurate and still wouldnt return who hit who.
-
when i last tried this (around may 2011), its seems it wasnt possible to disable the vehicle weapons for ALL players, i tried for a long time adding things here and there to disable the vehicle weapons... whilst i was about 98% successful, there was still the odd couple of players that could still shoot. eventually after many nights of trying different things, i ended up removing the vehicles that could shoot.
-
there are some skins duplicated too or almost identical, so theres room to replace some without even noticing
-
there are already a few housing systems on the mta site, > community > resources (search for 'house') maybe it would be easier to convert one of these to suit your needs.
-
yes its possible, you can use element data or account data or any variables u choose. these can be in your function or passed to you function from another. eg: function whatever(arg1,arg2) --- arg's passed from elsewhere within your script. if (arg1 == blaaaa) then blah elseif (arg2 == blaaaaaaa) then blaaaah end end have a read here: https://wiki.multitheftauto.com/wiki/Scr ... troduction you should find everything u need to know.
-
local price = guiGridListGetItemText(Grid[1], sig, column2) this will return a string, try using local price = tonumber(guiGridListGetItemText(Grid[1], sig, column2))
-
maybe it'll be easier for you to work with the car details stored to your script for now, at least until you have the gui grid loading them all ok. you could do something like this, then after you can work on loading it from xml if u want. I load them this way in my script, new saw the need to load them from xml. you can easily get all the vehicle ID's off the wiki and add ur own prices to them to suit ur needs. Im not sure how ur current script is, so just call this function to load the cars into the gridlist. (you may need to alter the column widths) local cars = { 400, 401, 402, 404, 405, 409, 410, 411 } local prices = { 5995, 4995, 6995, 3495, 7999, 34995, 7995, 125000 } function createCarList() local column1 = guiGridListAddColumn(GUIEditor_Grid[1], "Vehicle", 0.50) local column2 = guiGridListAddColumn(GUIEditor_Grid[1], "price", 0.40) if (column1 and column2) then for a = 1,#cars do local name = getVehicleNameFromModel(cars[a]) local prices = tostring(price[a]) local row = guiGridListAddRow (GUIEditor_Grid[1]) if name ~= "" then guiGridListSetItemText (GUIEditor_Grid[1], row, column1, name, false, false) guiGridListSetItemText (GUIEditor_Grid[1], row, column2, prices, false, false) end end end end
-
Dont clear the timer as they leave then. Theres a few ways you can do it where the timer doesnt clear as they leave, using their name or ip. I think the max jail time on my server is 60 seconds, that seems a very long time when ur stuck in a jail cell with nothing to do.
-
might sound an odd question but why do u want to store the jail time remainding in an sql table? is there some reason why u dont use a variable?
-
add some debug to see if the function outputElementType is actually triggering. i havent tried using "onPlayerContact" before, however the wiki says: This event is triggered when a player stands on a different element than before. and the parameters say: * previousElement: The element player was standing on before. nil if none. * currentElement: The new element that the player is standing on now. nil if none.
-
well at least you've found the problem.
-
looks like you have a lot more work to do here but i guess untill u can see the gui, thats gonna be hard. you should try to find how far your script is getting by using outputDebugString("moo") in certain places of ur script. does the showGUI function get triggered as u hit the colshape? does the gui get created and u just cant see it? i dont know if its the right way, but what i do is create the GUI on client start, then use guiSetVisible(myGUI,true) when i need it to be seen. u look like uve made a good start so i wont post a fix for this just yet, have a try adding some debug lines to see if u can find where its going wrong. the marker or colshape will both work. (i use a marker in my server)
-
This has never happened before in my server... not that ive seen anyway. maybe people might have more of an idea if u say what resources ur using/gamemodes etc. And have u tried other gamemodes to see if it does it on those too? (ie: dm/freeroam/cdm)
-
its probably quicker to edit the gamemode you use and on spawn set it to set admin blips as red. failing that: function setAdminBlipColour(player) if (hasObjectPermissionTo(player, "function.kickPlayer", false)) then local attachedElements = getAttachedElements(player) if attachedElements then for k,v in ipairs(attachedElements) do if getElementType(v) == "blip" then setBlipColor(v,255,0,0,255) end end end end end function onSpawn() setTimer(setAdminBlipColour,500,1,source) end addEventHandler ( "onPlayerSpawn", getRootElement(), onSpawn)
-
in your script.. the addEventHandler line needs to be below/after the createButton line. in your script it would look like this: X = 0.415 Y = 0.7 Width = 0.25 Height = 0.2 btnLogin = guiCreateButton(X, Y, Width, Height, "Log In", true, wdwLogin) addEventHandler("onClientGUIClick", btnLogin, clientSubmitLogin, true) i dont know what else it is u want us to tell u if this is too hard to follow, maybe you should think about making an easier one first. maybe start with just a clientsided script, then once u get it working, add more to the gui. once u get that all working, u can a server side script to it. Hope this helps. what you have pasted here is still quite simple but is has a lot of mixed functions in it... if u need more lua explaining, u should read all the info related to each function on the wiki first.
-
yes what i first posted would give you the distance from player to object as requested, local x1,y1,z1 = getElementPosition(player) local x2,y2,z2 = getElementPosition(object) local distance = getDistanceBetweenPoints3D(x1, y1, z1, x2, y2, z2) but its quicker to just use a colshape as SDK suggested.
-
https://wiki.multitheftauto.com/wiki/AddCommandHandler https://wiki.multitheftauto.com/wiki/Get ... antedLevel https://wiki.multitheftauto.com/wiki/Character_Skins https://wiki.multitheftauto.com/wiki/GetPlayerSkin https://wiki.multitheftauto.com/wiki/GetPlayerTeam https://wiki.multitheftauto.com/wiki/Vehicle_IDs https://wiki.multitheftauto.com/wiki/IsPedInVehicle https://wiki.multitheftauto.com/wiki/WarpPedIntoVehicle not sure if u want to warp the criminal to you, or you and the car to the criminal.... im sure most of what u need can be found on the above links.
-
add it in the same function, 'below' where u define the button. btnLogin = guiCreateButton(X, Y, Width, Height, "Log In", true, wdwLogin) addEventHandler("onClientGUIClick", btnLogin, clientSubmitLogin, true) Remember to check what functions are client only too, in you original post you have clientside functions in your serverside script.. these wont work.
-
range as in distance? since all weapons have different ranges. either: getDistanceBetweenPoints2D( float x1, float y1, float x2, float y2 ) getDistanceBetweenPoints3D( float x1, float y1, float z1, float x2, float y2, float z2 ) depending on what u need it for. for more info: https://wiki.multitheftauto.com/wiki/Get ... enPoints2D https://wiki.multitheftauto.com/wiki/Get ... enPoints3D
-
no idea who you are on msn but i dont have anyone called ' Ins' i dont use msn much nowdays... im always ingame
-
not sure if he ever got it to work, so heres a basic one for you. it will allow players to /lock cars... local vehicleOwner = {} function lockCar( thePlayer ) local vehicle = getPlayerOccupiedVehicle( thePlayer ) local vehicleID = getVehicleID( vehicle ) if vehicle then if getVehicleOccupant( vehicle,0 ) == thePlayer then vehicleOwner[vehicle] = getPlayerName(thePlayer) setVehicleEngineState ( vehicle, false ) outputChatBox( "Vehicle Parked And Locked", thePlayer, 255, 0, 0 ) else outputChatBox("You need to be the driver!",thePlayer,255,0,0) end else outputChatBox("You need to be in a vehicle!",thePlayer,255,0,0) end end addCommandHandler ( "lock", lockCar ) function ownerCheck( thePlayer ) local playerName = getPlayerName(thePlayer) local owner = vehicleOwner[source] if owner == playerName then setVehicleEngineState ( source, true ) outputChatBox( "Vehicle Unlocked And Started", thePlayer, 0, 255, 0 ) vehicleOwner[source] = nil -- < remove the current owner end end addEventHandler( "onVehicleEnter", getRootElement(), ownerCheck ) function expelCheck( thePlayer ) local playerName = getPlayerName(thePlayer) local owner = vehicleOwner[source] if owner then if owner ~= playerName then removePlayerFromVehicle( thePlayer ) outputChatBox( "Vehicle Locked, Current Owner: " .. tostring(vehicleOwner[source]), thePlayer, 255, 0, 0 ) end end end addEventHandler( "onVehicleStartEnter", getRootElement(), expelCheck ) restarting the script will unlock all the cars and remove current owners.
-
no, its used to disable input keys from mta/gta like if u had an editbox where u could type, u would need to disable mta keys so 't' didnt bring up the chatbox or various binds dont interfere with what ur typing. but for u, u dont need it, u just need to show cursor so u can click a button. just swapped a few bits round quickly, have a try of it set out like this: function onStart( resource ) creategui() end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onStart) function creategui () weapwindow = guiCreateWindow(307,127,480,516,"Weapons Menu",false) CloseButton = guiCreateButton(180,375,108,41,"Close",false,weapwindow) addEventHandler("onClientGUIClick", CloseButton, hidegui, false) guiSetVisible ( weapwindow, false ) end function hidegui() if guiGetVisible ( weapwindow ) then guiSetVisible ( weapwindow, false ) showCursor( false ) end end function showgui () if not guiGetVisible ( weapwindow ) then guiSetVisible ( weapwindow, true ) showCursor( true ) end end addCommandHandler("weapwindow",showgui) also ul need to add a way to trigger it, im guessing ul add this once uve added the rest. ive added the command /weapwindow for u to show it.
-
is this only part of it? i notice you use guiSetInputEnabled but i dont see any need for this since theres no editboxes.
-
you know you have 2 gui windows here? GUIEditor_Window[1] and SHC_Testing_Server_Rules MTA_Image = guiCreateStaticImage(264,529,163,106,"images/mtalogo.png",false,SHC_Testing_Server_Rules) is in the other window > guiSetVisible( GUIEditor_Window[1], false) it looks like youre making it more complicated than it needs to be. just read through what youre doing. the tables youve made at the top: GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Memo = {} GUIEditor_Label = {} im guessing these are created by the gui editor... but its also an easy way to keep track of what youre doing, if you keep all the info to each window in theses tables. so u would have all your info in this window in: GUIEditor_Window[1] and all the buttons: GUIEditor_Button[1], GUIEditor_Button[2], GUIEditor_Button[3] and so on same with all the labels and memos. i'll let you look at what you have, if youre still stuck, say so and i'll help you more.