Ulysses
General => Developers Corner => Topic started by: Reese on May 06, 2016, 04:00:10 PM
-
Hello, people sorry to ask for this. I know it happens a lot...
So that what brings me here : I'm trying to make a ulx votecleanup for props with game.CleanUpMap
so that what I did for now but I don't know how Ulx commands works so much so I was wondering : could you help me please ?
Thank you for everything,
Reese
-
As for most problems that involve code (any problem, really), it's very helpful to the people trying to help you if you tell us what you expected your code to do, and what it's doing instead. Also list any errors you're getting. The less effort we have to put in, the more likely you're to get a response from us.
-
Oh sorry vote that I want a Ulx command that if most of players agree with a vote the map cleans up. The only error I get isn't a real one but "attempt to call a nil value"(serverside) with no other information.
-
Reese, that is indeed a real error that would help you if you knew how to read it.
Can you copy paste the exact error for us?
It also includes line numbers and often function trace backs.
-
It is exactly all what is saying in the console no function no lines. Like I said no other informations but it's serverside
-
Garry's Mod will not give a lua error without a trace to the file (and possibly functions) that it originated from. Unless you have another addon that is hijacking error messages (I know DarkRP gives error messages for its files, but I'm not sure if it does/can block the default error messages) then you should have this information. Make sure you check the server console as well, not just your client's.
-
It's on a singleplayermod so clientside and serverside console but it is right that the addon DarkRP is creating errors on the singleplayer. I'm gonna try my code on sandbox and tell you more details.
By the way, thank you for helping me all of you
-
"-You started a cleanup vote for Reasons
-attempt to call a nil value"
Yep nothing changes
You have some kind of teamspeack ?
-
ulx.doVote will print "attempt to call a nil value" if the voting callback function is not defined. No stack trace because the callback is not called directly, but via ULib.pcallError (http://ulyssesmod.net/docs/files/lua/ulib/shared/util-lua.html#pcallError).
Simply declare your voting callback before your command callback to fix this. :)
-
Thank you gonna try this now
EDIT : works thanks ! could you help me to make a cooldown of this command ?
-
I thought ULX had a default command with a cooldown, but I can't for the life of me remember which one.
If nobody has answered your question by later today, I'll come back and either find that default ULX command or dig out an old command of mine with a cooldown.
-
I thought ULX had a default command with a cooldown, but I can't for the life of me remember which one.
Correct! The votemap command does have a cooldown feature. https://github.com/TeamUlysses/ulx/blob/0db8007ceb4a49e22c2bb191d1e16d423851f21e/lua/ulx/modules/votemap.lua
-
Thank you all I'm will close this thread thank you really
-
Timmy saves the day!
*applause*