gema
Would you like to react to this message? Create an account in a few clicks or log in to continue.


A website for every gema-assaultcube fan
 
HomeHome  Latest imagesLatest images  SearchSearch  RegisterRegister  Log in  

 

 Question about several things

Go down 
4 posters
AuthorMessage
CriticalMachine




Messages : 29
Joined/Date d'inscription : 2011-04-15

Question about several things Empty
PostSubject: Question about several things   Question about several things EmptyFri 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
Back to top Go down
Park

Park


Messages : 272
Joined/Date d'inscription : 2011-11-04

Gema stats
farthest jump:

Question about several things Empty
PostSubject: Re: Question about several things   Question about several things EmptyFri 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, ?¿?
Back to top Go down
https://t.me/joinchat/APe7MT2YpmxobCH8tg7JJw
Baruch

Baruch


Messages : 105
Joined/Date d'inscription : 2012-08-04
Age : 32
Location/Localisation : France

Gema stats
farthest jump:

Question about several things Empty
PostSubject: Re: Question about several things   Question about several things EmptyFri 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.
Back to top Go down
Park

Park


Messages : 272
Joined/Date d'inscription : 2011-11-04

Gema stats
farthest jump:

Question about several things Empty
PostSubject: Re: Question about several things   Question about several things EmptyFri Aug 10, 2012 5:45 am

whoops
Back to top Go down
https://t.me/joinchat/APe7MT2YpmxobCH8tg7JJw
CriticalMachine




Messages : 29
Joined/Date d'inscription : 2011-04-15

Question about several things Empty
PostSubject: Re: Question about several things   Question about several things EmptyFri 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.
Back to top Go down
Baruch

Baruch


Messages : 105
Joined/Date d'inscription : 2012-08-04
Age : 32
Location/Localisation : France

Gema stats
farthest jump:

Question about several things Empty
PostSubject: Re: Question about several things   Question about several things EmptyFri 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).
Back to top Go down
CriticalMachine




Messages : 29
Joined/Date d'inscription : 2011-04-15

Question about several things Empty
PostSubject: Re: Question about several things   Question about several things EmptyFri Aug 10, 2012 4:35 pm

work fine it's more convenient.

thanks to you Smile

(merci à toi)
Back to top Go down
Sveark

Sveark


Messages : 124
Joined/Date d'inscription : 2011-05-02
Age : 30
Location/Localisation : Russia

Question about several things Empty
PostSubject: Re: Question about several things   Question about several things EmptySun 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.
Back to top Go down
http://sveark.info/ac
CriticalMachine




Messages : 29
Joined/Date d'inscription : 2011-04-15

Question about several things Empty
PostSubject: Re: Question about several things   Question about several things EmptySun 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 Smile


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.
Back to top Go down
CriticalMachine




Messages : 29
Joined/Date d'inscription : 2011-04-15

Question about several things Empty
PostSubject: Re: Question about several things   Question about several things EmptySat Aug 18, 2012 12:19 am

up
Back to top Go down
Baruch

Baruch


Messages : 105
Joined/Date d'inscription : 2012-08-04
Age : 32
Location/Localisation : France

Gema stats
farthest jump:

Question about several things Empty
PostSubject: Re: Question about several things   Question about several things EmptySat Aug 18, 2012 12:30 am

I think sveark mode does that (here). Maybe you can see how it works ?
Back to top Go down
CriticalMachine




Messages : 29
Joined/Date d'inscription : 2011-04-15

Question about several things Empty
PostSubject: Re: Question about several things   Question about several things EmptySat 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.
Back to top Go down
Park

Park


Messages : 272
Joined/Date d'inscription : 2011-11-04

Gema stats
farthest jump:

Question about several things Empty
PostSubject: Re: Question about several things   Question about several things EmptySun Aug 19, 2012 3:38 pm

Quote :
With this mode almost everything is possible.

>> And Illegal. :=
Back to top Go down
https://t.me/joinchat/APe7MT2YpmxobCH8tg7JJw
CriticalMachine




Messages : 29
Joined/Date d'inscription : 2011-04-15

Question about several things Empty
PostSubject: Re: Question about several things   Question about several things EmptyMon Aug 20, 2012 1:46 am

Everyone's choice, the gtop is not illegal.
Back to top Go down
CriticalMachine




Messages : 29
Joined/Date d'inscription : 2011-04-15

Question about several things Empty
PostSubject: Re: Question about several things   Question about several things EmptySat 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.
Back to top Go down
Baruch

Baruch


Messages : 105
Joined/Date d'inscription : 2012-08-04
Age : 32
Location/Localisation : France

Gema stats
farthest jump:

Question about several things Empty
PostSubject: Re: Question about several things   Question about several things EmptySat 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))
Back to top Go down
CriticalMachine




Messages : 29
Joined/Date d'inscription : 2011-04-15

Question about several things Empty
PostSubject: Re: Question about several things   Question about several things EmptyMon 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 Very Happy
Back to top Go down
Sponsored content





Question about several things Empty
PostSubject: Re: Question about several things   Question about several things Empty

Back to top Go down
 
Question about several things
Back to top 
Page 1 of 1
 Similar topics
-
» map question
» I have some question
» !kick and !ban question
» Script jg99 question.

Permissions in this forum:You cannot reply to topics in this forum
gema :: International :: Lua-
Jump to: