PDA

View Full Version : Using strmid function


Typhome
27/04/2012, 02:31 PM
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?

SuperViper
27/04/2012, 02:34 PM
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

mysql_fetch_field_row(PlayerInfo[playerid][LicenseIssuer],"LicenseIssuer");

Typhome
27/04/2012, 02:52 PM
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

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.