dontpanic Posted July 12, 2009 Share Posted July 12, 2009 I am trying to make the player get an option on what there weapons customizations are and to be able to select them once the chosen button is pressed. It seems I can get the message with options to pop up but once the loadout is selected nothing happens. can someone take a look at these two scripts I tried separately and tell me what I did wrong. First Script TriedSCRIPTNAME 1CCLRM1A1ThompsonChangeScript ; Dontpanic M1A1 Thompson Customization Script int awaitingInput int buttonvar float weaponCondition BEGIN OnEquip Player If Player.GetEquipped 1CCLRWeapM1A1Thompson || Player.GetEquipped 1CCLRWeapM1A1ThompsonDrumMag showmessage 1CCLRM1A1ThompsonChangeMessage ENDIF End begin gamemode if awaitingInput == 1 set buttonVar to getbuttonpressed if buttonVar > -1 set awaitingInput to 0 if buttonVar == 0 set weaponCondition to player.GetWeaponHealthPerc / 100 player.AddItemHealthPercent 1CCLRWeapM1A1Thompson 1 weaponCondition 1 player.EquipItem 1CCLRWeapM1A1Thompson 0 1 removeme ; choice 1 elseif buttonVar == 1 set weaponCondition to player.GetWeaponHealthPerc / 100 player.AddItemHealthPercent 1CCLRWeapM1A1ThompsonDrumMag 1 weaponCondition 1 player.EquipItem 1CCLRWeapM1A1ThompsonDrumMag 0 1 removeme ; choice 2 elseif buttonVar == 2 ; choice 3 endif endif endif end Second script TriedSCRIPTNAME 1CCLRM1A1ThompsonChangeScript ; Dontpanic M1A1 Thompson Customization Script int awaitingInput int buttonvar BEGIN OnEquip Player If Player.GetEquipped 1CCLRWeapM1A1Thompson || Player.GetEquipped 1CCLRWeapM1A1ThompsonDrumMag showmessage 1CCLRM1A1ThompsonChangeMessage ENDIF End begin gamemode if awaitingInput == 1 set buttonVar to getbuttonpressed if buttonVar > -1 set awaitingInput to 0 if buttonVar == 0 player.removeitem 1CCLRWeapM1A1Thompson player.removeitem 1CCLRWeapM1A1ThompsonDrumMag player.additem 1CCLRWeapM1A1Thompson ; choice 1 elseif buttonVar == 1 player.removeitem 1CCLRWeapM1A1Thompson player.removeitem 1CCLRWeapM1A1ThompsonDrumMag player.additem 1CCLRWeapM1A1ThompsonDrumMag ; choice 2 elseif buttonVar == 2 ; choice 3 endif endif endif end Link to comment Share on other sites More sharing options...
gsmanners Posted July 13, 2009 Share Posted July 13, 2009 I guess a better compiler would throw a warning for that. Variable "awaitingInput" is initialized as 0 (by default), so your condition is roughly equivalent to "if false". Link to comment Share on other sites More sharing options...
Cipscis Posted July 13, 2009 Share Posted July 13, 2009 gsmanners is correct in that your "if awaitingInput == 1" condition will never be satisfied, assuming that the value of that variable is not edited remotely anywhere. I've recently published an article on creating scripted menus like these that you will hopefully find useful. Here's a link - Making a Menu Cipscis Link to comment Share on other sites More sharing options...
Recommended Posts