View Single Post
  #94  
Old 05-06-2011, 09:09 PM
Devil_Lord2 Devil_Lord2 is offline
David K?
Devil_Lord2's Avatar
Join Date: Apr 2011
Location: PA, MD.
Posts: 643
Devil_Lord2 can only hope to improve
Quote:
Originally Posted by cbk1994 View Post
That would be an event, not a statement. GS2 is event-based, so you do things after an event happens, unlike GS1 where you use if-statements for events, lol.
I don't know D: It was an example I got a while ago from Thor, I was going to make a movement system like he did but I didn't quite understand it. I asked and he said functions can give true and false and be used in statements..

PHP Code:
if(movement.isAttemptingMove()){
  
setani("walk");
  return;

Quote:
Originally Posted by cbk1994 View Post
Do you have the script? You must have been doing something else wrong.
I don't offhand but I think it was either on twinnys page or somewhere on the forum.. I think I can find it. I was having the problem with getting more playercount than there were on the actual server.. found something to overcome it, but it still listed RC's lol


-EDIT-
Nevermind, I'm still using it ^.^;


PHP Code:
function getPlayerCount(){
  
temp.count 0;
    for (
temp.plallplayers ){
      
temp.count += (! pl.isExternal );    
    }
 
this.count count;
 return 
this.count;

if I did this.chat = count; or temp.count inside the function it would give back the correct number.

if I did this.chat = count; or temp.count outside the function it would give back the 0 or null. "I mean inside the same statement / function it is being called in"

Eventually I kept it and settled for this. but now that I think about it, this. isn't really returning because it's global in the script clientside, isn't it? lmao


>.> Further clarification..
PHP Code:
function onWa****(){
  
getPlayerCount();
  for(
i=0;i<allplayers.size();i++){
    
triggeraction(x,y,"door",allplayers[i]);
    
sleep(.1);
  }
}
function 
getPlayerCount(){
  
temp.count 0;
    for (
temp.plallplayers ){
      
temp.count += (! pl.isExternal );    
    }
 
this.count count;
 return 
this.count;

__________________

Digital Media Artist - David K? </3 (UnLoved)
www.davidkrout.com
www.twitch.com/DavidKkz



Reply With Quote