SkyDow Posted March 14, 2023 Posted March 14, 2023 (edited) Hello, I want you to help me, please, with a problem related to the system. I wanted to change the coordinates to the market where you can enter and your quest will appear, and suddenly it doesn't work anymore?! Help me please nice!? I got you ! here is the problem that doesn't work! it's server.lua take it from the system. database = dbConnect( "sqlite", "database.db" ) dbExec(database, "CREATE TABLE IF NOT EXISTS players (playerl, maxq)") ped = createPed(413.712890625, 2537.95703125, 19.1484375,false) setElementFrozen(ped,true) createBlip(413.9287109375, 2536.9140625, 19.1484375) questCol = createColSphere (413.9287109375, 2536.9140625, 19.1484375 ) createMarker(2654.4,-2120,12.5, "cylinder", 1, 50, 255, 50, 200) function colHit(theElement) if source == questCol then triggerClientEvent(theElement, "onQuest", theElement,true) end end addEventHandler ( "onColShapeHit", getRootElement(), colHit) function addUserQuest() local result = dbPoll(dbQuery(database, "SELECT * FROM players WHERE playerl = ?",getAccountName(getPlayerAccount(source))),-1) if #result == 0 then if source then dbFree(dbQuery(database,"INSERT INTO players (playerl, maxq) VALUES (?,?)",getAccountName(getPlayerAccount(source)),0)) end end end addEvent("addUserQuest",true) addEventHandler("addUserQuest",getRootElement(),addUserQuest) Edited March 14, 2023 by WRIST
SkyDow Posted March 14, 2023 Author Posted March 14, 2023 [System]\system-quest\server.lua:6: Bad argument @ 'createPed' [Expected number at argument 4, got boolean] WARNING: [System]\system-quest\server.lua:7: Bad argument @ 'setElementFrozen' [Expected element at argument 1, got boolean] WARNING: [System]\system-quest\server.lua:10: Bad argument @ 'createColSphere' [Expected number at argument 4, got none]
alex17" Posted March 14, 2023 Posted March 14, 2023 ped = createPed("modelID", 413.712890625, 2537.95703125, 19.1484375, false) you did not put the ped model id
SkyDow Posted March 16, 2023 Author Posted March 16, 2023 (edited) WARNING: [Systeme]\system-quest\server.lua:6: Bad argument @ 'createPed' [Expected number at argument 5, got boolean] WARNING: [Systeme]\system-quest\server.lua:7: Bad argument @ 'setElementFrozen' [Expected element at argument 1, got nil] WARNING: [Systeme]\system-quest\server.lua:10: Bad argument @ 'createColSphere' [Expected number at argument 4, got createPed("217", 413.712890625, 2537.95703125, 19.1484375, false) setElementFrozen(ped,true) createBlip(413.9287109375, 2536.9140625, 19.1484375) questCol = createColSphere (413.9287109375, 2536.9140625, 19.1484375 ) createMarker(422.484375, 2469.0400390625, 26.739305496216, "cylinder", 1.5, 0, 100, 100, 200) and it doesn't work, when I enter the marker I don't see the list of missions! Edited March 16, 2023 by WRIST
Ciastuuś Posted March 16, 2023 Posted March 16, 2023 createPed("217", 413.712890625, 2537.95703125, 19.1484375, false) replace ped = createPed(217, 413.712890625, 2537.95703125, 19.1484375, false) --- questCol = createColSphere (413.9287109375, 2536.9140625, 19.1484375 ) replace questCol = createColSphere (413.9287109375, 2536.9140625, 19.1484375, radius_need_number ) radius_need_number - the collision sphere's radius
SkyDow Posted March 16, 2023 Author Posted March 16, 2023 radius_need_number - the collision sphere's radius where can I find this in the map editor or where?
FlorinSzasz Posted March 16, 2023 Posted March 16, 2023 54 minutes ago, WRIST said: radius_need_number - the collision sphere's radius where can I find this in the map editor or where? no, u write it how big u want the radius to be for the collision sphere. also use this client side to see how big is your ColSphere so u can adjust it. setDevelopmentMode (true) addCommandHandler ("devdebug", function () showCol (not isShowCollisionsEnabled()) end)
SkyDow Posted March 17, 2023 Author Posted March 17, 2023 15 hours ago, FlorinSzasz said: no, u write it how big u want the radius to be for the collision sphere. also use this client side to see how big is your ColSphere so u can adjust it. setDevelopmentMode (true) addCommandHandler ("devdebug", function () showCol (not isShowCollisionsEnabled()) end) better, please explain to me what this is, or some pictures, etc... radius_need_number - the collision sphere's radius
alex17" Posted March 17, 2023 Posted March 17, 2023 13 hours ago, WRIST said: better, please explain to me what this is, or some pictures, etc... radius_need_number - the collision sphere's radius the radius is the size that the colshapere will have, then when a player enters that radius the store will be activated. For example, if you put radius = 3, the store will activate when the players enter from the creation point 3 meters around But you are using a marker I would recommend you stick with just the marker and use onMarkerHit instead of onColShapeHit On the other hand, I would recommend you read the mta wiki to familiarize yourself with the functions you work with and their arguments. https://wiki.multitheftauto.com/wiki/CreatePed https://wiki.multitheftauto.com/wiki/CreateColSphere
AngelAlpha Posted March 17, 2023 Posted March 17, 2023 16 hours ago, WRIST said: better, please explain to me what this is, or some pictures, etc... radius_need_number - the collision sphere's radius try col radius - 3-4
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now