SA-MP Forums Archive
Dialog Help - Cut a string? - 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: Dialog Help - Cut a string? (/showthread.php?tid=304026)



Dialog Help - Cut a string? [Paying $5 - PayPal] - GamingTurf - 16.12.2011



1.) Is this possible?
2.) How could i optimize it for the following script (OnDialogResponse):

'Inputtext' is the DIALOG LIST. It results 'Zak (Earnt $200000 blablabla).

I'd like it to just recognize 'Zak'.

pawn Код:
new msg[100];
                format(msg,sizeof(msg),"Selected player: %s", inputtext);
                SendClientMessage(playerid, COLOR_WHITE, msg);
Thanks!


Re: Dialog Help - Cut a string? - vassilis - 16.12.2011

you mean string in dialog?
not sure use strcat


Re: Dialog Help - Cut a string? - GamingTurf - 16.12.2011

inputtext = The dialog row.

I'll have a look at strcat now.

EDIT: I don't think that cuts/finds out strings..


Re: Dialog Help - Cut a string? - wildcookie007 - 16.12.2011

erm.. leave only %s?


Re: Dialog Help - Cut a string? - MP2 - 16.12.2011

pawn Код:
new extracted[MAX_PLAYER_NAME];
strmid(extracted, inputtext, 0, strlen(playername));
Example:

pawn Код:
new pName[] = "Zak";
new inputtext[] = "Zak (earnt $69)";
new extracted[MAX_PLAYER_NAME];
strmid(extracted, inputtext, 0, strlen(pName));

// 'extracted' contains the name



Re: Dialog Help - Cut a string? - GamingTurf - 16.12.2011

Quote:
Originally Posted by MP2
Посмотреть сообщение
pawn Код:
new extracted[MAX_PLAYER_NAME];
strmid(extracted, inputtext, 0, strlen(playername));
Example:

pawn Код:
new pName[] = "Zak";
new inputtext[] = "Zak (earnt $69)";
new extracted[MAX_PLAYER_NAME];
strmid(extracted, inputtext, 0, strlen(pName));

// 'extracted' contains the name
If that's static, then that isn't good.

The dialog rows are from MySQL. So they will always be changing order.


Re: Dialog Help - Cut a string? - GamingTurf - 16.12.2011

bump......


Re: Dialog Help - Cut a string? - GamingTurf - 16.12.2011

Is anyone available to help?

I'm willing to pay $5 for a fix. By PayPal only.