SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 13/12/2017, 09:33 PM   #221
Gammix
High-roller
 
Gammix's Avatar
 
Join Date: Jan 2015
Location: Ottawa, Canada
Posts: 1,636
Reputation: 745
Default Re: Tips & Tricks

Quote:
Originally Posted by Logic_ View Post
Sorry for the bump, but shouldn't this
PHP Code:
for(new strlen(string); != EOSi--) 
be the most fastest string loop?
EOF is value 0 so you are stoping at index 1! Its 0 in c/c++.

Here, without the use of strlen:
PHP Code:
for (new istring[i] != EOFi++) {

__________________
Gammix is online now   Reply With Quote
Old 13/12/2017, 09:46 PM   #222
Logic_
High-roller
 
Logic_'s Avatar
 
Join Date: Jun 2015
Location: Next to Oblivion (Kalcor's place)
Posts: 1,273
Reputation: 220
Default Re: Tips & Tricks

Quote:
Originally Posted by Gammix View Post
EOF is value 0 so you are stoping at index 1! Its 0 in c/c++.

Here, without the use of strlen:
PHP Code:
for (new istring[i] != EOFi++) {

Yep right, I mis-typed my code
__________________

Providing SA-MP, G-MOD, Web hosting and Hosted tab listing for cheap @ www.prestigesteve.com.

<Out of SA-MP scene as of January 2018>
<I'm selling unique sa-mp scripts for those who want to buy them>
<Evolution Prison Roleplay releasing sooner this week>
<Two of my TDM scripts are leaked and running on other servers >
Logic_ is offline   Reply With Quote
Old 14/12/2017, 10:35 AM   #223
Misiur
High-roller
 
Misiur's Avatar
 
Join Date: Jul 2009
Location: Poland
Posts: 2,543
Reputation: 552
Default Re: Tips & Tricks

EOS is '\0', that is: 0. So, use the one you feel is right in the context.
Misiur 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
Needs Scripting Tips! KomplettMaster General 12 26/12/2012 05:04 PM
[Tutorial] [InfiniTuts - Tutorials for beginners] Tips and Tricks regarding 'logical thinking' - Making your own script Infinity Tutorials 6 30/04/2012 12:34 AM
Motor Tricks by D12 D12Mr Screenshots and Videos 6 24/05/2009 07:04 PM


All times are GMT. The time now is 03:12 PM.


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