-
Posts
145 -
Joined
-
Last visited
Everything posted by Chronic
-
You don't name functions when you define it inside of addEventHandler I explained that terribly but here's an example function yo ( ) outputChatBox ( "yo" ) end addEventHandler ( "onClientRestore", root, yo ) addEventHandler ( "onClientRestore", root, function ( ) outputChatBox ( "yo" ) end ) Both would work, both would have the same result, but the second function cannot be called again later in the script.
-
Don't destroy test, if you do it won't spawn again. Use usePickup instead. function onHit() test = createPickup (653.35773, -1769.18567, 13.57368, 3, 1247, 10000 ) addEventHandler("onPickupHit",test, function(player) if isPedInVehicle(player) then local vehicle = getPedOccupiedVehicle(player) usePickup ( test, player ) setPlayerWantedLevel(getVehicleController(vehicle),getPlayerWantedLevel(getVehicleController(vehicle))-1) else setPlayerWantedLevel(player,getPlayerWantedLevel(player)-1) usePickup ( test, player ) end end) end addEventHandler("onResourceStart",resourceRoot, onHit) Also, what is the point of having the timer
-
function giveHealth ( p1, _, p2 ) if p2 then local ej = getPlayerFromName ( p2 ) if ej then local nab = getPlayerName ( p1 ) setElementHealth ( ej, 100 ) outputChatBox ( nab.." has given you 100% health.", ej ) end end end addCommandHandler ( "givehealth", giveHealth )
-
local serverResources = { "mta", "cows" } function ress( ) for k,resources in ipairs(serverResources) do outputChatBox(""..resources.."") end end addEvent("ResourcesTable", true) addEventHandler("ResourcesTable", root, ress) addCommandHandler("restest", ress)
-
We are here to help you, not do it for you. If you post your code I will be able to see your problem and fix it.
-
Yes it is possible, use createMarker
-
Oh wow I didn't even think of that and no problem
-
One way you could do it is if type ( theIP ) == "boolean" then setTimer (...) or something like that.. Good luck
-
guiGetVisible So you can check if the GUI is already open for the player.
-
function onLogin() if source == login then guiSetVisible(newGUI,true) showCursor ( true ) end end addEventHandler("onClientGUIClick",getRootElement(),onLogin) There are no GUI elements in onLogin Also, if source == login does not make sense. I recommend you look at the example at https://wiki.multitheftauto.com/wiki/OnClientGUIClick
-
No that would not work. If this is the entire script, then you would have to fix a number of things: 1. sWidth and sHeight are not defined. 2. digFont is not a font, I'm guessing you're going to be using a custom font. 3. There is no onClientRender handler. 4. In the picture the money is shown in white. The rgb values you put in your script would make the text black. Good luck
-
it is defined... acc = v
-
Can you explain this better?
-
Are you trying to disable weapons or stop the killing of innocent players, or..?
-
Assuming the Picking Car and Hiding Car are in the same script, you could use destroyElement ( OwnerVehicle )
-
This login panel uses XML to store data: https://community.multitheftauto.com/in ... ls&id=6367
-
getAttachedElements will output a table with all the elements attached to it, however if there are no elements attached to it it will return a blank table. If there are no elements attached to hitElement then line 6 will loop through an empty table. Good luck
-
Thanks Made, it was a problem in my meta.xml (facepalm)
-
That doesn't work either. Client side functions do not work.
-
Still doesn't work, it seems that when I deleted all the default resources none of the client-side functions work. Hmm
-
Tried it, doesn't work local jW = guiCreateWindow ( 0, 0, 0.5, 0.4, "yo", true ) guiSetVisible ( jW, true ) No errors in debug
-
So I deleted all the default scripts the only script I have is this: guiCreateWindow ( 0.5, 0.4, 1, 1, "yo", true ) That's the entire script but it doesn't work, it's on client side.
-
Thank you TAPL, your solution works
-
Alright I tried it, the skin gets set on login, however the team doesn't. addEventHandler ( "onPlayerQuit", root, function ( ) acc = getPlayerAccount ( source ) setAccountData ( acc, "team", getPlayerTeam ( source ) ) setAccountData ( acc, "skin", getElementModel ( source ) ) end ) addEventHandler ( "onPlayerLogin", root, function ( ) setElementModel ( source, getAccountData ( acc, "skin" ) ) setPlayerTeam ( source, getAccountData ( acc, "team" ) ) end )