SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 28/03/2009, 02:39 PM   #1
cyber_punk
Huge Clucker
 
Join Date: Feb 2008
Location: Det. Mi. USA.....
Posts: 435
Reputation: 10
Default Can I apply this to more than one player at once??

Code:
		for(new i, m = GetMaxPlayers(); i < m; i++)
			{
			if(IsPlayerInRangeOfPoint(i, 7, xa, ya, za) || IsPlayerInRangeOfPoint(i, 7, xb, yb, zb) || IsPlayerInRangeOfPoint(i, 7, xc, yc, zc) || IsPlayerInRangeOfPoint(i, 7, xd, yd, zd) || IsPlayerInRangeOfPoint(i, 7, xe, ye, ze)) 
				{
				ApplyAnimation(i, "blahblah", "blahblahblah", 4.0, 0, 0, 0, 0, 0);
				Tblah=SetTimerEx("blah", 1500, 0, "d", i);
				return 1;
				}
			}
Ok So this code works and it does what I want it to do but the problem is it only sets the animation to the first person it gets, I thought that loop should call anyone who is online and then check if they are in the RangeOfPoint then apply the animation. Is it due to the animation why only one player gets effected or is my loop not right. I thought about a timer to run over the loop again but I have read Alex ****** thread about timers and loops >.< so am I at a lose to this or.....

[Edit] Is it because I am return 1; after I apply the animation? Therefore stopping the Loop?!?!?!
__________________
cyber_punk is offline  
Old 11/05/2009, 05:00 PM   #2
matrix_smq
Little Clucker
 
Join Date: Feb 2009
Posts: 24
Reputation: 0
Default Re: Can I apply this to more than one player at once??

Quote:
[Edit] Is it because I am return 1; after I apply the animation? Therefore stopping the Loop?!?!?!
Yes.
A return stops the loop.
matrix_smq is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[HOW TO]Apply the downgrading patch Jellix Client Support 108 01/11/2019 02:21 AM
[Help] How can i apply an animation on my npc? evilinside Help Archive 7 01/11/2009 01:09 AM
Apply the new script without a restart Jakku Server Support 2 29/10/2009 08:00 PM
Animation wont apply JoeDaDude Help Archive 13 14/06/2009 08:11 PM
how the hell do u apply for jobs :x :?: :?: humblia General 1 04/02/2009 10:12 PM


All times are GMT. The time now is 04:40 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.