Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Problem With Player Prompts (SOLVED)


Kimimaru
 Share

Recommended Posts

Hey! I'm creating a timed event right now, and I'm including a player prompt in it. I'm having trouble getting the player prompt to work, though. Can anyone help me out? Here's my code:

**Sub TimedEvent(Hours, Minutes, Seconds)**:

```
Sub TimedEvent(Hours, Minutes, Seconds)
If Hours = 12 Then
If Minutes = 0 Then
If Seconds = 0 Then

Call PlayerPrompt(Index, "Do you like this player prompt test?", 0)

End If
End If
End If
End Sub
```
**Sub PlayerPrompt(Index, Prompt, Value)**:

```
Sub PlayerPrompt(Index, Prompt, Value)
If Prompt = 6 Then
Select Case Value
Case 0
Call PlayerWarp(Index, 1, 6, 7)
Call PlayerMsg(Index, "You said you liked the test!", YELLOW)
Case 1
Call GlobalMsg("This is case 1?", CYAN)
End Select
Else
Select Case Value
Case 0
Call GlobalMsg("You didn't like the test.", RED)
Case 1
Call GlobalMsg("This is no case 1?", RED)
End Select
End If
End Sub
```
I'm doing something wrong here, but the **PlayerPrompt Sub** is pretty confusing. Any help would be greatly appreciated.
Link to comment
Share on other sites

Okay, thanks. How can I change my code to make it work with timed events, though? I also believe that I'm doing something wrong in the **PlayerPrompt** command, since it's not working if I try it anywhere else. I get a "type mismatch" error.
Link to comment
Share on other sites

> Sub TimedEvent(Hours, Minutes, Seconds)
> If Hours = 12 And Minutes = 0 And Seconds = 0 Then
> For I = 1 To MAX_PLAYERS
> Call Prompt(I, "Do you like this player prompt test?", 0)
> Next
> End If
> End Sub

> Sub PlayerPrompt(Index, Prompt, Value)
> If Prompt = 6 Then
> Select Case Value
> Case 0
> Call PlayerWarp(Index, 1, 6, 7)
> Call PlayerMsg(Index, "You said you liked the test!", YELLOW)
>
> Case 1
> Call GlobalMsg("This is case 1?", CYAN)
> End Select
> Else
> Select Case Value
> Case 0
> Call GlobalMsg("You didn't like the test.", RED)
>
> Case 1
> Call GlobalMsg("This is no case 1?", RED)
> End Select
> End If
> End Sub

> Public MAX_PLAYERS

> ' Executes when the server initially loads.
> Sub OnServerLoad()
> GameName = GetVar("Data.ini", "CONFIG", "GameName")
> MAX_MAPS = GetVar("Data.ini", "MAX", "MAX_MAPS")
> MAX_PLAYERS = GetVar("Data.ini", "MAX", "MAX_PLAYERS")
> MOTD = GetVar("MOTD.ini", "MOTD", "Msg")
> End Sub
>
> ' Executes when the scripts are reloaded.
> Sub OnScriptReload()
> GameName = GetVar("Data.ini", "CONFIG", "GameName")
> MAX_MAPS = GetVar("Data.ini", "MAX", "MAX_MAPS")
> MAX_PLAYERS = GetVar("Data.ini", "MAX", "MAX_PLAYERS")
> MOTD = GetVar("MOTD.ini", "MOTD", "Msg")
> End Sub

Regards,
  Godlord.
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...