SA-MP Forums

SA-MP Forums (https://forum.sa-mp.com/index.php)
-   Scripting Help (https://forum.sa-mp.com/forumdisplay.php?f=12)
-   -   Help with arrays/strings and comparing them. (https://forum.sa-mp.com/showthread.php?t=667950)

MichaelScott 14/07/2019 05:58 PM

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 :D 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

Calisthenics 14/07/2019 06:01 PM

Re: Help with arrays/strings and comparing them.
 
A string is an array.

https://wiki.sa-mp.com/wiki/Strcmp

Kitten 14/07/2019 09:27 PM

Re: Help with arrays/strings and comparing them.
 
You can also use this tutorial;

https://forum.sa-mp.com/showthread.php?t=199796


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

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