The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Race selection script
Author Message
Rattlehead
Master
**

Posts: 290
Likes Given: 3
Likes Received: 8 in 6 posts
Joined: Jun 2012
Reputation: 8



Post: #7
RE: Race selection script
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]
DEFNAME=i_race_elf_moongate
NAME=Portail Elf
ID=i_moongate_blue
TYPE=t_normal

on=@step
if (strmatch (<src.tag0.race>,  Elven))
src.sysmessage @,,1 You are already an Elf!
return 1
else
src.tag.race Elven
events += e_race
return 0
endif

[events e_race]
on=@clienttooltip
src.addcliloc 1042971, Race: <src.tag0.elven> // this shows 'Race: Elven' in the tooltip when u hover if using A0s or above

on=@click
say @,,1 <name> [<tag0.race>] this wil display 'Elven' next to their name when single clicked for Below AoS
return 1

[itemdef i_race_elf_door]
id=06e9
Name= Elf door

on=@dclick
if (strmatch (<src.tag0.race>, Elven) // elf
src.go <p> // to pass across (need the right command)
else  
src.sysmessage = You are not the right class to use this door! blah blah
endif
return 1 // stop the door from opening at all, so no one else can enter

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
if (strmatch (<src.tag0.race>,  Elven))
src.sysmessage @,,1 You are already an Elf!
return 1
else
src.tag.race Elven
src.tag.name.suffix <src.tag0.race>
events += e_race
return 0
endif

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.

[Image: matts_siggy.gif]
09-16-2013 08:29 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
Race selection script - maos32 - 09-15-2013, 06:37 PM
RE: Race selection script - dagger4k - 09-15-2013, 07:52 PM
RE: Race selection script - maos32 - 09-15-2013, 09:24 PM
RE: Race selection script - Shidhun - 09-15-2013, 10:15 PM
RE: Race selection script - maos32 - 09-15-2013, 10:56 PM
RE: Race selection script - XuN - 09-15-2013, 11:17 PM
RE: Race selection script - Rattlehead - 09-16-2013 08:29 AM
RE: Race selection script - maos32 - 09-16-2013, 08:10 PM
RE: Race selection script - Shidhun - 09-16-2013, 09:59 PM
RE: Race selection script - maos32 - 09-17-2013, 07:35 PM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)