SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 14/07/2019, 06:58 PM   #1
MichaelScott
Little Clucker
 
Join Date: Apr 2019
Posts: 7
Reputation: 0
Default Help with arrays/strings and comparing them.

Hello, for the last few days i was working on my gamemode, and i was new to MySql. Today, after 5 hours of doing this, my head doesn't work anymore and I just can't figure out, how can I compare the inputtext from dialog to a string I have saved in my database. I tried a few things, and it just doesnt work, any help is appreciated. here is the part of the script.
Code:
if(inputtext == pInfo[playerid][Name])
Basically, Name is a string, and inputtext is an array with symbols. How can i make it compare with each other, because now it just asks me to index inputtext. Thank you, any help is appreciated
MichaelScott is offline   Reply With Quote
Old 14/07/2019, 07:01 PM   #2
Calisthenics
Gangsta
 
Join Date: May 2018
Posts: 755
Reputation: 147
Default Re: Help with arrays/strings and comparing them.

A string is an array.

https://wiki.sa-mp.com/wiki/Strcmp
Calisthenics is offline   Reply With Quote
Old 14/07/2019, 10:27 PM   #3
Kitten
High-roller
 
Join Date: Jul 2010
Location: United States
Posts: 2,179
Reputation: 339
Default Re: Help with arrays/strings and comparing them.

You can also use this tutorial;

https://forum.sa-mp.com/showthread.php?t=199796
__________________
Download DayZ Gamemode CLICK HERE TO VISIT PGA

-- P.S Left SA:MP; it's pretty dead and it's way different than it used to be. Good luck y'all!
Kitten 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
Comparing two strings addys1 Scripting Help 2 20/05/2017 01:48 AM
Comparing two strings. nerovani Scripting Help 6 24/03/2016 12:05 PM
Comparing 2 strings Aa12 Scripting Help 8 08/01/2016 06:20 PM
comparing strings HondaCBR Scripting Help 2 02/01/2012 03:15 PM
Help with comparing two strings OUL Scripting Help 2 02/11/2011 06:11 PM


All times are GMT. The time now is 05:36 AM.


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