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

Script problem


Akselj
 Share

Recommended Posts

Rofl hold on. let me fix that so I don't look like a dumb ass.
```
Sub OnPVPDeath(Attacker, Victim)

  Dim bounty
  Dim reward
  bounty = GetVar("bounty.ini","" & GetPlayerName(Attacker),"Bounty")
  reward = GetVar("bounty.ini","" & GetPlayerName(Victim),"Bounty")
  Call GiveCurreny(Attacker,4,reward)
  Call GlobalMsg("" & GetPlayerName(Victim) & " has been killed by " & GetPlayerName(Attacker),12)
  Call PutVar("bounty.ini","" & GetPlayerName(Victim), "Bounty", "0")

  '''''''''''''''''''''''''''''''''
  '''''''''''''''''''''''''''''''''
  Dim vlvl
  Dim newbounty
  vlvl=GetPlayerLevel(Victim)
  newbounty=GetVar("bounty.ini", "" & GetPlayerName(Attacker),"Bounty")

  If vlvl>1999 Then
      newbounty=newbounty+5000
  End If
  If vlvl>1499 Then
      newbounty=newbounty+5000
  End If
  If vlvl>999 Then
      newbounty=newbounty+5000
  End If
  If Vlvl>749 Then
      newbounty=newbounty+2500
  End If
  If vlvl>499 Then
      newbounty=newbounty+2500
  End If
  If vlvl>249 Then
      newbounty=newbounty+1500
  End If
  If vlvl>99 Then
      newbounty=newbounty+500
  End If
  If vlvl>49 Then
      newbounty=newbounty+500
  End If

  Call PutVar("bounty.ini", "" & GetPlayerName(Attacker),"Bounty", "" & newbounty)
  Call GlobalMsg("" & GetPlayerName(Attacker) & " has" & newbounty & " bounty.",12)

End Sub
```
and no to the "newbounty=bounty + 5000" because you said you wanted it to go through every if, so if it's going through every if, if a player is lvl 2000 then all of those additions will be put onto his bounty. Therefore, if you just keep a tally of what to add, and then finally add the whole thing at once at the end like I did. It's less confusing and less chance for error.
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...