
scaryface87
Members-
Posts
123 -
Joined
-
Last visited
Everything posted by scaryface87
-
Im trying to make a script that adds a marker to the car wich is removeable and addable each time i use the script for example if i spawn a car it gets an "name" and an marker added on the carif the car gets destroyed the marker should be gone also but should be useable to other cars if its easier something like al cars exept some emergency cars should have a marker i just did an example now with spawning a rhino but i want it all cars exept emergency cars I hope u understund it , Thank you
-
Thanks didnt see i missed a ] i got other problem for setelementdata and more for setelementdata : exepted argument at argument 3 , got none , getelementdata: exepted element at argument 1 attachelelements : exepted element at argument 2 got boolean Greetings
-
Hello , I tried to make a marker on my spawned car but i cant seem to get it working I dont know if it will work since i couldnt get the script running so here it is : local markername = { [1] = { marker1 }, [2] = { marker2 }, [3] = { marker3 }, [4] = { marker4 }, [5] = { marker5}, [6] = { marker6 }, [7] = { marker7}, [8] = { marker8 }, [9] = { marker9}, [10] = { marker10}, [11] = { marker11} } function spawncar() spawnedcar = createVehicle ( 432, 1746.59534,2504.34888,7.60135 ) setElementData(spawnedcar,"spawnedcar") local vehicle = getElementData(vehicle,"spawnedcar") local markername = markername[ math.random( #markername ) markername = createMarker ( 0, 0, 0, "cylinder", 1.5, 255, 255, 0, 170 ) attachElements ( markername, vehicle, 0, 0, 5 ) end addCommandHandler("spawncar",spawncar) loading script failed "]" exepted near markername is the error i get
-
Hello , I tried to add the premade paths on npc hlc traffic but i dont see any cars , is this normal? Ok i got other question is it possible to save the cars? Greetings
-
Still same error and if getElementType ( p ) == "player" showed me that P is me , (i tried this within function ; if getElementType ( p ) == "player" then outputChatBox("It works!") else outputChatBox("You're not P") I putted my code after the getelementtype and now its working , thanks
-
Still the same error
-
Hm i tought something like this but i get an error : server lua 38 ; Attempt to perform arithmetic on local 'beginingTick' a boolean value i just made it with a test command to test it. local marker = createMarker ( 0, 0, 3, "cylinder", 5, 255, 255, 255, 255 ); function test () local beginingTick = getTickCount ( p ); setElementData(p,"test",tonumber(beginingTick)) end addCommandHandler("test",test) addEventHandler ( "onMarkerHit", marker, function ( p ) local beginingTick = getElementData(p,"test") outputChatBox ( "Time taken: ".. math.floor ( ( getTickCount ( ) - beginingTick ) / 100 ).. " seconds!", p ); end );
-
Hello , I would like to make some timer like in the gamemode from Race So it need to record the time from 1 to ... till it hits a marker , i guess killTimer on that marker. Then i would like it so if its below 1 minute for example it says "Congratz u finnished it within 1 minute" and if its above 1 minute it says "Ahw you needed more then 1 minute" I have no clues how to do this. If you could explain me what i should use it would be helpfull im ready to learn. sorry for no trys but i dont know how to start Thank you in advance!
-
Hello , Is it possible to make a ped with createPed and let it attack players? Thanks ,
-
Thanks
-
Hello , Im trying to make something like this ; if i do /open it opens a panel (already made) but then i got a gridlist for example "part 1" and "part 2" , i want it like if i click "part 1" that i see "part 1" for example and if i do "part 2" i see "party 2" Thanks
-
Hello , I would like to know how to save a note in guiCreateEdit. For example if player 1 opens the panel with guiCreateEdit then he sees the message in it , also he need to be able to edit it. if player 2 opens the panel then he can see the same message and he can edit it also. I just need to know how to save the text wich the players puts in. greetings
-
Hello , I found out a bug i think , If i drive a train on the rail roads then after a time i go "of the rail road" and go to sf in a straight line so the "track" ignores LV and goes to SF without having being on a track anyway to fix it? sorry for bad explaination Greetings , Scaryface87
-
not rlly but i forgot to paste the command handler sometimes i seen a error but i can only check it out tomorrow (currently on phone)
-
Hello the element's(player's) position isnt reseting / going somewhere cs1 = createColRectangle(377.94525,2432.49194, 53.5, 45 ) function owndebug() outputChatBox("YOU ENTERED A COLSHAPE") end addEventHandler("onColShapeHit",cs1,owndebug) function goAway( player ) for i, p in ipairs(getElementsByType("player")) do outputChatBox("does this even work?") -- not working local lol = isElementWithinColShape (p, cs1 ) local x, y, z = getElementPosition(p); local x = math.random(371, 373) local y = math.random(160, 165) setElementPosition(p, x, y, 1008.4) outputChatBox("You're position has being changed!") end end Greetings , scaryface87
-
A little bumb
-
For knowing if its used or not should i do something like this ; local test = data [2] ["name"] if name = test then ? (this is just a guess) Or should i do it otherS?
-
Hm can you maybe help me to learn how to use database? (sql if im right?) let me try it already ; (sorry if its that bad) function createSQL() executeSQLCreateTable ( "names", "account TEXT,name TEXT" ) end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()),createSQL) function test() name = executeSQLSelect ( "names", "account", "name = '" .. sourcename .. "'" ) -- stuck here end
-
i want everyones account actualy
-
Hm not working is it even possible with this? else i just do it with the players online! cuz i dont have knowledge with SQL
-
Ok so like this ; but i dont think it gonna look at everyones account no? local playerAccount = getPlayerAccount(source) -- get his account not sure if its from everyone's if (playerAccount) then if getAccountData(playerAccount,"name") then outputChatBox("This name is already taken!!") else outputChatBox("Congratz! this name is yours") setAccountData(playerAccount,"name")
-
Sorry but dont i have to use "players" since u said" "player" : a player connected to the server " cuz i want to check if someone got it or not , even if hes ofline so if someone got the name and hes ofline , i cant take it
-
Hello , I dont think that will work since it sets a elemtndata to everyone then if im right?(else u cant loop to all players to see if he has the elementdata) Or do u mean that it loops every player's elementdata? If so i can use it normal is it like this? : for i,v in ipairs getElementsByType("players") if getElementData(v,"name") then outputChatBox("This name is already taken!!") else outputChatBox("Congratz! this name is yours") setElementData(player,"name") Greetings , scaryface87
-
Hello , I would like to know how too know if a thing is already used for example if i want to buy a name and the name is already used it says "its already in use" I tried already some things and im willing to LEARN how to get this working I know i dont have every function yet if im right but im willing to learn since im out of clue function getName() name = guiGetText(editbox) -- to get the name inside the box if name then outputChatBox("Does this works?") -- debugger if that code up works setElementData(thePlayer,"name") -- not sure about this one too if it gets the name wich is in the box or not end -- the gui function guiOpen() window1 = guiCreateWindow(243, 147, 305, 264, "Buy your name!", false) guiWindowSetSizable(window1, false) editbox = guiCreateEdit(44, 62, 212, 28, "", false, window1) label = guiCreateLabel(46, 44, 206, 18, "Put here your name :", false, window1) button1 = guiCreateButton(23, 232, 74, 22, "Done", true, window1) guiSetProperty(button1, "NormalTextColour", "FF36FC01") addEventHandler("onClientGUIClick",button1,done) --- event button2 = guiCreateButton(182, 232, 74, 22, "Cancel", true, window1) guiSetProperty(button2, "NormalTextColour", "FFFE0000") addEventHandler("onClientGUIClick",button2,cancel) --- event end addCommandHandler("buyname",guiOpen) function cancel() guiSetVisible(false) end addEvent("cancel",true) addEventHandler("cancel",getRootElement(),cancel) function done() guiSetVisible(false) -- idk what to put here end addEvent("done",true) addEventHandler("done",getRootElement(),done) Greetings , Scaryface87
-
So 2GB Ram wwould be enough?