Need help with string functions
#1

PHP код:
new str[128] = "2.00000|55.33333|0|55|My Test";
new 
posX[10], posY[10], font[10], color[10], text[128];
/*Get first part(2.00000) to posX, second(55.33333) to posY, third(0) to font, fourth(55) to color and last(My Test) to text as a string */
Reply
#2

Sscanf is the way. Documentation here: https://sampforum.blast.hk/showthread.php?tid=602923

pawn Код:
new str[128] = "2.00000|55.33333|0|55|My Test";
new Float: posX, Float: posY, font, color, text[128];
sscanf(str, "p<|>ffiis[128]", posX, posY, font, color, text);
printf("\nposX: %f\nposY: %f\nfont: %i\ncolor: %i\ntext: \"%s\"", posX, posY, font, color, text);
Reply
#3

Thnks
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)