SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 08/05/2014, 02:31 AM   #1
Rhymed32
Little Clucker
 
Join Date: Apr 2012
Posts: 47
Reputation: 19
Question better to replace?

better to replace:
PHP Code:
for(new 0MAX_PLAYERSi++) 
Rhymed32 is offline   Reply With Quote
Old 08/05/2014, 02:33 AM   #2
Calgon
Banned
 
Join Date: Jan 2009
Posts: 6,136
Reputation: 1127
Default Re: better to replace?

Is your question: are there better alternatives to running a for loop to cycle through players? Yes.

foreach is a good replacement for this, providing you fully read the post so you can grasp a full understanding of how it works.
Calgon is offline   Reply With Quote
Old 08/05/2014, 02:45 AM   #3
SickAttack
High-roller
 
Join Date: Dec 2013
Posts: 4,769
Reputation: 754
Default Re: better to replace?

Foreach is better.
SickAttack is offline   Reply With Quote
Old 08/05/2014, 03:13 AM   #4
Rhymed32
Little Clucker
 
Join Date: Apr 2012
Posts: 47
Reputation: 19
Default Re: better to replace?

that is:
PHP Code:
foreach(new Player
?
Rhymed32 is offline   Reply With Quote
Old 08/05/2014, 03:16 AM   #5
Calgon
Banned
 
Join Date: Jan 2009
Posts: 6,136
Reputation: 1127
Default Re: better to replace?

Quote:
Originally Posted by Rhymed32 View Post
that is:
PHP Code:
foreach(new Player
?
Read the post and you will understand it.
Calgon is offline   Reply With Quote
Reply

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
Bot which replace ID 0 Blackazur Scripting Help 0 14/07/2013 08:15 PM
A way to replace a whole name oliverrud Scripting Help 4 12/12/2011 02:40 PM
How to replace a word Sascha Help Archive 4 16/08/2010 06:50 PM
text replace martynas Help Archive 4 10/07/2010 02:14 PM
Replace '_' with ' ' Antonio [G-RP] Help Archive 1 16/06/2010 06:21 AM


All times are GMT. The time now is 10:29 AM.


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