Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help with one small thing.
#1
Ok, I wanted to know if theres a code for starting off with an item. Like you register, pick a special class, and you start off with a item already in your inventory. Also, I was planning to have something diffrent for every class, so each class has something diffrent. It would be nice if someone helped me with that. Smile

Thanks~
-Examines-
Reply
#2
Sure, find server side where it creates the character, and add a call giveitem(blah) line and you should be good to go.

I suggest you check the class first of course, so you can give the correct item for each class. ^_^
Reply
#3
Open the server, search for Sub JoinGame. Then add something like:
Code:
If GetPlayerClass(Index) = 1 then
  Call GiveItem()
elseif GetPlayerClass(Index) = 2 then
  Call GiveItem()
end if
You also need to write a number to a ini file so the player cant get the item each time he/she login.
Reply
#4
its addchar sub serverside I believe.
Reply
#5
Kuja Wrote:its addchar sub serverside I believe.
ohh yeah thats better than joingame Tongue
Reply
#6
William Wrote:
Kuja Wrote:its addchar sub serverside I believe.
ohh yeah thats better than joingame Tongue

Yeah, by alot. It sets everything in the sub and calls saveplayer i think. So before call saveplayer just do some simple ifs and call giveitem or w/e
Reply
#7
You could add a variable to the player that would check if it was his first login. If so, you could like set items, quests, etc.
Reply
#8
You don't need to add any extra variables. The AddChar Sub handles everything to do with what your character's stats for the first time he logs into the game.
Reply
#9
Sonire Wrote:You don't need to add any extra variables. The AddChar Sub handles everything to do with what your character's stats for the first time he logs into the game.

Exactly. It sets for an example the class #3 and saves it. Otherwise if its not in that sub (.class=blahblah) then I'm guessing it'll be saved as its default value which is 0 I think o.o and your character will start with class 0. Get it or am I confusing you?
Reply
#10
If you want to do it the hard way, the way i'd more than likely do it (i like to keep things all neat and tidy), you could also add an extra variable onto class and call it StartingItem, and in the addchar sub, call giveitem startingitem.. Big Grin But yeah, doing it this way will would require A LOT more work.. Which isnt really needed..
Reply
#11
Actually, it wouldn't be much more work, and would be the method to do it for an engine. That way, in the classes.ini you could change the starting item, the amount, etc.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)