Guthen / guthlevelsystem

Garry's Mod Level System
Apache License 2.0
12 stars 0 forks source link

How can I add in my own addons a way to add xp on action? #11

Closed clementinise closed 2 years ago

clementinise commented 2 years ago

My english is bad sorry, will try to explain at best!

I have made an addon so people can buy fruits from other player stands, what function or hook could I use in my buy function so players will be given xp? I hope I'm understandable

Just saw https://github.com/Guthen/guthlevelsystem/blob/6f58618cee02d65b867c281920c61474912e5f83/lua/guthlevelsystem/sv_players.lua#L249 I guess this is it x)

Guthen commented 2 years ago

Hey @clementinise

You can add XPs serverside with PLAYER:gls_add_xp( num, is_silent=false ) so yeah, you guess it :)

clementinise commented 2 years ago

Hey @clementinise

You can add XPs serverside with PLAYER:gls_add_xp( num, is_silent=false ) so yeah, you guess it :)

Thats a quick answer! Yeah I should have watch at the code before making an issue ticket x)

Guthen commented 2 years ago

No worries, have fun :)