I am trying to use a donation script to give the player a level in game. such as !setlevel Sypher 30. This is the code so far but it doesnt give the 30 levels. Any help would be great ;).
keypart:
RunConsoleCommand("ulx", "setlevel", ply:SteamID(), "30" )
Full code:
MistPay:add({
Name = "Level 30", // name in the menu
Price = 0, // price in credits
DisabledFor = {}, // what ulx ranks can't SEE / BUY the package
Purchase = function( ply ) // what happens when they buy it
RunConsoleCommand("ulx", "setlevel", ply:SteamID(), "30" )
end,
//description to provide
Description = [[ Get level 30 on the server (Does not add 30 levels) ]], })
I think the problem lies in getting the players name. Is there a way to use there steam id to get there in game rp name?
Thanks again.
Instead of using runconsolecommand you should use the setlevel function that your levelling add-on comes with.
Not sure how to do that though. When I use the web console. If I type "ulx setlevel Sypher 30" It changes the level in game.
Isn't the RunConsoleCommand just basically doing the same thing?
Thanks again for the reply.
Which levelling system are you using?
I am using this leveling system(the GitHub version in the description):
[url]http://steamcommunity.com/sharedfiles/filedetails/?id=270216963&searchtext=Leveling+system[/url]
[code]
MistPay:add( {
Name = "Level 30", // name in the menu
Price = 0, // price in credits
DisabledFor = {}, // what ulx ranks can't SEE / BUY the package
Purchase = function( ply ) // what happens when they buy it
ply:setLevel( 30 )
end,
Description = "Get level 30 on the server (Does not add 30 levels)",
} )
[/code]
Not tested but should work.
[QUOTE=Moku;51551891][code]
MistPay:add( {
Name = "Level 30", // name in the menu
Price = 0, // price in credits
DisabledFor = {}, // what ulx ranks can't SEE / BUY the package
Purchase = function( ply ) // what happens when they buy it
ply:setLevel( 30 )
end,
Description = "Get level 30 on the server (Does not add 30 levels)",
} )
[/code]
Not tested but should work.[/QUOTE]
Yea that worked thanks a lot dude :)
Sorry, you need to Log In to post a reply to this thread.