SA-MP Forums Archive
mysql string help - 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: mysql string help (/showthread.php?tid=596577)



mysql string help - Lucas_HenryK - 19.12.2015

pawn Код:
new Save[2][80];

Save[0] = cache_get_field_content_int(0, "String1");
Save[1] = cache_get_field_content_int(0, "String2");
This will work? have some other better way to store string on a var?


Re: mysql string help - SickAttack - 19.12.2015

pawn Код:
new Save[2][80];
valstr(Save[0], cache_get_field_content_int(0, "String1"));
valstr(Save[1], cache_get_field_content_int(0, "String2"));



Re: mysql string help - vassilis - 20.12.2015

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
pawn Код:
new Save[2][80];
valstr(Save[0], cache_get_field_content_int(0, "String1"));
valstr(Save[1], cache_get_field_content_int(0, "String2"));
but cache_get_field_content_int is for integer how he could store value as a strng if it it is an integer? valstr is converting value to string ? Is it something like strval?


Re: mysql string help - NaS - 20.12.2015

Quote:
Originally Posted by vassilis
Посмотреть сообщение
but cache_get_field_content_int is for integer how he could store value as a strng if it it is an integer? valstr is converting value to string ? Is it something like strval?
It is the opposite of strval, it gets the integer from "cache_get_field_content_int(0, "String1")" and puts it into your array as a string.