Eclipse - Free 2D Mmorpg Maker
September 02, 2010, 10:22:48 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Shop Arcade chat Login Register  
 
 
   
 
collapse

* No Spam Or Websites

Refresh History
  • Ertzel: So... Anyone with basic/none/limited photoshop or even paint skills want to make some money converting sprites for me?
    Today at 10:07:35 PM
  • Gamma™: weaver why are you oflfine on H&H? :S
    Today at 10:04:26 PM
  • Ertzel: Ya, only one try per knife, my one try failed :(
    Today at 10:00:17 PM
  • LegendWeaver: is it one use?
    Today at 09:43:15 PM
  • Ertzel: Wish I didnt spend my 1k+ credits to buy the stupid knife that failed at stealing Robins credits >.<
    Today at 09:42:42 PM
  • Wraith: ) Kreator!
    Today at 09:06:52 PM
  • Wraith: yes! you were! (in red text
    Today at 09:06:46 PM
  • ToshiroHayate: Kreator!
    Today at 08:25:02 PM
  • Kreator: o_0 Was I supposed to Wraith?
    Today at 08:16:02 PM
  • [Pie] ICT: Don't worry.. I commented.
    Today at 07:55:08 PM
  • Wraith: Ay, kreator, wtf is up with you not posting anything about my new cliffs??
    Today at 07:50:36 PM

* Recent Topics

[EO] Attaching Problem. by 314piwm
[Today at 10:21:04 PM]


Project Vertigo [2d Tile-based Side-Scrolling Engine] by Miguu
[Today at 10:03:22 PM]


Zacaras Empire (Hiring) by Ertzel
[Today at 08:43:54 PM]


custom cliff tiles by ToshiroHayate
[Today at 08:29:15 PM]


.: RPG Kingdom :. by LegendWeaver
[Today at 08:25:20 PM]


What do you think? by [Pie] ICT
[Today at 07:54:54 PM]


[Show Off] Aztec Stuff by [Pie] ICT
[Today at 07:50:07 PM]


So I herd you liek mudkipz by Kreator
[Today at 07:36:52 PM]


Haven and Hearth: Epic Screenshot Thread by Tompwnage™
[Today at 07:14:21 PM]


The Lonliest Star [RP] by DDunit
[Today at 07:09:46 PM]


* Who's Online


Site Author : Topic: Script Submission: Credit System (difficulty: advanced 5/5)  (Read 4434 times)
0 Members and 1 Guest are viewing this topic.
June 23, 2006, 10:19:29 AM
The Uber-Scriptor
Advanced Member
****
User No : 375
Posts: 590
  • 0 credits
  • View Inventory
  • Send Money To Ilnair
  • Location : Netherlands, The
    The Uber-Scriptor
    • View Profile
    • WWW
    Ok, I created a script to allow people to buy a "generated key" (or whatever), on you site, and then they can credit it ingame by typing /credit <key>. When they do so, they gain an item, a member status, nothing, a guild, or whatever, thats up to you, I'm just giving you the script.

    Difficulty:
    New Scripters: 5/5
    Advanced scripters: 2/5
    Vets: 0/5
    Me: I wrote it, ofcourse I'm able to use it, smartass.

    Please note. If you want to be sure the script cannot be cracked, you will have to edit the script on the location marked with <CHANGE VALUE HERE BETWEEN 1111 and 9999>

    A key can only be used 1 time, the script saves all used keys to a .ini file. If an admin wants to, they can use /credit check <key> to check a key for validity, if it's valid it will also check if it has been previously used. If so, it will give the account details (ip/login name/charname/charnum) of the person that used it.

    Commands:
    /credit ...
    ... <key> credit a key
    ... check <key> (admin only), checks a key if it's valid
    ... generate (admin only), will generate a random key




    Insert the following functions at the bottom of you main.txt:


    Code: [Select]
    '************************************************
    'START CREDITS SYSTEM! Dinand Mentink - Ilnair
    '************************************************
    Function CheckCredit(index, code1, code2)
    On Error Resume Next
    CheckCredit = 0
    If CryptCode(index, code1) = code2 Then
    CheckCredit = 1
    Else
    CheckCredit = 0
    Exit Function
    End If

    If GetVar("credit.ini", "prevuse", code1 & "") = 0 Then
    CheckCredit = 1
    Else
    CheckCredit = 2
    End If
    End Function

    Function CryptCode(index, code1)
    Dim code1temp
    code1temp = code1
    code1temp = 1/(Log(code1temp)/10)
    code1temp = 1.6 * code1temp

    code1temp = code1temp / (<INSERT NUMBER BETWEEN 1111 and 9999>^0.5)

    code1temp = code1temp * 25
    code1temp = Log((code1temp^<INSERT NUMBER BETWEEN 1 and 1.5)+1)

    code1temp = (code1temp - 0.25) * 10
    code1temp = code1temp * 10000000000
    CryptCode = Int(code1temp)
    End Function

    '************************************************
    'END CREDITS SYSTEM! Dinand Mentink - Ilnair
    '************************************************



    Insert the following command:

    Code: [Select]
    If LCase(Mid(TextSay, 1, 7)) = "/credit" Then
    If Len(TextSay) > 8 Then
    If Mid(TextSay, 9, 5) = "check" Then
    If GetPlayerAccess(index) = 0 Then
    Call PlayerMsg(index, "You have to be a GM to use this command!", 12)
    Exit Sub
    End If
    TextSay = Mid(TextSay, 14)
    code1 = Int(LCase(Mid(TextSay, 1, 9)))
    code2 = Int(LCase(Mid(TextSay, 11, 13)))
    If CheckCredit(index, code1, code2) = 0 Then
    Call PlayerMsg(index, "Diamond Code: " & code1 & "-" & code2 & " is invalid!", 12)
    Exit Sub
    ElseIf CheckCredit(index, code1, code2) = 1 Then
    Call PlayerMsg(index, "Diamond Code: " & code1 & "-" & code2 & " is valid and has not been used before!", 10)
    Exit Sub
    Else
    Call PlayerMsg(index, "Diamond Code: " & code1 & "-" & code2 & " is valid, but has been used before!", 14)
    n = GetVar("credit.ini", "prevuseinfo", code1 & "")
    Call Playermsg(index, "Details: " & n, 15)
    Exit Sub
    End If

    Exit Sub
    End If

    TextSay = Mid(TextSay, 8)
    Select Case LCase(Trim(TextSay))
    Case "help"
    If GetPlayerAccess(index) > 0 Then
    Call PlayerMsg(index, "COMMAND REFERENCE for /credit:", 15)  
    Call PlayerMsg(index, "This command is used to credit diamond codes!", 15)
    Call PlayerMsg(index, "Commands:   <diamond code>: This will credit a diamond into your inventory!", 15)
    Call PlayerMsg(index, "                         check: Checks a code for details!", 15)
    Call PlayerMsg(index, "                         generate: Generates a random Diamond Code!", 15)
    Exit Sub
    Else
    Call PlayerMsg(index, "Help for /credit:", 15)  
    Call PlayerMsg(index, "This command is used to credit diamond codes!", 15)
    Call PlayerMsg(index, "Commands:   <diamond code>: This will credit a diamond into your inventory!", 15)
    Exit Sub
    End If

    Case "generate"
    If GetPlayerAccess(index) = 0 Then
    Call PlayerMsg(index, "You have to be a GM to use this command!", 12)
    Exit Sub
    End If


    code1 = Int((99999999 - 10000000 + 1)*Rnd) + 10000000
    code2 = CryptCode(index, code1)
    Call PlayerMsg(index, "Generated Diamond Code: " & code1 & "-" & code2, 15)
    n = 1

    Do While n < 11
    code1 = Int((99999999 - 10000000 + 1)*Rnd) + 10000000
    code2 = CryptCode(index, code1)
    Call PutVar("codes.ini", "Generated Codes", "Code" & n & " ", " " & code1 & "-" & code2)
    n = n + 1
    Loop
    Exit Sub
    End Select
    code1 = Int(LCase(Mid(TextSay, 1, 9)))
    code2 = Int(LCase(Mid(TextSay, 11, 13)))

    If code1 > 9999999 and code1 < 100000000 Then
    If CheckCredit(index, code1, code2) = 0 Then
    Call PlayerMsg(index, "The code you entered: " & code1 & "-" & code2 & " is invalid!", 12)
    Exit Sub
    ElseIf CheckCredit(index, code1, code2) = 1 Then
    Call PlayerMsg(index, "The code you entered: " & code1 & "-" & code2 & " is valid!", 10)
    '<INSERT WHAT YOU WANT TO HAPPEN HERE!>
    Call PutVar("credit.ini", "prevuseinfo", code1 & "", "Account: " & GetPlayerLogin(index) & " CharNum: " & GetPlayerCharNum(index) & " IP: " & GetPlayerIP(index) & " Character Name: " & GetPlayerName(index))
    Call PutVar("credit.ini", "prevuse", code1 & "", "1")
    Exit Sub
    Else
    Call PlayerMsg(index, "The code you entered: " & code1 & "-" & code2 & " is valid, but has been used before! Please contact a GM if you are sure you didn't already use this code!", 12)
    Exit Sub
    End If
    End If


    Call PlayerMsg(index, "This command does not exist. Please enter /credit help for all commands.", 12)
    Else
    'Dit gebeurt er als je niets invult achter het commando
    Call PlayerMsg(index, "You need to enter a subcommand. Please enter /credit help for all commands.", 12)
    End If
    Exit Sub
    End If

    Ok, a code will look something like this: 12345678-123456789123



    Please tell me if you get it to work!
    Logged

    Ilnair
    Uber-Scriptor

    Nishansu, beta testing. Have a look at http://www.nishansu.com
    June 23, 2006, 10:23:59 AM
    Active Member
    ***
    User No : 977
    Posts: 312
  • 0 credits
  • View Inventory
  • Send Money To Moderob
    • View Profile
    seems interesting, ill try it
    but how would they get a code from your site? wouldnt you need a script there to generate the code as well?
    Logged


    <--Click for custom sigs.
    June 23, 2006, 10:26:31 AM
    The Uber-Scriptor
    Advanced Member
    ****
    User No : 375
    Posts: 590
  • 0 credits
  • View Inventory
  • Send Money To Ilnair
  • Location : Netherlands, The
    The Uber-Scriptor
    • View Profile
    • WWW
    Yes you would, and my friend wrote the PHP part of the script, because I don't know squad about that ^^. Yes, you'll need a site to generate them, but can't help you with that part.
    Logged

    Ilnair
    Uber-Scriptor

    Nishansu, beta testing. Have a look at http://www.nishansu.com
    June 23, 2006, 10:28:41 AM
    Active Member
    ***
    User No : 977
    Posts: 312
  • 0 credits
  • View Inventory
  • Send Money To Moderob
    • View Profile
    lol I was just checking, ill try it when im not drawing lol
    Logged


    <--Click for custom sigs.
    July 22, 2006, 06:19:57 PM
    Eclipse Evolution Dev
    Active Member
    ***
    User No : 1115
    Posts: 414
  • 0 credits
  • View Inventory
  • Send Money To Heytherejake
  • Location : Why would I tell you?
    Currently working on C++ 3D
    • View Profile
    • WWW
    For some reason, I only get the first half of the code...
    So I get 123123-
    Not 123123-123123123
    Logged

    Quote from: The Pickle
    When Japanese try to make RPGs, somebody sets up us the bomb
    Currently Working On: Flogs and Trockets 3D
    July 23, 2006, 08:18:40 AM
    ♥ Cake ♥
    Global Moderator
    Advanced Eclipser
    *
    User No : 251
    Posts: 1735
  • 72 credits
  • View Inventory
  • Send Money To Tylian!
    • View Profile
    Nice Ilnair!

    BTW, Can you PM me the steps to make a code in english and ill try scripting the PHP part ^.^
    Logged

    Real men use Eclipse Origins v1.1.0 to create their games!
    July 23, 2006, 09:09:59 AM
    Member
    **
    User No : 1260
    Posts: 84
  • 0 credits
  • View Inventory
  • Send Money To jakeruston
  • Location : In my house, duh!
    • View Profile
    • WWW
    What do I put in the credit.ini file?
    Logged

    Darksoft Games Competition has started!
    Visit http://www.darksoft.co.uk/community/index.php?showtopic=135]Here to vote in the latest match which is:

    Fear V To The Death!

    Note to all entrants who haven't finished their games: Get it done as soon as possible please ;)
    July 24, 2006, 10:29:18 AM
    The Uber-Scriptor
    Advanced Member
    ****
    User No : 375
    Posts: 590
  • 0 credits
  • View Inventory
  • Send Money To Ilnair
  • Location : Netherlands, The
    The Uber-Scriptor
    • View Profile
    • WWW
    Just in the server folder.

    Btw, the php part is already done, but dunno how it works. I'll ask my friend who made it to post about it here.
    Logged

    Ilnair
    Uber-Scriptor

    Nishansu, beta testing. Have a look at http://www.nishansu.com
    July 24, 2006, 10:30:35 AM
    Member
    **
    User No : 1260
    Posts: 84
  • 0 credits
  • View Inventory
  • Send Money To jakeruston
  • Location : In my house, duh!
    • View Profile
    • WWW
    I meant what do you write in the ini file?
    Logged

    Darksoft Games Competition has started!
    Visit http://www.darksoft.co.uk/community/index.php?showtopic=135]Here to vote in the latest match which is:

    Fear V To The Death!

    Note to all entrants who haven't finished their games: Get it done as soon as possible please ;)
    July 24, 2006, 10:38:50 AM
    Member
    **
    User No : 1373
    Posts: 88
  • 0 credits
  • View Inventory
  • Send Money To CyberGenesis
    • View Profile
    Very nice. Now we have something to use when we want to limit access to the game(but who wants that?)
    Logged

    -I am a programmer. My school doesn't seem to understand this *mumbles obscenities about Game Design degrees*
    -there should be a spelling test/age requirement to use Eclipse.

    Current Project: Unknown Progress: Learning the in's and out's of Eclipse Goals: Making a competent script, getting my own sprite sheets to work  
    July 24, 2006, 10:51:36 AM
    Newb
    *
    User No : 1353
    Posts: 2
  • 0 credits
  • View Inventory
  • Send Money To Lach
  • Location : Canada
    • View Profile
    • WWW
    Wow good job man.
    Logged

    ------------------------------------------------------------------------

    Which FF Character Are You?
     Currently Working On: Valhallas Gate~~53%--We are currently Beta testing. Nadiar's Sees~~30% http://freewebs.com/valhallasgate ^^Owner~~  Im working for Nadiars Seed! Valhallasgate is still hiring, so just add me at macorocks@hotmail.com or visit Valhallas Gate forums .
    July 24, 2006, 12:37:01 PM
    The Uber-Scriptor
    Advanced Member
    ****
    User No : 375
    Posts: 590
  • 0 credits
  • View Inventory
  • Send Money To Ilnair
  • Location : Netherlands, The
    The Uber-Scriptor
    • View Profile
    • WWW
    Quote from: jakeruston
    I meant what do you write in the ini file?


    If I'm correctly, nothing.


    Quote
    Very nice. Now we have something to use when we want to limit access to the game(but who wants that?)

    But you could use it to give people some item if they donate for your server :p.
    Logged

    Ilnair
    Uber-Scriptor

    Nishansu, beta testing. Have a look at http://www.nishansu.com
    July 24, 2006, 10:54:38 PM
    Member
    **
    User No : 1373
    Posts: 88
  • 0 credits
  • View Inventory
  • Send Money To CyberGenesis
    • View Profile
    good point! now why didnt that idea hit me... ><
    Logged

    -I am a programmer. My school doesn't seem to understand this *mumbles obscenities about Game Design degrees*
    -there should be a spelling test/age requirement to use Eclipse.

    Current Project: Unknown Progress: Learning the in's and out's of Eclipse Goals: Making a competent script, getting my own sprite sheets to work  
    July 26, 2006, 04:09:48 PM
    Official Eclipse Nazi Admin
    Administrator
    Teh Uberleet
    *
    User No : 693
    Posts: 3518
  • 0 credits
  • View Inventory
  • Send Money To Niko
  • Location : In The Midst Of The Most Wicked Carnival's Circus Tent
    Fear me for I have the power of the BAN HAMMER!
    • View Profile
    nice man, very nice... hmmm... I feel a members section of my game suddenly popping up...wooot that php part would be nice tho.. lol
    Logged


    http://www.landsoforderia.com<---NEW WEBSITE!!!!!!!!
    July 27, 2006, 05:58:12 AM
    The Uber-Scriptor
    Advanced Member
    ****
    User No : 375
    Posts: 590
  • 0 credits
  • View Inventory
  • Send Money To Ilnair
  • Location : Netherlands, The
    The Uber-Scriptor
    • View Profile
    • WWW
    Can't help with that. Never did ANY php, so I got no clue how it's working, I can ask ralphje to post the script here though (already did, but will do again).
    Logged

    Ilnair
    Uber-Scriptor

    Nishansu, beta testing. Have a look at http://www.nishansu.com
    July 27, 2006, 06:13:01 AM
    Official Eclipse Nazi Admin
    Administrator
    Teh Uberleet
    *
    User No : 693
    Posts: 3518
  • 0 credits
  • View Inventory
  • Send Money To Niko
  • Location : In The Midst Of The Most Wicked Carnival's Circus Tent
    Fear me for I have the power of the BAN HAMMER!
    • View Profile
    thanks man, id realy like to use this I just need a way to give the people a code.
    Logged


    http://www.landsoforderia.com<---NEW WEBSITE!!!!!!!!
    July 29, 2006, 08:25:37 AM
    The Real Slim Shady
    Veteran
    Advanced Eclipser
    *
    User No : 270
    Posts: 1730
  • 8 credits
  • View Inventory
  • Send Money To [BS] Pickle
    • View Profile
    I just installed this on a friend's game and I have to say that it's really easy to set up and use, great job man :)

    Marsh, you should put this on the script page in the website.
    Logged

    gentlemen, you can't fight in here! This is the War Room!
    July 23, 2007, 04:10:31 AM
    Active Member
    ***
    User No : 303
    Posts: 181
  • 0 credits
  • View Inventory
  • Send Money To whiteknight
  • Location : Brazil - BR - São Paulo - SP
    • View Profile
    What are the chances of doing something like:
    The generated code:
    12345-12345678
    and if the user does like:
    12344-12345678
    what are the chances of that working?
    Logged

    WhiteKnight
    March 24, 2009, 09:35:06 AM
    G2D Darkside
    Active Member
    ***
    User No : 1205
    Posts: 363
  • 0 credits
  • View Inventory
  • Send Money To Sakis
  • Location : My Home
    • View Profile
    • WWW
    so let me get this straight...this script will make it so that if u have features in the game that u want the players to somewhat pay for or something like that they just get a random key that u generate and it will give it to them to obtain the item
    Logged

    [The Coming of the Slayers]


    ZAS Sig Shop
     


    Powered by MySQL Powered by PHP Powered by SMF 2.0 RC3 | SMF © 2006–2010, Simple Machines LLC
    SimplePortal 2.3.1 © 2008-2009, SimplePortal
    Valid XHTML 1.0! Valid CSS!
    Page created in 0.299 seconds with 31 queries.