November 19, 2019, 10:12:13 AM

Author Topic: WELCOME LVL  (Read 951 times)

Offline Numerouno => Fahuky

  • Level 7 Expert
  • *****
  • Posts: 202
  • <3 WCS :)
WELCOME LVL
« on: June 03, 2011, 09:11:00 PM »
How to give lvl Welcome automatically ?
thx
Numero-Uno

Offline IceeFun

  • Level 7 Expert
  • *****
  • Posts: 1358
  • Country: ge
  • Read more, be awesome.
Re: WELCOME LVL
« Reply #1 on: June 03, 2011, 09:57:30 PM »
FreeLevel on addons(WCS)

Offline Numerouno => Fahuky

  • Level 7 Expert
  • *****
  • Posts: 202
  • <3 WCS :)
Re: WELCOME LVL
« Reply #2 on: June 03, 2011, 10:36:33 PM »
Code: [Select]
from es import exists
from wcs.wcs import CfgManager, getPlayer, strings, tell

cfg = CfgManager('freelevels')
levels = int(cfg.cvar('wcs_freelevels', 25, 'Amount of levels the players gain when they have 0 in totallevel.'))

cfg.write()

def load():
cfg.execute()

def player_activate(ev):
userid = ev['userid']
if exists('userid', userid):
player = getPlayer(userid)
if not player.player.totallevel:
player.giveLevel(levels)
tell(userid, 'freelevels: gained', {'levels':levels})

and ? where ?  Change 25 ??

Offline IceeFun

  • Level 7 Expert
  • *****
  • Posts: 1358
  • Country: ge
  • Read more, be awesome.
Re: WELCOME LVL
« Reply #3 on: June 03, 2011, 10:41:08 PM »
on one folder of wcs search freelevel.ini or cfg

Offline PeZ

  • Level 0 Beginner
  • Posts: 16
Re: WELCOME LVL
« Reply #4 on: June 06, 2011, 10:18:26 PM »
FYI editing the ini file didnt do jack shit for me, i had to modify the .py file.

So yes, if you change that 25 to 50, people will get 50 levels their first time.

Also dont forget to add es_load freelevels in your addons.cfg