Weol / wuma

A Garry's Mod server addon for managing usergroup- and user-specific restrictions, limits, and loadouts
Apache License 2.0
15 stars 7 forks source link

Console Command #60

Closed IbimsnicesYolo closed 2 years ago

IbimsnicesYolo commented 3 years ago

is there an Console Command to add/remove a weapon from a players loadout?

And i made a file to integrate Wuma to Sam like in ULX if you want you can have it :)

Weol commented 3 years ago

There is no console commands for WUMA unfortunatly, but it is easy to create one for adding and removing them by simply using the WUMA.AddUserLoadoutWeapon(caller, user, item, primary, secondary, respect, scope) function and the WUMA.RemoveUserLoadoutWeapon(caller, user, item).

The caller argument on both functions can be nil, it is never used. The scope argument can also be nil. The user argument can be a player entity or a stream id string. The item argument is simply the class of the weapon, for example "weapon_ar2". The primary and secondary arguments are the primary ammo and secondary ammo the player should spawn with. They can be set to -1 as well, this will make the player spawn with 4 times the magazine capacity, or 3 if the magazine capacity is 0. The respect argument is simpy a boolean that decides wheter the player will be able to spawn with the weapon even if it is restricted from them, it will not spawn restricted weapons when respect = true.

Weol commented 3 years ago

I would not mind a SAM integration, if you can make a pull request with the file included in the lua folder then we could start the process of integrating it :)

IbimsnicesYolo commented 3 years ago

im using Github the first time now, idk how i make a pull reqest... Can i Send it to you with Google Drive or sth else?

IbimsnicesYolo commented 3 years ago

Did it work? I tried it .....

Weol commented 3 years ago

It worked, you can see it at #61

Weol commented 3 years ago

Since you don't know how pull requests usually work I'll just copy the file you uploaded here and delete the pull request. I'll have a look at the code and probably change some things in somtime before Christmas, thanks alot :)

wuma.zip