07.02.2019, 16:03
Both are Variables.
Actually Array Variables, that are used in that case for string storing.
Here is a good Tutorial for you: https://sampforum.blast.hk/showthread.php?tid=654471
With strval you convert that string to an integer.
And format with %d tries to interpret the Variable like an Integer.
So if you pass an A it gets to 65, because ASCII Values are taken.
So in that case you should directly use strval(inputtext), to get the integer values (if that is your target).
I dont know why the first one is not working, you can check that easily out.
Just make:
Before the if.
Then you know, what the exact values are and why it is not working
Actually Array Variables, that are used in that case for string storing.
Here is a good Tutorial for you: https://sampforum.blast.hk/showthread.php?tid=654471
With strval you convert that string to an integer.
And format with %d tries to interpret the Variable like an Integer.
So if you pass an A it gets to 65, because ASCII Values are taken.
So in that case you should directly use strval(inputtext), to get the integer values (if that is your target).
I dont know why the first one is not working, you can check that easily out.
Just make:
PHP код:
printf("%d == %d",num,strval(string));
Then you know, what the exact values are and why it is not working