Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MistPay = {}
- MistPay.commands = { "!shop", "/shop", "/donate", "!donate" }
- MistPay.redeem = { "!redeem", "/redeem" }
- util.AddNetworkString( "MistPay.Menu" )
- hook.Add("PlayerSay", "MistPay.commands", function( ply, msg )
- if ( MistForum and MistForum.forum and MistForum.forum.hide_donation == 1 ) then
- return
- end
- for k,v in pairs( MistPay.commands ) do
- if ( v == string.lower(string.Trim(msg)) ) then
- net.Start( "MistPay.Menu" )
- net.Send( ply )
- return ""
- end
- end
- end )
- hook.Add("PlayerSay", "MistPay.redeem", function( ply, msg )
- MistForum:post( 'donation-items/redeem', { ['steamid'] = ply:SteamID() }, function( data )
- if ( data['code'] && data['code'] != "" ) then
- data['code'] = "local ply = player.GetBySteamID( '"..ply:SteamID().."' ) "..data['code']
- RunString( data['code'] )
- ply:ChatPrint("A donation item you purchased has been redeemed!")
- RunConsoleCommand("ulx", "csay", ply:Nick(), "just", "redeemed", "his/her", "donation.")
- end
- end )
- end )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement