Eclipse
January 05, 2009, 08:50:49 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Chat Help Rules Arcade Search Calendar Gallery Login Register  
 
 
 
Recent Topics +-
[$$] Paying Paypal - GFX artists [$$] by Kreator
Today at 08:50:15 PM

THE Cult by The Tribal
Today at 08:49:34 PM

The New Eclipse Raid on Runscape by ‪‫‬‭‮‪‫‬‭The Admiral
Today at 08:48:24 PM

SnowCap by Ninja-Tech
Today at 08:45:29 PM

Teh Cult by Simius Cruentus
Today at 08:44:15 PM

Disparity Recruiting by Peter
Today at 08:44:05 PM

Makai Realms by kira423
Today at 08:41:25 PM

My Game by Kreator
Today at 08:40:25 PM

Dreadlord Online v1.2 Beta - Need Moderators and Trustworthy Mappers! by Kreator
Today at 08:38:42 PM

Server Status by westin444
Today at 08:27:23 PM

Members Online +-
19 Guests, 19 Users
The Tribal,
The Troy,
‪‫‬‭‮‪‫‬‭The Admiral,
Kreator,
Baron,
The Roujo,
Ninja-Tech,
westin444,
kira423,
Peter,
Simius Cruentus,
RamBONE,
ʇıunpp ʎqɹıʞ࣭,
Juggernaut,
Marsh,
Cakkrah,
Kainan54,
Amperglyph,
Airscar
Pages: [1]
  Print  
Author Topic: Script Submission: Mail System (dificulty: 4/5)  (Read 1663 times)
0 Members and 1 Guest are viewing this topic.
Ilnair
The Uber-Scriptor
Advanced Member
****
Offline Offline

Posts: 592


The Uber-Scriptor


View Profile WWW Email
« on: June 23, 2006, 03:40:28 AM »

Another script submission from me, i'm not gonna do a complete tutorial this time, newby's won't be able to do this, kinda hard, and the advanced scripters over here won't need a tutorial.


Here it goes:

The Subs:
Code: [Select]
'************************************************
'Start Mail System! Dinand Mentink - Ilnair
'************************************************
Sub ReadMailBox(index)
Dim msg1
Dim msg2
Dim msg3
Dim msg4
Dim msg5

msg1 = GetVar("mailbox.ini", GetPlayerLogin(index) & GetPlayerCharNum(index), "mailbox1")
msg2 = GetVar("mailbox.ini", GetPlayerLogin(index) & GetPlayerCharNum(index), "mailbox2")
msg3 = GetVar("mailbox.ini", GetPlayerLogin(index) & GetPlayerCharNum(index), "mailbox3")
msg4 = GetVar("mailbox.ini", GetPlayerLogin(index) & GetPlayerCharNum(index), "mailbox4")
msg5 = GetVar("mailbox.ini", GetPlayerLogin(index) & GetPlayerCharNum(index), "mailbox5")

If msg1 = "No message" Then
Call PlayerMsg(index, "No messages!", 10)
Exit Sub
End If
Call PlayerMsg(index, "Message1: " & msg1, 10)
If msg2 = "No message" Then
Exit Sub
End If
Call PlayerMsg(index, "Message2: " & msg2, 10)
If msg3 = "No message" Then
Exit Sub
End If
Call PlayerMsg(index, "Message3: " & msg3, 10)
If msg4 = "No message" Then
Exit Sub
End If
Call PlayerMsg(index, "Message4: " & msg4, 10)
If msg5 = "No message" Then
Exit Sub
End If
Call PlayerMsg(index, "Message5: " & msg5, 10)
Call ClearMailBox(index)
End Sub

Sub ClearMailBox(index)
Dim postbox

postbox = 1

Do While postbox < 6
Call PutVar("mailbox.ini", GetPlayerLogin(index) & GetPlayerCharNum(index), "mailbox" & postbox, "No message")
postbox = postbox + 1
Loop

Call PlayerMsg(index, "Mailbox cleared!", 10)
Call PutVar("mailbox.ini", "playernames", GetPlayerName(index), GetPlayerLogin(index) & GetPlayerCharNum(index))
End Sub
'************************************************
'End Mail System! Dinand Mentink - Ilnair
'************************************************




Add the following stuff:
Inside Sub Onjoin:

Call PutVar("mailbox.ini", "playernames", GetPlayerName(index), GetPlayerLogin(index) & GetPlayerCharNum(index))
   If GetPlayerLevel(index) = 1 and GetPlayerExp(index) = 0 Then
      Call ClearMailBox(index)
   End If

Create the following scripted item:
   Case 15
      Call playerquerybox(index, "Who do you want to send a message?", 1)
      Exit Sub


Create the following query box cases:
Code: [Select]
Case 1
player = response
If GetVar("mailbox.ini", "playernames", player & "") = "" Then
Call PlayerMsg(index, "Invalid player", 12)
Exit Sub
Else
player = GetVar("mailbox.ini", "playernames", player & "")
Call PutVar("mailbox.ini", GetPlayerLogin(index) & GetPlayerCharNum(index), "player", player & "")
Call playerquerybox(index, "What message do you want to send?", 2)
End If
Exit Sub

Case 2
msg = 1
player = GetVar("mailbox.ini", GetPlayerLogin(index) & GetPlayerCharNum(index), "player")

msg1 = GetVar("mailbox.ini", player & "", "mailbox1")
msg2 = GetVar("mailbox.ini", player & "", "mailbox2")
msg3 = GetVar("mailbox.ini", player & "", "mailbox3")
msg4 = GetVar("mailbox.ini", player & "", "mailbox4")
msg5 = GetVar("mailbox.ini", player & "", "mailbox5")

If msg1 = "No message" Then
Call PutVar("mailbox.ini", player & "", "mailbox1", GetPlayerName(index) & ": " & response & "")
Call PlayerMsg(index, "Message Send!", 10)
Exit Sub
End If
If msg2 = "No message" Then
Call PutVar("mailbox.ini", player & "", "mailbox2", GetPlayerName(index) & ": " & response & "")
Call PlayerMsg(index, "Message Send!", 10)
Exit Sub
End If
If msg3 = "No message" Then
Call PutVar("mailbox.ini", player & "", "mailbox3", GetPlayerName(index) & ": " & response & "")
Call PlayerMsg(index, "Message Send!", 10)
Exit Sub
End If
If msg4 = "No message" Then
Call PutVar("mailbox.ini", player & "", "mailbox4", GetPlayerName(index) & ": " & response & "")
Call PlayerMsg(index, "Message Send!", 10)
Exit Sub
End If
If msg5 = "No message" Then
Call PutVar("mailbox.ini", player & "", "mailbox5", GetPlayerName(index) & ": " & response & "")
Call PlayerMsg(index, "Message Send!", 10)
Exit Sub
End If
Call PlayerMsg(index, "Targets Mailbox full!", 10)
Exit Sub



Ok, should be working now. Everyone will have an empty mail box when they first join, if you inplement this script when a few people already have an account, just delete them and have them join again ^^.

To read the message box, make a scripted tile with the following command:

Case X
   Call ReadMailBox(index)

to delete the messages (reset mail box), the following command:
Case X
  Call ClearMailBox(index)


and the following command will open a player prompt for the message (to send it):

Case X
   Call playerquerybox(index, "Who do you want to send a message?", 2)







Good luck
Daddy Gnome Draken
THE GNOME KING
Global Moderator
Advanced Member
*
Offline Offline

Posts: 947


Clay Gnome Productions


View Profile WWW Email
« Reply #1 on: June 23, 2006, 07:41:39 AM »

Sweet man thanks i was having problems with that other one :)
Ilnair
The Uber-Scriptor
Advanced Member
****
Offline Offline

Posts: 592


The Uber-Scriptor


View Profile WWW Email
« Reply #2 on: June 23, 2006, 09:39:13 AM »

Glad you like it ^^
shuri-kun
#1 HYPER ACTIVE NIJNA
Member
**
Offline Offline

Posts: 71

Mwhahaha the power of n00b


View Profile WWW Email
« Reply #3 on: June 25, 2007, 05:24:40 PM »

please make a tut  :'(
Sk8erace1
Member
**
Offline Offline

Posts: 67


View Profile WWW Email
« Reply #4 on: September 13, 2007, 10:18:36 PM »

Hey thanks I got it in my game and all but theres one problem. The script wont save the message that I input into the query box to the player or any player at all. and instead of deleting the players accounts cant I just reset them to lvl 1 with 0 xp? i did that with my acc and it worked, thought it would be alot of work but, I dont feel like deleting all of our players.

anyways any help to geting it to send the messages would be very helpfull thank you!

Edit: nevermind I solved it =) just had to remove the "Exit sub" in case 1 of the querybox sub
BTW nice script helps alot!

Quote
please make a tut  :'(
I would be happy to make a tut for you ^_^ just PM me if you want it
also he has a litlte tut already up there
Pages: [1]
  Print  
 
 

Powered by EzPortal
Powered by MySQL Powered by PHP Powered by SMF 2.0 Beta 4 | SMF © 2006–2008, Simple Machines LLC | Sitemap Valid XHTML 1.0! Valid CSS!
Page created in 0.315 seconds with 33 queries.