![]() |
Race selection script - Printable Version +- SphereCommunity (https://forum.spherecommunity.net) +-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d) +--- Forum: Script Requests (/Forum-Script-Requests) +--- Thread: Race selection script (/Thread-Race-selection-script) |
Race selection script - maos32 - 09-15-2013 06:37 PM Hello Im looking for a race selection script Is it possible to insert a permanent tag for spécific race ? Like tag.elf so only elf can enter in spécific door Thanks for your answer RE: Race selection script - dagger4k - 09-15-2013 07:52 PM yes, At the start, depending on how you set the races (stone, gump selection etc) just make it set a tag to .tag.elf for a button selection Code: onbutton = 2 Obviously you will want to add something in there to make it so someone can't be 2 races. A way around this could be to use the 1 tag to deal with the race system tag.race = 1 // 1 being elf, 2 being human, 3 being vampire etc Code: onbutton = 2 then for the door you can try something around the line of Code: [itemdef i_elf_door] You might also want to add something to the player event such as Code: [event e_player] ![]() you might even want to make the door teleport the player to the door so other people can't actually pass through it. RE: Race selection script - maos32 - 09-15-2013 09:24 PM Heyo , i need just 2 things : How to add Elf next to the player name? What is the right command to pass trough the door? no coordinate , just trow the player in the door to let him enter [ITEMDEF i_race_elf_moongate] DEFNAME=i_race_elf_moongate NAME=Portail Elf ID=i_moongate_blue TYPE=t_normal ON=@STEP SOUND=snd_spell_gate_travel SRC.GO 1336 1997 5 0 // the player will not be able to comback ( do you have a gump for yes / no) ? src.SET COLOR=008fd // grey boddy color src.set title=Elf (Is it possible to add Elf next to the name?) src.sysmessage: You become "xxx" src.tag.race.elf= 1 // the permanent tag return 1 CATEGORY=GM ITEMS SUBSECTION=race gate DESCRIPTION=Elf Race Gate [itemdef i_race_elf_door] id=06e9 Name= Elf door on=@dclick if (<src.tag.race>==1) // elf src.go <door position> // to pass across (need the right command) return 0 else src.sysmessage = You are not the right class to use this door! blah blah return 1 CATEGORY=GM ITEMS SUBSECTION=race door DESCRIPTION=Elf Race door Thanks mate RE: Race selection script - Shidhun - 09-15-2013 10:15 PM On my Server, we define Races/Classes by using Tags : Tag.Plot1=0100 <-- this could be the Human Race Tag.Plot1=0200 <-- this could be the Elven Race ... Tag.Plot2=0100 <-- this could be a warrior class Tag.Plot2=0200 <-- this could be a mages class ... and so on. Now how do we give the correct Tags to the players? Plain and simply by using "moongates" which attach them @step Example : Code: [TYPEDEF t_human_plot] Within other scripts you could check for the plot simply by using a type of this function : Code: [FUNCTION ishuman] For Race-Checking you could then just use : Code: if <src.ishuman> RE: Race selection script - maos32 - 09-15-2013 10:56 PM Thanks Shidhun for the tips but your answer dont solve my problem How to add Elf next to the player name? in my script (can't remember) What is the right command to pass trough the door? no coordinate , just trow the player in the door to let him enter Thanks RE: Race selection script - XuN - 09-15-2013 11:17 PM [EVENTS e_elfs]//give this event to every elf or just add the trigger to their generic event. ON=@AfterClick local.clickmsgtext=<local.clickmsgtext> [Elf] And for the Door, as you wrote... src.go '<door position>', you just have to change it to src.go <p> RE: Race selection script - Rattlehead - 09-16-2013 08:29 AM well, it depends on what client u are using, if its a 4.x. or above and u have AoS on in ur ini, you will need to use and empty cliloc (or u could use title like the guy above me was trying to use, i would recommend an empty cliloc over title tho) in the player event to display, becus u cant single click players when u use AoS or above. and as for the plot tags, seems kinda the long way around ur elbow, why not just tag then like so: tag.race=Elven this way it would be easy to set and display everywhere Code: [ITEMDEF i_race_elf_moongate] noticed u used 'return 0' after u check for race, this will cause the door to open, and then anyone can just walk thru it, i assume you dont want it to open, so i took the return 0 out and placed the return 1 after the IF statement to keep it shut always. as far as their paperdoll, if u want it to say Elven as well, u could use tag.name.suffix (or tag.name.prefix) and use the tag for it, ex. Code: on=@step and its always a good idea to give it an events when scripting race, so u have more control over your player functions, u can either have 1 events that checks the tag with an IF statement, or u can give each race its own events, the later prolly being easiest for a novice. RE: Race selection script - maos32 - 09-16-2013 08:10 PM Thanks alot that's what im looking for It's working fine with with somes tweaks Can you give me a way to prevent accidently choice? Like a gump or somthing else on=@step if strmatch(<src.tag0.race>,Hok'o'Dan)) src.sysmessage @,,1 You all ready blabla! return 1 else (<gump> do you realy want to be <race> yes / no) If yes src.tag.race Hok'o'Dan SOUND=snd_spell_gate_travel SRC.GO 1433 1699 1 SRC.COLOR 008fd src.sysmessage @,,1 Welcome bla bla return 0 Else return 1 endif Thanks! RE: Race selection script - Shidhun - 09-16-2013 09:59 PM A simple version would be this "racegate" You need to change the following things on the gate, to adjust it properly : Name --> The Name of the Race Color --> Body-Color of the race Morep --> The Coordinates to which the player should go Of course this is not a complex script. You could add a Gump-Menu for GMs, to easily change the Racegate and so on. This is a very (!) simple version. Code: [itemdef i_racegate] RE: Race selection script - maos32 - 09-17-2013 07:35 PM Thank alot it's verry what im looking for ! |