script question. about %player% & %buildingowner%

Forum Archive - from http://theuniversal.net
Locked
User avatar
flametard
Posts: 1245
Joined: Sun Apr 01, 2007 2:05 am
Location: Join NR! faction name: 'NR new recruits' password: 'Truth'
Contact:

script question. about %player% & %buildingowner%

Post by flametard »

Event( "buildingdestroyed", "35" )
{
*customsound %buildingowner% 14
*say %buildingowner%'s Pub has been destroyed by %player%!
*grantcash %player% 300
*grantitem %player% 3 gold
*grantkudos %player% 1
*customsound %player% 8
}
in the above script, the destroyer of the building is meant to reap a reward of gold and cash for destroying a building.

but to avoid cheating, is there any way for the script to detect if the building owner and player is the same person? if so, it does a different thing like *say %player% you destroyed your own pub! with no granting of gold or sheckles. is that possible?
User avatar
morbydvisns
Posts: 1889
Joined: Sun Jan 30, 2005 12:51 am

Post by morbydvisns »

There is a script command to refrence a specific playervar's, I'm not sure exact the syntax right now but I do remember it being placed in there.

Something like, setting a specific playervar to hold a player, when a building is killed, set killer's player var to a temp var, switch to use building owners var's then check that id playervar to the temp var to see if its the same or not.

Might dig thru one of my script request threads, I believe theres a couple there with 4 or 5 pages of different additions to the script from Mit as the post progresses.
Locked