View Single Post
  #20  
Old 03-26-2006, 06:34 AM
Yen Yen is offline
Banned
Yen's Avatar
Join Date: Oct 2005
Location: Nova Scotia, Canada
Posts: 1,085
Yen is an unknown quantity at this point
Send a message via AIM to Yen Send a message via MSN to Yen
Quote:
Originally Posted by jake13jake
PHP Code:
Simplest Example:
function 
onWeaponFired() {
  
this.orangeboogaloo "hahahhaha";
  
player.chat makevar("this.orangeboogaloo");

>_> That's not a good use of makevar.
Let's say an NPC logs how many times a player enters a level.
When the player says '/showtimes,' it tells them how many times they've been in.

PHP Code:
function onPlayerEnters() {
  
makevar("this.timesentered_" player.account)++;
}

function 
onPlayerChats() {
  if (
player.chat == "/showtimes"player.chat makevar("this.timesentered_" player.account);

When a player enters the level, it adds 1 to 'this.timesentered_<their account>'
So when I enter, it increases this.timesentered_Yen by 1.
Reply With Quote