Page 1 of 1

script question. about %player% & %buildingowner%

Posted: Tue Dec 06, 2011 10:05 pm
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?

Posted: Wed Dec 07, 2011 12:52 pm
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.