SA-MP Forums Archive
String Variables - 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: String Variables (/showthread.php?tid=468976)



String Variables - MrMou6 - 11.10.2013

Hello, i get a vehicle name from MySQL database:
Код:
mysql_get_field("vName", vInfo[carid][vName]);
(carid is vehicle id)
And use it in:
Код:
 format(ma, sizeof(ma), "'%s' ID: %i\n---Antros maљinos nėra---",vInfo[mid1][vName], pInfo[playerid][m1id]);
And in game show me not real name "Infernus", but "i0Cs0".
Maybye someone know why?

P.S. Sorry for my bad english


Re: String Variables - -=Dar[K]Lord=- - 11.10.2013

pawn Код:
mysql_fetch_field_row(vInfo[carid][vName],"vName");
Try this ...


Re: String Variables - MrMou6 - 11.10.2013

Quote:
Originally Posted by -=Dar[K]Lord=-
Посмотреть сообщение
pawn Код:
mysql_fetch_field_row(vInfo[carid][vName],"vName");
Try this ...
Nothing...


Re: String Variables - -=Dar[K]Lord=- - 11.10.2013

well then it isnt saving the car name correctly... You have to get the car name when you store the car name in "vName" and then you have to set it to your variable


Re: String Variables - MrMou6 - 11.10.2013

Something like this:
Код:
 new result[128];
mysql_get_field("vName", result);
vInfo[carid][vName] = result;
?

Then i get this error:
Код:
error 006: must be assigned to an array



Re: String Variables - xVIP3Rx - 11.10.2013

Can you show where is the vInfo[carid][vName] ? Or add [128] after it..


Re: String Variables - MrMou6 - 11.10.2013

Yea, i Add [128] when i create vName, and now work. Thanks


Re: String Variables - DanishHaq - 11.10.2013

pawn Код:
mysql_fetch_field_row(result, "vName");
strmid(vInfo[carid][vName], result, 0, strlen(result));
Edit: If this doesn't work, show me the enumeration for vInfo.