achap89 Posted November 2, 2010 Author Share Posted November 2, 2010 Ok so I get the else statements but when all the if statements are followed it says type mismatch error.> Private Sub btnJail_Click()> If GetPlayerAccess(MyIndex) >= ADMIN_MAPPER Then> If LenB(txtPlayerName.Text) <> 0 Then> Call SetPlayerMap(txtPlayerName.Text, "50")> Else> Call AddText("Please enter a name.", BRIGHTRED)> End If> Else> Call AddText("You are not authorized to carry out that action.", BRIGHTRED)> End If> End Sub Link to comment Share on other sites More sharing options...
Admiral Refuge Posted November 2, 2010 Share Posted November 2, 2010 Are you trying to change the name of the map? If so, I don't think you'd use SetPlayerMap. Link to comment Share on other sites More sharing options...
achap89 Posted November 2, 2010 Author Share Posted November 2, 2010 no I am trying to warp the given player to a map. Link to comment Share on other sites More sharing options...
Ertzel Posted November 2, 2010 Share Posted November 2, 2010 @Psiworld:> Ok so I get the else statements but when all the if statements are followed it says type mismatch error.I think its because of the 0 in If LenB(txtPlayerName.Text) <> 0 Then…. try this```Private Sub btnJail_Click()If GetPlayerAccess(MyIndex) >= ADMIN_MAPPER Then If LenB(txtPlayerName.Text) <> vbnullstring Then Call SetPlayerMap(txtPlayerName.Text, "50") Else Call AddText("Please enter a name.", BRIGHTRED) End IfElse Call AddText("You are not authorized to carry out that action.", BRIGHTRED)End IfEnd Sub``` Link to comment Share on other sites More sharing options...
achap89 Posted November 2, 2010 Author Share Posted November 2, 2010 nope Link to comment Share on other sites More sharing options...
Ertzel Posted November 2, 2010 Share Posted November 2, 2010 Then its prob to do with this line```Call SetPlayerMap(txtPlayerName.Text, "50")```For SetPlayermap you need (index, "50"), so since its not the player who is typing it, yes u need to index of the player's name in txtPlayerName. But thats written as a String, not a long which Index needs to be.Try….```Private Sub btnJail_Click()Dim NameIndex As Long NameIndex = FindPlayer(txtPlayerName.text)If GetPlayerAccess(MyIndex) >= ADMIN_MAPPER Then If LenB(txtPlayerName.Text) <> vbnullstring Then Call SetPlayerMap(NameIndex, "50") Else Call AddText("Please enter a name.", BRIGHTRED) End IfElse Call AddText("You are not authorized to carry out that action.", BRIGHTRED)End IfEnd Sub``` Link to comment Share on other sites More sharing options...
achap89 Posted November 2, 2010 Author Share Posted November 2, 2010 still run time 13 type mismatch Link to comment Share on other sites More sharing options...
zidsal Posted November 2, 2010 Share Posted November 2, 2010 it may not be this certain error but the code will not ever work. Your trying to warp a person client side which is impossible otherwise I could open up a normal eclipse source (and add in buttons that let me warp e.t.c) and connect to someones game (and as you can Imagen although would be fun for me it wouldn't be for anyone else). You wont be able to set someones map client side period. Link to comment Share on other sites More sharing options...
westin444 Posted November 2, 2010 Share Posted November 2, 2010 your setmap arguments need to be numbers, not strings.```Private Sub btnJail_Click()Dim NameIndex As Long NameIndex = FindPlayer(txtPlayerName.text)If GetPlayerAccess(MyIndex) >= ADMIN_MAPPER Then If LenB(txtPlayerName.Text) <> vbnullstring Then Call SetPlayerMap(NameIndex, 50) Else Call AddText("Please enter a name.", BRIGHTRED) End IfElse Call AddText("You are not authorized to carry out that action.", BRIGHTRED)End IfEnd Sub``` 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