[Release] Vote-to-Kick - Vote Players Out! [Fax-Vote2Kick] [1.0]

suggestions:

  • allow a whitelist of people who can’t be votekicked, so people who are staff members cannot be votekicked from the server.

  • add a permission to allow people who dont use fax-core to become an admin for the resource so they can cancel votes. (i.e i use vMenu so a permission like add_ace group.moderator “votekick.admin” allow for example)

1 Like

@mw.xvii The ifrst dot point I plan to add. The second already exists
http://faxes.zone/docs/aceperms.html#vote2kick

2 Likes

most scripts that have something todo with time have the same “bug” as yours.
Citizen.Wait(1000) does not wait in a scale of time but frames. that means, people with higher fps are able to vote in much shorter time than people with low fps.

the safest way to do anything with time is get timestamps and calculate the time passed between them per some amount of ticks. once the timestamp difference is greater than the timeout, the player can vote again. optimal would be per tick but for performance reasons a higher number should be fine aswell.

EDIT: yeah i also wanted to say that i like the resource and want to modify it for something i need. and only for that i checked the time code :smiley:

1 Like

this script would be a good thing for the prophunt server lol, there’s lots of cheaters and stuff already xd

Yeah. I know it goes by frames. Nice to see you around @Slluxx

That would be something to talk to @Mooshe about…

2 Likes

yeah i wasnt active for a long time. thanks for the warm welcome :slight_smile:

1 Like

That’s half-right.

The msec parameter is properly labeled, since delays check the delta of when the task was first scheduled. However since it’s ran in a tick callback, this delta is evaluated each tick, giving a bit of inaccuracy dependent on the client’s tick rate. This is why await Delay(0); will always yield next tick, even though DateTime.Now >= DateTime.Now (See InternalManager#L163-196).

There is no workaround for this since Tasks are ran on the same thread, so you would hold up the internal scheduler without allowing the next tick to execute if you don’t include await Delay(0). You’re stuck with this marginal inaccuracy.

I don’t have any control of the gametype contest server. If you notice a bug/exploit make sure to comment on the resource thread so I can address it

2 Likes

Do you happen to have a new link for this? Showing a 404 page when going there. Great script bud. Exactly what I was looking for.

not sure why but this throws an error for me, just a standalone server on one sync infinity.
players can only vote once, the vote value doesn’t reset
this is the error

[ c-scripting-core] InvokeNative: execution failed: Argument at index 0 was null.
[ script:kick] SCRIPT ERROR: Execution of native 00000000406b4b20 in script host failed: Argument at index 0 was null.
[ script:kick] > fn (@kick/server.lua:105)

reset “voted” was after line 105. so maybe thats why that always failed, i moved it above line 105 ( error ) and ill write back if it the “voted” resets