Archived copy of warcraft-source.com, the Warcraft: Source (WCS) forum (2007–2011), rebuilt from the Internet Archive by wc3mods.net. This page was captured on 2010-04-12 (original capture). Home · Forum · All archived topics · Downloads

Author Topic: 1 Time Buy On Items?  (Read 203 times)

Offline Duffas213

  • Level 0 Beginner
  • Posts: 6
1 Time Buy On Items?
« on: August 20, 2008, 11:21:29 PM »
I know this isn't that difficult, I'm just drawing a blank thinking about this. How would I make a certain item a 1 time buy, even if you reconnect to the server? Would I add a allow only line to the item?
« Last Edit: August 20, 2008, 11:24:05 PM by Duffas213 »

Offline Espeladden

  • Pwning ultra sexy beastly hot legend
  • Level 7 Expert
  • *****
  • Posts: 590
    • Undead Vengeance
Re: 1 Time Buy On Items?
« Reply #1 on: August 21, 2008, 04:53:21 PM »
You would need to use key values.
es_keygetvalue wcs_buyb WCSuserdata event_var(userid) buybefore
if (server_var(wcs_buyb) = 0) then racealias_letthembuy
if (server_var(wcs_buyb) = 1) then racealias_dontletthembuy

racealias_letthembuy" "es_keysetvalue WCSuserdata event_var(userid) buybefore 1

Offline Duffas213

  • Level 0 Beginner
  • Posts: 6
Re: 1 Time Buy On Items?
« Reply #2 on: August 21, 2008, 10:32:12 PM »
So would it look like this:

Code: (eventscripts) [Select]
  }
    "tomexp5000"
  {
  "name"        "Massive Tome! (+5000xp)"
  "description" "1 time buy that gives you 5000 XP"
  "category"    "6"
  "cost"        "16000"
  "level"       "0"
  "dab"         "1"
  "duration"    "0"
  "maxamount"   "1"
  "itemconfig"  "player_buy"
  "shopalias_letthembuy" "es_keysetvalue WCSuserdata event_var(userid) buybefore 1"
  "cmdbuy"      "es wcs_givexp event_var(userid) 5000 0 1"
  "cmdactivate" "0"
  }

Offline Polis

  • Level 5 Trained Intermediate
  • *****
  • Posts: 118
Re: 1 Time Buy On Items?
« Reply #3 on: August 22, 2008, 04:40:20 AM »
This won't work.  You would first need to set a permanent keygroup since I believe WCSuserdata is cleared on disconnect? Not sure.  You would then need to go into the actual shopmenu and start editing shit.  I'm not going to go into it but its possible.
« Last Edit: August 22, 2008, 04:42:35 AM by Polis »