Jump to content

Would this script part from what I am working on work for an ammo limit?


vTemporalZEROv

Recommended Posts

I am trying to make an ammo limiting mod, this is a small part of it, would this work if I tried to compile it? Keep in mind I am asking about this setup, not the actual script itself, it is missing a name and everything obviously.

 

Event OnInit()
;--------------------------------------------------------------------------------
Player = Game.GetPlayer()
;--------------------------------------------------------------------------------
int MaxAmmo10mm = 120
;--------------------------------------------------------------------------------
int 10mmAmmoDrop = (Player.GetItemCount(Ammo10mm) - MaxAmmo10mm)
;--------------------------------------------------------------------------------
If (Player.GetItemCount(Ammo10mm) > MaxAmmo10mm)
Player.DropObject(Ammo10mm, 10mmAmmoDrop)
Debug.Tracer("Ammo limit for 10mm reached!")
EndIf
EndEvent
Edited by vTemporalZEROv
Link to comment
Share on other sites

Yes and no. Yes in that the code looks good, no in that it would only run once and the player could simply pick up the ammo again from the ground.

Hmmm how would I make it constantly run? I have a quest set up that checks if the player has more than 120 rounds as an entry point getitemcount, and haven't really touched it much, could I use that somehow? Or would it have to be via this script?

Link to comment
Share on other sites

You could use the quest to do it. You would want to use the StartTimer and OnTimer functions to create a looping system, then check in the OnTimer function to see if the player has too much ammo.

Are those script functions or something to do with the quest?

Link to comment
Share on other sites

 

 

You could use the quest to do it. You would want to use the StartTimer and OnTimer functions to create a looping system, then check in the OnTimer function to see if the player has too much ammo.

Are those script functions or something to do with the quest?
Those are script functions.
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...