| Question about several things | |
|
|
Author | Message |
---|
CriticalMachine
Messages : 29 Joined/Date d'inscription : 2011-04-15
| Subject: Question about several things Fri Aug 10, 2012 12:42 am | |
| Question: I want to know how we can disable Autoteam definitely, when a player is in the middle of a gema and thus forceteam, it's a bit annoying, I do not think all time to disable it. I tried to make a script but it does not work.
If someone could help me a bit that would suit a lot of people.
Thanks in advance.
Last edited by CriticalMachine on Sat Aug 18, 2012 1:22 pm; edited 1 time in total | |
|
| |
Park
Messages : 272 Joined/Date d'inscription : 2011-11-04
Gema stats farthest jump:
| Subject: Re: Question about several things Fri Aug 10, 2012 2:21 am | |
| Function lualoop() If not getautoteam() then Setautoteam(true) End End
Or you add it to many handlers. Onvote, mapchange, ?¿? | |
|
| |
Baruch
Messages : 105 Joined/Date d'inscription : 2012-08-04 Age : 32 Location/Localisation : France
Gema stats farthest jump:
| Subject: Re: Question about several things Fri Aug 10, 2012 5:40 am | |
| @Park : you did the opposite ^^ You can do that instead : - Code:
-
function onPlayerCallVote(cn, type, text, number) if (type == SA_AUTOTEAM) and (not getautoteam()) then voteend(VOTE_NO) elseif (type == SA_FORCETEAM) or (type == SA_SHUFFLETEAMS) then voteend(VOTE_NO) end end
If a player calls a vote to enable autoteam, then the vote will instantly fail. If a player calls a vote to force a player to the ennemy team, or to shuffle teams, the vote will fail too. You can still vote to disable autoteam. | |
|
| |
Park
Messages : 272 Joined/Date d'inscription : 2011-11-04
Gema stats farthest jump:
| Subject: Re: Question about several things Fri Aug 10, 2012 5:45 am | |
| | |
|
| |
CriticalMachine
Messages : 29 Joined/Date d'inscription : 2011-04-15
| Subject: Re: Question about several things Fri Aug 10, 2012 5:59 am | |
| Thank you for your answers, but that's not what I want. I want that Autoteam (forceteam) it is disable automatically when the server is open. The votes are not allowed because I have already configured the servercommandline.
Thanks anyway. | |
|
| |
Baruch
Messages : 105 Joined/Date d'inscription : 2012-08-04 Age : 32 Location/Localisation : France
Gema stats farthest jump:
| Subject: Re: Question about several things Fri Aug 10, 2012 6:22 am | |
| Ah ok, then I guess this will work : - Code:
-
function onPlayerConnect(cn) setautoteam(false) end
I didn't find anything better (doesn't work with onInit handler). | |
|
| |
CriticalMachine
Messages : 29 Joined/Date d'inscription : 2011-04-15
| Subject: Re: Question about several things Fri Aug 10, 2012 4:35 pm | |
| work fine it's more convenient. thanks to you (merci à toi) | |
|
| |
Sveark
Messages : 124 Joined/Date d'inscription : 2011-05-02 Age : 30 Location/Localisation : Russia
| Subject: Re: Question about several things Sun Aug 12, 2012 12:08 pm | |
| When empty, AC server sets autoteam to true roughly every 5 ms. So the correct solution would be to do setautoteam(false) in onPlayerConnect or onMapChange. | |
|
| |
CriticalMachine
Messages : 29 Joined/Date d'inscription : 2011-04-15
| Subject: Re: Question about several things Sun Aug 12, 2012 5:15 pm | |
| - Quote :
- When empty, AC server sets autoteam to true roughly every 5 ms. So the correct solution would be to do setautoteam(false) in onPlayerConnect or onMapChange.
Already do it , work fine There is also an essential thing that I board not, the "! Grank" or "! Gtop" I had on my hard drive, a mode which dates from about 9 months but he apparently been deleted, so I wanted to know if anyone could help me will be cool. Without ranking mode gema is not interesting. I started learning LUA but it is not easy at first. Thank you in advance. | |
|
| |
CriticalMachine
Messages : 29 Joined/Date d'inscription : 2011-04-15
| Subject: Re: Question about several things Sat Aug 18, 2012 12:19 am | |
| | |
|
| |
Baruch
Messages : 105 Joined/Date d'inscription : 2012-08-04 Age : 32 Location/Localisation : France
Gema stats farthest jump:
| Subject: Re: Question about several things Sat Aug 18, 2012 12:30 am | |
| I think sveark mode does that (here). Maybe you can see how it works ? | |
|
| |
CriticalMachine
Messages : 29 Joined/Date d'inscription : 2011-04-15
| Subject: Re: Question about several things Sat Aug 18, 2012 1:18 pm | |
| I have already been seen the site and it is here that I learned 2 or 3 things. But his does not explain how to include such functions. For example I suppose for gtop be included best_player etc ... Well I need to found on the net how to learn programming. Gtop exists sure and I had it on my old server, if only I had keep this config file i had need just to copy and paste, this would have been easier.
With this mode almost everything is possible. | |
|
| |
Park
Messages : 272 Joined/Date d'inscription : 2011-11-04
Gema stats farthest jump:
| Subject: Re: Question about several things Sun Aug 19, 2012 3:38 pm | |
| - Quote :
- With this mode almost everything is possible.
>> And Illegal. := | |
|
| |
CriticalMachine
Messages : 29 Joined/Date d'inscription : 2011-04-15
| Subject: Re: Question about several things Mon Aug 20, 2012 1:46 am | |
| Everyone's choice, the gtop is not illegal. | |
|
| |
CriticalMachine
Messages : 29 Joined/Date d'inscription : 2011-04-15
| Subject: Re: Question about several things Sat Aug 25, 2012 6:24 am | |
| How can i get ms ?
example = %02d:%02d:%02d", getname(cn), delta / 60, delta % 60 , delta % 6000)) ????
i don't know.
Someone can help me please. | |
|
| |
Baruch
Messages : 105 Joined/Date d'inscription : 2012-08-04 Age : 32 Location/Localisation : France
Gema stats farthest jump:
| Subject: Re: Question about several things Sat Aug 25, 2012 4:27 pm | |
| For example this one : - Code:
-
function onFlagAction(cn, action, flag) if config.gema_mode_is_turned_on and action == FA_SCORE then if start_times[cn] == nil then return end local delta = math.floor((getsvtick() - start_times[cn]) / 1000) // gets time in milliseconds, converts into seconds start_times[cn] = nil if delta == 0 then return end if fines[cn] ~= nil then delta = delta + fines[cn] fines[cn] = nil end say(string.format("\f1%s SCORED AFTER %02d:%02d", getname(cn), delta / 60, delta % 60)) // displays score add_record(getmapname(), getname(cn), delta) local best_player, best_delta = get_best_record(getmapname()) if best_delta == delta then say("\f2*** \f1\fbNEW BEST TIME RECORDED! \f2***") end end end
Use this instead (not tested) : - Code:
-
local delta = getsvtick() - start_times[cn] // maybe keep math.floor if it doesn't work, but it should be ok
- Code:
-
local modulo = delta % 60000 say(string.format("\f1%s SCORED AFTER %02d:%02d:%03d", getname(cn), delta / 60000, modulo / 1000, modulo % 1000))
This will display : minutes (2 or more digits) : seconds (2 digits) : milliseconds (3 digits) Edit : if you want 1/60th seconds instead of milliseconds, you can use this : - Code:
-
local modulo = delta % 60000 say(string.format("\f1%s SCORED AFTER %02d:%02d:%02d'", getname(cn), delta / 60000, modulo / 1000, modulo % 1000 * 3 / 50))
| |
|
| |
CriticalMachine
Messages : 29 Joined/Date d'inscription : 2011-04-15
| Subject: Re: Question about several things Mon Aug 27, 2012 9:17 am | |
| merci spiree , même si je l'ai déjà dit je préfère le mettre ici pour que sa fasse poli | |
|
| |
Sponsored content
| Subject: Re: Question about several things | |
| |
|
| |
| Question about several things | |
|