Lua Question [message #463298] |
Thu, 01 March 2012 09:56 |
hego64
Messages: 19 Registered: April 2011 Location: Hegoville
Karma: 0
|
Recruit |
|
|
Hey, its hego64 here! I haven't been here in quite awhile, but I've made a lot of progress with my server.
Anywho, I want to know if its possible to change someone's character when they get to a certian number of kills. Like, if you reach 50 kills you change into Havoc. I know its probably possible, but I don't know how to go about doing this.
Thanks,
-Hego64
|
|
|
|
Re: Lua Question [message #463458 is a reply to message #463298] |
Fri, 02 March 2012 09:30 |
iRANian
Messages: 4308 Registered: April 2011
Karma: 0
|
General (4 Stars) |
|
|
It's better to store it in a HashTemplateClass (where the key is the player name), so the kills can be "saved" when the player leaves and restored when the player joins, you'll need to use the HashIterator class to remove all the values at level load or gameover in your HashTemplateClass.
But the FDS stores the kill count (in a similar way internally) in cPlayer::Kills so he'll just need to attach a script to all players and in ::Killed() check that variable for a number of 50 really.
Long time and well respected Renegade community member, programmer, modder and tester.
Scripts 4.0 private beta tester since May 2011.
My Renegade server plugins releases
|
|
|
|
Re: Lua Question [message #463507 is a reply to message #463460] |
Sat, 03 March 2012 01:09 |
|
sla.ro(master)
Messages: 610 Registered: September 2010 Location: Romania
Karma: 0
|
Colonel |
|
|
@iran and halo2pac: he talks about Lua, not C++......
you can just use Change_Character(obj, char) when you a player have 50 kills or whatever (use Get_Kills(playerID)). If your using TT, use LuaTT and there is a Kill hook. look on examples.
check here for functions
Creator of Mutant Co-Op
Developer of LuaTT
|
|
|
|
Re: Lua Question [message #463543 is a reply to message #463508] |
Sat, 03 March 2012 13:22 |
|
halo2pac
Messages: 659 Registered: December 2006 Location: Near Cleveland, Ohio
Karma: 0
|
Colonel |
|
|
Gen_Blacky wrote on Sat, 03 March 2012 03:23 |
sla.ro(master) wrote on Sat, 03 March 2012 01:09 | @iran and halo2pac: he talks about Lua, not C++......
you can just use Change_Character(obj, char) when you a player have 50 kills or whatever (use Get_Kills(playerID)). If your using TT, use LuaTT and there is a Kill hook. look on examples.
check here for functions
|
you can do everything they said with lua.
|
Rene-Buddy | Renegade X
Join the fight against Obsessive-Compulsive Posting Disorder. Cancel is ur friend.
*Renegade X Dev Team Member*
|
|
|