SA-MP Forums Archive
Using strmid function - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Using strmid function (/showthread.php?tid=337690)



Using strmid function - Typhome - 27.04.2012

Hello,
I have problem with strmid function.
Like having that enum: LicenseIssuer[MAX_PLAYER_NAME]
And.. after using strmid then it show: Martin_Sulov.
After relogging, system will load user data using that:
mysql_fetch_field_row(Field,"LicenseIssuer"); PlayerInfo[playerid][LicenseIssuer] = strmid(PlayerInfo[playerid][LicenseIssuer], Field, 0, strlen(Field), 255);
Then first character will deleted (by strmid) and show: *wierd character*artin_Sulov or just: artin_Sulov.

How fix that annoying problem?


Re: Using strmid function - SuperViper - 27.04.2012

Instead of using a lot of mysql_fetch_field_row it's better to use mysql_fetch_row and sscanf.

If you're too lazy to switch, change the whole line to

pawn Код:
mysql_fetch_field_row(PlayerInfo[playerid][LicenseIssuer],"LicenseIssuer");



Re: Using strmid function - Typhome - 27.04.2012

Quote:
Originally Posted by SuperViper
Посмотреть сообщение
Instead of using a lot of mysql_fetch_field_row it's better to use mysql_fetch_row and sscanf.

If you're too lazy to switch, change the whole line to

pawn Код:
mysql_fetch_field_row(PlayerInfo[playerid][LicenseIssuer],"LicenseIssuer");
This code it helped to fix this annoying problem.

Thanks very much and i rep you for help.