Forum

ASSIST, AMERICA'S ARMY COMMUNITY - RELIVE THE GLORY DAYS OF AMERICA'S ARMY 2.5

Author Topic: bug in weapons forcer aka PickASniper  (Read 1811 times)

0 Members and 1 Guest are viewing this topic.

Offline LEEFFM

bug in weapons forcer aka PickASniper
« on: Wednesday, November 12, 2014, 21:04:51 PM »
ok so my PickASniper mod is pretty much  crusades weapon forcer -{DG}-Crusade19 but with snipers :P I typed it out by hand because that a good way to learn what's really going on in the code to get the result.
so this mod works for the most part the problem ive been trying to solve is the first time I "say sniper [class]" it does not work but it works every time after that, I have it set so when you join the server you get ClassSniper and when your use the "say sniper [class]" the first time you still get ClassSniper I can change what weapon you get but I want it to work every time.

could someone look at the code and help me further understand what I can to fix the error? It appears to be a bug that crusade never fixed in his mod which makes it a little harder to understand what im trying to learn.

PickASniper.uc - http://pastebin.com/Hg8eeheq
MVHandler.uc - http://pastebin.com/04VUYppy
« Last Edit: Wednesday, November 12, 2014, 21:07:27 PM by LEEFFM »

Offline teddy_grizzly_bear

  • Used to be known as nobody
  • Administrator
  • Epic Poster
  • *
  • Posts: 5,500
  • what are you looking at?
    • View Profile
  • AA: teddy_grizzIy_bear
Re: bug in weapons forcer aka PickASniper
« Reply #1 on: Thursday, November 13, 2014, 01:46:36 AM »
If I were to guess (and bare in mind this is my 2nd time ever looking at UScript), I would guess it's in the 2nd part (04VUYppy), where in the if statement on line 41 you create a new field in Playerdata, but later on still refer to the -1st element in PlayerData, but you should in fact refer to the one you inserted. Now, I can't see any value assigned to z, so it might be 0 (which, I don't know), but in any case you would need to add nr=z; to the if statement in line 41 (i.e to line 46 for example).

But like I said, I don't know UScript, so I might be completely wrong (for example in python, -1st element in a list/array is the last element anyway).


"Mathematics may be defined as the subject in which we never know what we are talking about, nor whether what we are saying is true." Bertrand Russell

Offline LEEFFM

Re: bug in weapons forcer aka PickASniper
« Reply #2 on: Thursday, November 13, 2014, 02:52:29 AM »
OMG Teddy I love you lol I tried a bunch of crap none of it worked, but yes you were correct that worked, I was thinking maybe I had to do z = something but didn't think nr = z :P

Offline teddy_grizzly_bear

  • Used to be known as nobody
  • Administrator
  • Epic Poster
  • *
  • Posts: 5,500
  • what are you looking at?
    • View Profile
  • AA: teddy_grizzIy_bear
Re: bug in weapons forcer aka PickASniper
« Reply #3 on: Thursday, November 13, 2014, 03:18:56 AM »
OMG Teddy I love you lol I tried a bunch of crap none of it worked, but yes you were correct that worked, I was thinking maybe I had to do z = something but didn't think nr = z :P
You better love me long time ;)


"Mathematics may be defined as the subject in which we never know what we are talking about, nor whether what we are saying is true." Bertrand Russell

Offline [email protected]

Re: bug in weapons forcer aka PickASniper
« Reply #4 on: Thursday, November 13, 2014, 03:45:03 AM »
haha  teddy is a savant  he probably just took a glance at it and had ur answer from that .
----Tempus fugit mors venit----

Offline teddy_grizzly_bear

  • Used to be known as nobody
  • Administrator
  • Epic Poster
  • *
  • Posts: 5,500
  • what are you looking at?
    • View Profile
  • AA: teddy_grizzIy_bear
Re: bug in weapons forcer aka PickASniper
« Reply #5 on: Thursday, November 13, 2014, 04:47:40 AM »
haha  teddy is a savant  he probably just took a glance at it and had ur answer from that .
lol, far from it. In fact I looked at the wrong part at first ;)


"Mathematics may be defined as the subject in which we never know what we are talking about, nor whether what we are saying is true." Bertrand Russell

 

Download Assist

×

Download Game Client

Important: Battletracker no longer exists. However, old Battletracker accounts may still work. You can create a new 25Assist account here

Download Server Manager