Thread: Insert()?
View Single Post
  #1  
Old 05-22-2007, 11:51 PM
killerogue killerogue is offline
Registered Omega
killerogue's Avatar
Join Date: Apr 2006
Location: United States
Posts: 1,920
killerogue is on a distinguished road
Send a message via AIM to killerogue Send a message via MSN to killerogue
Insert()?

A question, when using insert does it shift everything over one entry? Or does it simply replace the value you've inserted into.

As I was using it this function is supposed to first insert a new string into the 0 entry of the client.messages array then delete the last entry if the last entry is over five. Isn't adding any new messages after I reach the 5 limit nor deleting them.

Any ideas?

PHP Code:
function onCreated()
{
  
setshape(13232);
}

//#CLIENTSIDE
function onCreated()
{
  
setshape(13232);
}
public function 
addPlayerNotification(message) {
  echo(
temp.message);
  
  
this.client.messages.insert(0temp.message);
  
this.checkNotifications();
}

public function 
checkNotifications() {
  if (
this.client.messages.size() > 5)
  {
    
this.deleteNotification();
  }
}

public function 
deleteNotification() {
  
this.client.messages.delete(6);
}

public function 
updateNotifications() {

__________________


REMEMBER, IF YOU REP ME, LEAVE A NAME!

Quote:
Originally Posted by haunter View Post
Graal admins don't die. They go to hell and regroup.
Quote:
Originally Posted by Inverness View Post
Without scripters, your graphics and levels wouldn't do anything but sit there and look pretty.
Reply With Quote