Raised This Month: $32 Target: $400
 8% 

Solved arrays


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kww
Senior Member
Join Date: Feb 2021
Location: Russia
Old 01-21-2022 , 01:56   arrays
Reply With Quote #1

I can't understand how this code will behave:
PHP Code:
formatex(szDatacharsmax(szData), "a%i"id
If id == 5 then I will have szData equal to "a5", but if id >= 10 then szData should be, like, "a10".
But it will be:
Code:
 szData[0]=="a"
 szData[1]=="1"
 szData[2]=="0"
or:
Code:
 szData[0]=="a"
 szData[1]=="10"
Which of them? Thanks in advance
__________________
Now working on: Side Weapons (Very lazy, tbh)
Avatar source: https://bit.ly/3BAk19g
Discord: kww#9951

Last edited by kww; 01-21-2022 at 02:07.
kww is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 01-21-2022 , 01:59   Re: arrays
Reply With Quote #2

Code:
szData[0]=='a'
 szData[1]=='1'
 szData[2]=='0'
Formatex is used to reformat an array of string and its faster than format
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 01-21-2022 at 02:20.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
kww
Senior Member
Join Date: Feb 2021
Location: Russia
Old 01-21-2022 , 02:08   Re: arrays
Reply With Quote #3

Quote:
Originally Posted by Natsheh View Post
Code:
szData[0]=='a'
 szData[1]=='1'
 szData[2]=='0'
Formatex is used to reformat a array of string and its faster than format
Thank you for responce
__________________
Now working on: Side Weapons (Very lazy, tbh)
Avatar source: https://bit.ly/3BAk19g
Discord: kww#9951
kww is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-21-2022 , 22:04   Re: arrays
Reply With Quote #4

I think you need to read up on how strings work in Pawn so that you actually understand why it is what it is (this will help you in the future). For example, take a look at Part 2 here.
__________________

Last edited by fysiks; 01-21-2022 at 22:04.
fysiks is offline
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

Forum Jump


All times are GMT -4. The time now is 05:59.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode