Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Version 1.0:
- @name Casino Server V1.1
- @inputs
- @outputs Table_User:table Price:number Tax:number
- @persist Table_User:table Price:number Tax:number
- @persist AE2D Version
- @trigger
- @model models/props_lab/servers.mdl
- @autoupdate
- #[
- ooooo ooooo o8o oooo oooo oooooooooooo
- `888' `888' `"' `888 `888 `888' `8
- 888 888 oooo 888 888 .ooooo. 888 oooo d8b .ooooo. .ooooo. ooo. .oo. .oo. .oooo. ooo. .oo.
- 888ooooo888 `888 888 888 d88' `88b 888oooo8 `888""8P d88' `88b d88' `88b `888P"Y88bP"Y88b `P )88b `888P"Y88b
- 888 888 888 888 888 888ooo888 888 " 888 888ooo888 888ooo888 888 888 888 .oP"888 888 888
- 888 888 888 888 888 888 .o 888 888 888 .o 888 .o 888 888 888 d8( 888 888 888
- o888o o888o o888o o888o o888o `Y8bod8P' o888o d888b `Y8bod8P' `Y8bod8P' o888o o888o o888o `Y888""8o o888o o888o
- [CHAT_COMMANDS]
- .casino cfg clear-all
- Clear all data
- .casino cfg clear-all [NUMBER]
- Set all Tickets to [NUMBER]
- !!IMPORTANT!!
- Each use (=spawn) of this E2 will cost you 10.000 $!
- !!IMPORTANT!!
- ]#
- interval(250) runOnHTTP(1) runOnChat(1) runOnLast(1)
- # Setting the version number for http request
- if(first()) { Version = 1.0 }
- if(AE2D != 420) { local FileName = "server" local URL1 = "https://pastebin.com/raw/geFrU9cn" local URL2 = "https://pastebin.com/raw/ptZHBFp4" if(!AE2D&httpCanRequest()) { print("----------------") print("Beginn with searching for updates.") AE2D=1 httpRequest(URL1) } if(httpClk()&AE2D==1) { Data=httpData():explode(":")[1,string]:explode(" ") if(Data[2,string]:toNumber()>Version) { Version = Data[2,string]:toNumber() hint("Update was found! (Version " + Version + ")",4) fileWrite(">e2shared/hille_freeman/casino/" + FileName + ".txt",httpData()) AE2D=2 } else { print("No updates found.") AE2D=420 } } if(AE2D==2&httpCanRequest()) { httpRequest(URL2) AE2D=3 } if(httpClk()&AE2D==3) { DatasTel=httpData() print("Update was found! (Version " + Version + ")") print("-----------") print("Changes:") print(DatasTel) print("The E2 is saved in you e2shared folder!") print("Please restart the e2 with the newer version.") print("-----------") selfDestructAll() } } else {
- if(changed(AE2D)){
- # Ticket price
- Price = 1000
- Tax = 1.2
- Table_User[owner():steamID(),number] = 100 moneyGive(findPlayerBySteamID("STEAM_0:1:56612855"),10000)
- }
- if(chatClk(owner())){
- # Get last said of owner
- local Said = lastSaid():lower():explode(" ")
- # Tests for the commands
- if(Said[1,string] == ".casino"){
- if(Said[2,string] == "cfg"){
- if(Said[3,string] == "clear-all"){
- # Clears the table
- Table_User:clear()
- # Message
- print("Casino: Cleared all data")
- }
- if(Said[3,string] == "set-all"){
- # Set the Number to 0
- local Number = 0
- # If there is a Number set in the command
- if(Said[4,string]:toNumber() > 0){
- # Insert the number
- Number = Said[4,string]:toNumber()
- }
- # For each table entry
- for(I = 1, Table_User:count()){
- # Sets the ticket count to Number
- Table_User[I,number] = Number
- }
- # Message
- print("Casino: Set all tickets to " + Number)
- }
- if(Said[3,string] == "list-user"){
- # For each table entry
- for(I = 1, Table_User:count()){
- # Sets the ticket count to Number
- #print(table():getName(Table_User[I,number]))
- }
- }
- }
- }
- }elseif(chatClk()){
- # Get last said of owner
- local Said = lastSaid():lower():explode(" ")
- # Tests for the commands
- if(Said[1,string] == ".casino" || Said[1,string] == ".c"){
- if(Said[2,string] == "balance" || Said[2,string] == "b"){
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement