scaryface87
Members-
Posts
123 -
Joined
-
Last visited
Everything posted by scaryface87
-
Is it possible to get all words in the table shown in a gui? (gridlist) i tried the following already but it didnt work : window1 = guiCreateWindow(471, 219, 200, 210, "Words in randomizer", false) guiWindowSetSizable(window1, false) gridlist1 = guiCreateGridList(16, 50, 167, 146, false, window1) local row1 = guiGridListAddRow(gridlist1) local collumn1 = guiGridListAddColumn(gridlist1, "Words", 0.9) guiGridListSetItemText ( gridlist1, row1, collumn1, i dont know wht to put here) -- not ssure if this gonna work , idont know how to call the table in
-
Is it posssible to add an commandhandler to edit the tables? for example if i do /addword word3 it will add word 3 and if i do /removeword word3 it will remove it? local Table = { "word1", "word2" } function randomizer() word = Table[math.random(#Table)] outputChatBox("Random word "..word.."") end
-
Hi im getting an error bad argument #1 to random(interval is empty) local Table = { word1, word2 } function randomizer() word = Table[math.random(#Table)] outputChatBox("Random word "..word.."") end
-
Hello , I would like to know if its possible to get for example 25% chances that it gonna say You won Also is it possible to get Math.random with words? like it need to random chose a word in a table for example like Lover Badass ? function lotto() outputChatBox("You won!") -- u got 25% chance to get this else you get "you lose" end
-
Nothing in debugscript Found out the arrow was glitching. its working with a cylinder marker , Thank you for your time!!!
-
still not working after copy paste , some of my other scripts poped in too , i only removed the if matchingDimension to check if it was working then but now i tried to copy EXACTLY what you said now but it still didnt work
-
My whole code u mean? here it is
-
Doesnt seem to work also
-
Ok i tried to add the eventhandler in here ; function attchMarkerToAllVehicle () for i, vehicle in pairs(getElementsByType("vehicle")) do if not markers[vehicle] then local marker = createMarker( 0,0,0,"arrow",0.5,224,255,255,170) attachElements ( marker, vehicle, -1.5, 0, 1 ) markers[vehicle] = marker addEventHandler("onMarkerHit", markers[source],kickit) -- it must be inside the function end end end setTimer(attchMarkerToAllVehicle,1000,0) but it isnt doing something
-
Hi sorry to bumb but i dont get how to get a text showing in the chatbox if u enter the marker i tried this below but i cant seem to get the marker! function kickit() outputChatBox("Working!") end addEventHandler("onMarkerHit", markers[source],kickit)
-
Ah now i get it! Thank you will try it out tomorrow
-
[REL] GTWalrus police, wanted level and jail system
scaryface87 replied to Mr_Moose's topic in Resources
Hello , Is the script available with the driving cars and moving peds? or are it humans? Greetings , -
By a ped
-
Hello , Is it possible to make an vehicle follow you? I tried already with setControlState ( "accelerate", true ) i dont rlly want to use attachElement due fact the car kinda flys then and isnt turning good. Greetings
-
Didnt worki guess it still thinks theres a markers[source] , maybe i should remove that line from if not markers? worked if removing that one Thanks to help me both of you !!
-
Ok so i added a thing so if the car explodes it removes the mraker also ,i s htere a way to add again a marker if the car gets respawned? i tried addEventHandler ( "onVehicleRespawn", getRootElement(),attchMarkerToAllVehicle) on the main function of markers but didnt work out
-
Ah i see it didnt work with the model check but worked without , thank you
-
-- its not deleting it
-
Hi still having this error ; bad argument @destroyElement [exepted element at argument 1 got boolean) greetings
-
Hello , Sorry i got a little question if i want to make someting like destroy all markers if a car gets deleted how will it be? I tought something like ; function removemarker() destroyElement(marker) end addEventHandler("onElementDestroy",getRootElement(),removemarker)
-
Hm i get an error ; attempt to index global 'markers' a nil value might be due local marker = {} ? local markers = {} -- local marker = createMarker( 0,0,0,"cylinder",1.5,255,255,0,170) function attchMarkerToAllVehicle () for i, vehicle in pairs(getElementsByType("vehicle")) do if not markers[vehicle] then local marker = createMarker( 0,0,0,"cylinder",1.5,255,255,0,170) attachElements ( marker, vehicle, 0, 0, 0 ) markers[vehicle] = true end end end setTimer(attchMarkerToAllVehicle,1000,0) got it working thanks! but ambulances are also getting an marker but thats okay i will find it out with the getElementModel Thank you very much! greetings
-
Hello , That worked thanks but now i still have the problem with adding a marker to ALL cars in once (may need a timer every 15 mins or so to check for cars nd add marker if needed) I tought using getElementByType("vehicle") but then it gives an error on attachelement that argument 2 got a table thanks to help! Greetings , Jonas
-
Hi thank you to help me I got an error after trying ur script attempt to call global 'getElementModel' a nil valeu it works after removing the getelementmodel things (not a big problem if it goes to emergency cars then) So now my estion is should i set a timer on the function so it checks every amount of minutes if there are cars and if so it adds a marker? things i tried ; function attachMarker(player) if not isElement(player) then return end local theVehicle = getElementsByType("vehicle") if theVehicle then -- local model = getElemetModel(theVehicle) -- if (notAllowedVehicle[model]) then -- outputChatBox("you can't attach a marker to this type of vehicles",player,255,0,0) -- return -- end markers = createMarker( 0,0,0,"cylinder",1.5,255,255,0,170) attachElements ( markers, theVehicle, 0, 0, 0 ) end end addCommandHandler("attach",attachMarker) errors : exepted element at argument 2 got table Greetings
-
Thank you so basicly it gonna look something like this : notAllowedVehicle = { [416] = true -- Ambulance } function test () local theVehicle = getPedOccupiedVehicle ( source ) -- you must check the car model local model = getElemetModel(theVehicle) if (not allowedVehicle[model]) then -- nothing has to be done for not allowed vehicles else markers = createMarker( 0,0,0,"cylinder",1.5,255,255,0,170) attachElements ( markers, model, 0, 0, 5 ) end end addEventHandler("onResourceStart",getRootElement(),test) this code didnt work out ^ if i do so i get getpedoccupiedvehicle exepted ped at argument 1 got resource Sorry for this but im not so good in this one Greetings , Jonas
