Results 1 to 5 of 5

Thread: [RESOLVED] statements and operators

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2007
    Posts
    69

    Resolved [RESOLVED] statements and operators

    Code:
    nrep = User(index).Reputation / 3    
    
    If nrep > User(a).Reputation Then
    frmMain.wsk(index).SendData Chr$(lgrey) & "you cannot attack him, hes too high ranked." & vbCrLf & vbCrLf & Chr$(0)
    DoEvents
    Exit Sub
    End If
    this code works so low ranked players cant aim high ranked players, but now i need help doing vice verca...so high ranked cant aim low ranked.
    Last edited by troubleshoot; May 22nd, 2007 at 05:01 PM.

  2. #2
    PowerPoster
    Join Date
    May 2006
    Location
    Location, location!
    Posts
    2,673

    Re: statements and operators

    you tried changing the ">" to "<" ?
    Well, everyone else has been doing it :-)
    Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
    Expect more to come in future
    If I have helped you, RATE ME! :-)

    I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!

    And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Mar 2007
    Posts
    69

    Re: statements and operators

    ill try this
    Code:
    nrep = User(index).Reputation / 3    
    
    If nrep > User(a).Reputation Then
    frmMain.wsk(index).SendData Chr$(lgrey) & "you cannot attack him, hes too high ranked." & vbCrLf & vbCrLf & Chr$(0)
    elseif nrep = user(index).reputation * 3
    if nrep < user(a).reputation then
    frmMain.wsk(index).SendData Chr$(lgrey) & "you cannot attack him, hes ranked too low." & vbCrLf & vbCrLf & Chr$(0)
    DoEvents
    Exit Sub
    End If

  4. #4
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: statements and operators

    This is more structured.

    Code:
        nrep = user(Index).reputation / 3
        
        Select Case nrep
            Case Is > user(a).reputation
                frmMain.wsk(Index).SendData Chr$(lgrey) & "you cannot attack him, hes too high ranked." & vbCrLf & vbCrLf & Chr$(0)
        
            Case Is < user(a).reputation
                frmMain.wsk(Index).SendData Chr$(lgrey) & "you cannot attack him, hes ranked too low." & vbCrLf & vbCrLf & Chr$(0)
            Case Is = user(Index).reputation * 3
                'what to do here?
        End Select

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Mar 2007
    Posts
    69

    Re: [RESOLVED] statements and operators

    thank you, resolved

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width