-
Posts
1,255 -
Joined
-
Last visited
Everything posted by .:HyPeX:.
-
Hey guys, i got a function to show my script gui after the login panel logins you, but apparently my script somehow only detects when using /login, althought the login panel does this: logIn(source, account, password) Any idea how to fix this?
-
But Tables are lost on script unload (It will be on every join to the server if client, or on every script restart if server)
-
But Tables are lost on script unload (It will be on every join to the server if client, or on every script restart if server)
-
Ur being too plain... Race Created the objects And assigned an event on a collision with them, and for creating them you gotta do the EDF part wich is not easy. Probably Just Load a map with race definitions, it might display them (if you added them in the map)
-
This happens randomly, can someone tell me whats going on with my editor?
-
There's no error, im reciving true as a return, Due to triggerClientEvent has no return part, it is returning true becouse it was successful, i need a way to take it back to client-side. About the wheels thing: Wheels = { { name = "Big Ray Wheel", price = "25000", upgrade = 1074 }, { name = "Black Badass", price = "25000", upgrade = 1076 }, { name = "Black Style Wheels", price = "25000", upgrade = 1085 }, { name = "Common Badass", price = "25000", upgrade = 1098 }, { name = "NFS Wheel 1", price = "25000", upgrade = 1075 }, { name = "Cool Wheel 1", price = "25000", upgrade = 1077 }, { name = "Styled Black", price = "25000", upgrade = 1096 }, { name = "Cool Grey", price = "25000", upgrade = 1081}, { name = "NFS Wheel 2", price = "25000", upgrade = 1080 }, { name = "Organe", price = "25000", upgrade = 1073 }, { name = "Cool Wheel 2", price = "25000", upgrade = 1078 }, { name = "Golden Style", price = "25000", upgrade = 1025 }, { name = "Really White Wheels", price = "25000", upgrade = 1082 }, { name = "Cool Wheel 3", price = "25000", upgrade = 1079 }, { name = "Cool Rays", price = "25000", upgrade = 1083 }, { name = "NFS Wheel 3", price = "25000", upgrade = 1097 }, { name = "4x4", price = "25000", upgrade = 1084 } }
-
Im getting return "true", when there's no reason specified for that... client: function RadioButtonClick() local cash = triggerServerEvent("getAccData", getLocalPlayer(), "cash") local row, column = guiGridListGetSelectedItem ( RadioGrid ) local name = guiGridListGetItemText( RadioGrid, row, 1 ) outputChatBox(cash) for i, v in ipairs(Wheels) do if tostring(v.upgrade) == tostring(name) then if cash >= v.price then local cash = cash - v.price triggerServerEvent("setAccData", getLocalPlayer(), "cash", cash) outputChatBox("#00aaff[WheelPanel]: Wheels Bought!", 255,255,255,true) v.price = "Bought!" else outputChatBox("#00aaff[WheelPanel]: You dont have enought money!", 255,255,255,true) end end end end server: function getAccData(data) outputChatBox("Recived player: ".. getPlayerName(source), getRootElement(), 255,255,255,true) outputChatBox("Recived data: ".. data, getRootElement(), 255,255,255,true) local acc = getPlayerAccount(source) local data = getAccountData(acc, data) return data end addEvent("getAccData", true) addEventHandler("getAccData", getRootElement(), getAccData
-
Hello guys, how can i set vehicle upgrades? i know there was a function or smth, but i cant find it...
-
Nevermind, found out it was becouse the image wasnt loaded in the meta.
-
i was passing a wrong arg to the function, now i got a problem, i output the upgrade to load right? i draw the same filename as upgrade, i checked the file and it is okay, but it loads the same image for 2 selects.. how this happened: i selected 2 wheels and previewed them, and they were same. Another player saw other 2 wheels same, but my match was okay for him.. So it is a strange thing. EDIT: Wondering arround changed some names, Found that it is the same One at the table whos bugging up, if i show it first it doesnt shows anything (somehow), but if i select another one and play it it shows, then i go back to the previous and it shows the one i had shown before. table: Upgrade: 1082 name: Really White Wheels Wheels = { { name = "Big Ray Wheel", price = "25000", upgrade = 1074 }, { name = "Black Badass", price = "25000", upgrade = 1076 }, { name = "Black Style Wheels", price = "25000", upgrade = 1085 }, { name = "Common Badass", price = "25000", upgrade = 1098 }, { name = "NFS Wheel 1", price = "25000", upgrade = 1075 }, { name = "Cool Wheel 1", price = "25000", upgrade = 1077 }, { name = "Styled Black", price = "25000", upgrade = 1096 }, { name = "Cool Grey", price = "25000", upgrade = 1081}, { name = "NFS Wheel 2", price = "25000", upgrade = 1080 }, { name = "Organe", price = "25000", upgrade = 1073 }, { name = "Cool Wheel 2", price = "25000", upgrade = 1078 }, { name = "Golden Style", price = "25000", upgrade = 1025}, { name = "Really White Wheels", price = "25000", upgrade = 1082 }, { name = "Cool Wheel 3", price = "25000", upgrade = 1079 }, { name = "Cool Rays", price = "25000", upgrade = 1083 }, { name = "NFS Wheel 3", price = "25000", upgrade = 1097 }, { name = "4x4", price = "25000", upgrade = 1084 } }
-
Hey guys, any tip on how to make this actually work? if i select a manual one it works.. local path = "WheelImages/"..upgrade..".png" local image = guiCreateStaticImage( 0.1, 0.1, 0.8, 0.6, tostring(path),true, ShowWindow)
-
Found out in the end that the script was not compatible with adding an object ontop, so i simply now add it on the last place and it works perfectly
-
Im doing something wrong? the wheels arent being shown when i open the gui.. local x,y = guiGetScreenSize() RadioWindow = guiCreateWindow(0.1, 0.2, 0.85, 0.6, "Wheel Script by HyPeX", true) RadioButton = guiCreateButton ( 0.05, 0.1, 0.2, 0.1, "Buy Wheels", true, RadioWindow ) DeleteButton = guiCreateButton( 0.3, 0.1, 0.2, 0.1, "Refund Wheels", true, RadioWindow) RadioPlayButton = guiCreateButton( 0.05, 0.25, 0.2, 0.1, "Select Wheels", true, RadioWindow) RadioWindowCloseButton = guiCreateButton( 0.05, 0.68, 0.45, 0.1, "Close Window", true, RadioWindow) RadioStopButton = guiCreateButton( 0.3, 0.25, 0.2, 0.1, "Unload Wheels", true, RadioWindow) RadioGetNameButton = guiCreateButton( 0.05, 0.4, 0.2, 0.1, "Show Selected Wheel", true, RadioWindow) RadioGrid = guiCreateGridList( 0.55, 0.1, 0.4, 0.8, true, RadioWindow) guiGridListSetScrollBars(RadioGrid,false,true) StationIDColumn = guiGridListAddColumn( RadioGrid, "ID", 0.2) StationNameColumn = guiGridListAddColumn( RadioGrid, "Wheel Name", 0.4) StationLinkColumn = guiGridListAddColumn( RadioGrid, "Price", 0.5) Wheels = {} Wheels["1085"] = {name = "Big Ray Wheel", price = "25000"} Wheels["1096"] = {name = "Black Badass", price = "25000"} Wheels["1097"] = {name = "Styled Wheels", price = "25000"} Wheels["1098"] = {name = "Common Badass", price = "25000"} Wheels["1079"] = {name = "NFS Wheel 1", price = "25000"} Wheels["1075"] = {name = "Cool Wheel 1", price = "25000"} Wheels["1074"] = {name = "Styled Black", price = "25000"} Wheels["1081"] = {name = "Cool Grey", price = "25000"} Wheels["1080"] = {name = "NFS Wheel 2", price = "25000"} Wheels["1073"] = {name = "Organe", price = "25000"} Wheels["1077"] = {name = "Cool Wheel 2", price = "25000"} Wheels["1083"] = {name = "Golden Style", price = "25000"} Wheels["1082"] = {name = "Shainy White", price = "25000"} Wheels["1078"] = {name = "Cool Wheel 3", price = "25000"} Wheels["1076"] = {name = "Cool Rays", price = "25000"} Wheels["1084"] = {name = "Golden Badass", price = "25000"} Wheels["1025"] = {name = "4x4", price = "25000"} for i,v in ipairs(Wheels) do local text = guiGetText( v.name ) local text2 = guiGetText( v.price ) local row = guiGridListAddRow ( RadioGrid ) local count = i guiGridListSetItemText ( RadioGrid, row, StationIDColumn, tostring(count), false, false ) guiGridListSetItemText ( RadioGrid, row, StationNameColumn, text, false, false ) guiGridListSetItemText ( RadioGrid, row, StationLinkColumn, text2, false, false ) end guiSetVisible(RadioWindow, false) addCommandHandler("gui", function () if guiGetVisible(RadioWindow) == true then guiSetVisible(RadioWindow, false) showCursor(false) else guiSetVisible(RadioWindow, true) showCursor(true) end end, false)
-
Yeah, worked, i did it some hours ago =D
-
The client side Just outputs correctly the name: function handleMapInfo(mapInfo) name = mapInfo.name or "Unknown" triggerServerEvent("RedoVoteInfo",getRootElement(),name) outputChatBox("Map: ".. name, 0,175,255,true) end addEventHandler("onClientMapStarting",getRootElement(), handleMapInfo) But, then, when it is set by voteredo, map name is unknow.. idk why: Server side: VotedTable = {} VotedTable2= {} function OnMapStart(mapName) RedoSet = nil VotedTable = {} VotedTable2 = {} if ClearNext then Restarted = nil ClearNext = nil end if not Restarted then outputChatBox("#00aaff[Vote#00cc55Redo]: #00aaffNow enabled!", getRootElement(), 255,255,255,true) else ClearNext = true outputChatBox("#00aaff[Vote#00cc55Redo]: #00aaffRedo Already done, #00cc55disabling votes!", getRootElement(), 255,255,255,true) end end function onMapStart2() if NextRedoSet then NextRedoSet = nil end if AlreadyDone then AlreadyDone = nil end end addEventHandler("onResourceStart", getRootElement(), onMapStart2) function onMapStart1(MapName) if AlreadyDone then return end AlreadyDone = true OnMapStart() RedoMap = MapName end addEvent("RedoVoteInfo",true) addEventHandler("RedoVoteInfo", getRootElement(), onMapStart1) function tablelength(t) local count = 0 for _ in pairs(t) do count = count + 1 end return count end function VoteRedo(player,cmd) if not VotedTable2[player] then VotedTable2[player] = player table.insert(VotedTable, player) local voteCount = tablelength(VotedTable) local PlayerCount = getPlayerCount() local NeededCountPre = PlayerCount / 100 local NeededCount = NeededCountPre * 60 outputChatBox("#00aaff[Vote#00cc55Redo]: #00aaff".. getPlayerNametagText(player).." Voted for Redo!, #00cc55Vote Count: #66ffaa[ ".. voteCount.." / "..NeededCount.." ]", getRootElement(), 255,255,255,true) if voteCount >= NeededCount then local mapName = RedoVotemapName if not NextRedoSet then NextRedoSet = true local redoMap = RedoMap AddMap2("apanel", redoMap, true) end end else outputChatBox("#00aaff[Vote#00cc55Redo]: #00aaffYou Already #66ffaaVoted!", player, 255,255,255,true) end end addCommandHandler("vr", VoteRedo, false,false) function RedoVoteMap(map) if RedoSet then return end if #mapQueue == 0 then outputChatBox("#00aaff[Panel]: Next Map set for Redo", getRootElement(), 255,255,255,true) else triggerEvent("onBoughtMap",getRootElement(),mapQueue[1]) outputChatBox("#00aaff[Panel]: Maps Queued for player after Redo", getRootElement(), 255,255,255,true) end RedoSet = true table.insert(mapQueue, 1, mapName) callClientFunction(getRootElement(),"updateMapQueueList",mapQueue) end -- Buy a next map function AddMap2(thePlayer,mapName,command) local account = getAccount("apanel") if not (isGuestAccount(account)) then local playerCash = tonumber(getAccountData(account,"cash")) if not (mapName == "") then if playerCash >= 0 then if command then mapName = getMapName(mapName) else mapName = tostring(mapName) end table.insert(mapQueue,1,mapName) local freeMaps = tonumber(getAccountData(account,"freeMaps")) if freeMaps ~= 0 then addStat(account,"freeMaps",-1) else setAccountData(account,"cash",playerCash - 0) end addStat(account,"buyedMaps",1) setTimer(resetMapTimer,900000,1,mapName) outputChatBox("#00aaff[Panel]: Map ".. mapName .." was set for redo!", getRootElement(), 255,255,255,true) callClientFunction(getRootElement(),"updateMapQueueList",mapQueue) else showServerMsg(thePlayer,"Add Queue","#FFFFFFYou don't have enough money to set a map!") end else showServerMsg(thePlayer,"Add Queue","#FFFFFFPlease select a map from the list first!") end end end Also, the 60% of players gives most times a decimal number, how can i round it up or down?
-
Hey guys, somehow my GTA resolution was changed (i didnt do it) and now it is out of the range my monitor can admit, so i can not nopen gta nor MTA since my monitor fails to display screen. Any idea how to reset it? Thanks HyPeX
-
I wanna call fake here, default race will tp you and make you play, it is by force, edited.
-
Bump, i did this work perfectly, with a single exception, i cant seem to be able to count the table, wich is driving me crazy as fk. Im blocked to vote again, it says you already voted, but #Table displays 0. wth is going on here? VotedTable = {} function OnMapStart(MapName) RedoVotemapName = MapName for v,i in ipairs(getElementsByType("player")) do VotedTable[v] = nil end local PlayerCount = getPlayerCount() local NeededCountPre = PlayerCount / 100 local NeededCount = NeededCountPre * 60 if ClearNext then Restarted = nil ClearNext = nil end if not Restarted then outputChatBox("#00aaff[Vote#00cc55Redo]: #00aaffNow enabled!", getRootElement(), 255,255,255,true) else ClearNext = true outputChatBox("#00aaff[Vote#00cc55Redo]: #00aaffRedo Already done, #00cc55disabling votes!", getRootElement(), 255,255,255,true) end end function onMapStart2() if AlreadyDone then AlreadyDone = nil end end addEventHandler("onResourceStart", getRootElement(), onMapStart2) function onMapStart1(MapName) if AlreadyDone then return end AlreadyDone = true OnMapStart(MapName) end addEvent("RedoVoteInfo",true) addEventHandler("RedoVoteInfo", getRootElement(), onMapStart1) function VoteRedo(player,cmd) if not VotedTable[player] then VotedTable[player] = player local voteCount = #VotedTable local PlayerCount = getPlayerCount() local NeededCountPre = PlayerCount / 100 local NeededCount = NeededCountPre * 60 outputChatBox("#00aaff[Vote#00cc55Redo]: #00aaff".. getPlayerNametagText(player).." Voted for Redo!, #00cc55Vote Count: #66ffaa[ ".. voteCount.." / "..NeededCount.." ]", getRootElement(), 255,255,255,true) if voteCount >= NeededCount then RedoVoteMap(RedoVotemapName) end else outputChatBox("#00aaff[Vote#00cc55Redo]: #00aaffYou Already #66ffaaVoted!", player, 255,255,255,true) end end addCommandHandler("vr", VoteRedo, false,false) function RedoVoteMap(mapName) mapName = tostring(mapName) if #mapQueue == 0 then outputChatBox("#00aaff[Panel]: Next Map set for Redo", getRootElement(), 255,255,255,true) else outputChatBox("#00aaff[Panel]: Maps Queued for player after Redo", getRootElement(), 255,255,255,true) end table.insert(mapQueue, 1, mapName) end
-
No errors, aparently it worked only from client side and sending a trigger to server side, now im facing the trouble of making the table work, it is not counting the votes. (You cant vote again) PS: your code doesnt do anything at all. VotedTable = {} function OnMapStart(MapName) RedoVotemapName = MapName voteCount = 0 for v,i in ipairs(getElementsByType("player")) do VotedTable[i] = nil end local PlayerCount = getPlayerCount() local NeededCountPre = PlayerCount / 100 local NeededCount = NeededCountPre * 60 if ClearNext then Restarted = nil ClearNext = nil end if not Restarted then outputChatBox("#00aaff[Vote#00cc55Redo]: #00aaffNow enabled!", getRootElement(), 255,255,255,true) else ClearNext = true outputChatBox("#00aaff[Vote#00cc55Redo]: #00aaffRedo Already done, #00cc55disabling votes!", getRootElement(), 255,255,255,true) end end addEvent("RedoVoteInfo",true) addEventHandler("RedoVoteInfo", getRootElement(), OnMapStart) function VoteRedo(player,cmd) if not VotedTable[player] then VotedTable[player] = player local voteCount = #VotedTable local PlayerCount = getPlayerCount() local NeededCountPre = PlayerCount / 100 local NeededCount = NeededCountPre * 60 outputChatBox("#00aaff[Vote#00cc55Redo]: #00aaff".. getPlayerNametagText(player).." Voted for Redo!, #00cc55Vote Count: #66ffaa[ ".. voteCount.." / "..NeededCount.." ]", getRootElement(), 255,255,255,true) if voteCount >= NeededCount then RedoVoteMap(RedoVotemapName) end else outputChatBox("#00aaff[Vote#00cc55Redo]: #00aaffYou Already #66ffaaVoted!", player, 255,255,255,true) end end addCommandHandler("vr", VoteRedo, false,false) function RedoVoteMap(mapName) mapName = tostring(mapName) if #mapQueue == 0 then outputChatBox("#00aaff[Panel]: Next Map set for Redo", getRootElement(), 255,255,255,true) else outputChatBox("#00aaff[Panel]: Maps Queued for player after Redo", getRootElement(), 255,255,255,true) end table.insert(mapQueue, 1, mapName) end
-
Hi guys, i know there's a model ID for replacing the DFF files of each wheel, but, whats the Model ID for replacing the wheel TXD? function loadWheels() txd = engineLoadTXD ( "data/files/J2_wheels.txd" ) engineImportTXD("data/files/J2_wheels.txd", ID) -- WTh here? dff = engineLoadDFF("data/files/wheel_gn1.dff", 1082 ) engineReplaceModel(dff, 1082) dff = engineLoadDFF("data/files/wheel_gn2.dff", 1085 ) engineReplaceModel(dff, 1085) dff = engineLoadDFF("data/files/wheel_gn3.dff", 1096 ) engineReplaceModel(dff, 1096) dff = engineLoadDFF("data/files/wheel_gn4.dff", 1097 ) engineReplaceModel(dff, 1097) dff = engineLoadDFF("data/files/wheel_gn5.dff", 1098 ) engineReplaceModel(dff, 1098) dff = engineLoadDFF("data/files/wheel_lr1.dff", 1077 ) engineReplaceModel(dff, 1077) dff = engineLoadDFF("data/files/wheel_lr2.dff", 1083 ) engineReplaceModel(dff, 1083) dff = engineLoadDFF("data/files/wheel_lr3.dff", 1078 ) engineReplaceModel(dff, 1078) dff = engineLoadDFF("data/files/wheel_lr4.dff", 1076 ) engineReplaceModel(dff, 1076) dff = engineLoadDFF("data/files/wheel_lr5.dff", 1084 ) engineReplaceModel(dff, 1084) dff = engineLoadDFF("data/files/wheel_or1.dff", 1025 ) engineReplaceModel(dff, 1025) dff = engineLoadDFF("data/files/wheel_sr1.dff", 1079 ) engineReplaceModel(dff, 1079) dff = engineLoadDFF("data/files/wheel_sr2.dff", 1075 ) engineReplaceModel(dff, 1075) dff = engineLoadDFF("data/files/wheel_sr3.dff", 1074 ) engineReplaceModel(dff, 1074) dff = engineLoadDFF("data/files/wheel_sr4.dff", 1081 ) engineReplaceModel(dff, 1081) dff = engineLoadDFF("data/files/wheel_sr5.dff", 1080 ) engineReplaceModel(dff, 1080) dff = engineLoadDFF("data/files/wheel_sr6.dff", 1073 ) engineReplaceModel(dff, 1073) end
