endrien Posted July 5, 2009 Author Share Posted July 5, 2009 I'm trying to make something for when a player starts a new character it says a little message and plays a sound. But I only want it to do it once? Link to comment Share on other sites More sharing options...
Admiral Refuge Posted July 5, 2009 Share Posted July 5, 2009 Would be a script.Question:Do you want it to happen exactly when you make a new character, or do you want it to happen when that new character logs into the game for the first time? Link to comment Share on other sites More sharing options...
dtdsora Posted July 5, 2009 Share Posted July 5, 2009 i think it should be on the "OnNewChar" section, putCall PlaySound (Index, ".") i'll test this out myself and see if it works*edit*ok, that works, but it plays the sound when the Msgbox after u press create pops up, try it on the "JoinGame" sub*edit2*ok, if u put it in the JoinGame sub, it plays a sound, but will cause some lag with the map appearingok, here is the code for it```' Executes when a player logs into the game.Sub JoinGame(Index) If GetPlayerAccess(Index) = 0 Then Call GlobalMsg(GetPlayerName(Index) & " has joined " & GameName & "!", GREY) Else Call GlobalMsg("Administrator " & GetPlayerName(Index) & " has joined " & GameName & "!", YELLOW) End If Call PlayerMsg(Index, "Welcome to " & GameName & "!", WHITE) If LenB(MOTD) <> 0 Then Call PlayerMsg(Index, "MOTD: " & MOTD, BRIGHTCYAN) End If Call SendWhosOnline(Index) Call PlaySound(Index, "key.wav")End Sub``` Link to comment Share on other sites More sharing options...
dtdsora Posted July 5, 2009 Share Posted July 5, 2009 @Admiral:> Would be a script.> Question:> Do you want it to happen exactly when you make a new character, or do you want it to happen when that new character logs into the game for the first time?as said in my post, when u use it when u make a new char, it only plays for u at the char select screen, and i don't know any way to make it work when u log in for the FIRST TIME ONLY, so i just used it on the JoinGame sub Link to comment Share on other sites More sharing options...
Admiral Refuge Posted July 5, 2009 Share Posted July 5, 2009 @dtdsora:> as said in my post, when u use it when u make a new char, it only plays for u at the char select screen, and i don't know any way to make it work when u log in for the FIRST TIME ONLY, so i just used it on the JoinGame subYea, I think he wants the message that gets displayed, and the sound that plays, to be when he logs in the first time with his character. It's very easy to only have it happen once too.Anyway, here's dtd's modified JoinGame sub, where it will only happen once per character:```' Executes when a player logs into the game.Sub JoinGame(Index) If GetPlayerAccess(Index) = 0 Then Call GlobalMsg(GetPlayerName(Index) & " has joined " & GameName & "!", GREY) Else Call GlobalMsg("Administrator " & GetPlayerName(Index) & " has joined " & GameName & "!", YELLOW) End If Call PlayerMsg(Index, "Welcome to " & GameName & "!", WHITE) If LenB(MOTD) <> 0 Then Call PlayerMsg(Index, "MOTD: " & MOTD, BRIGHTCYAN) End If Call SendWhosOnline(Index) If GetVar("PlayersBegin.ini", GetPlayerLogin(Index) & "", GetPlayerName(Index) & "") = "" Then Call PlaySound(Index, "key.wav") Call PlayerMsg(Index, "This is the msg that will be displayed", RED) Call PutVar("PlayersBegin.ini", GetPlayerLogin(Index) & "", GetPlayerName(Index) & "", "1") End IfEnd Sub``` Link to comment Share on other sites More sharing options...
dtdsora Posted July 5, 2009 Share Posted July 5, 2009 ahh, ok, good… but wait, the Playersbegin.ini file? I don't seem to see it... Link to comment Share on other sites More sharing options...
Admiral Refuge Posted July 5, 2009 Share Posted July 5, 2009 @dtdsora:> ahh, ok, good… but wait, the Playersbegin.ini file? I don't seem to see it...Hence the "PutVar"It will autogenerate it Link to comment Share on other sites More sharing options...
dtdsora Posted July 5, 2009 Share Posted July 5, 2009 ahhi didn't know thati'm no good at scripting :( Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now