Dialog Help - Cut a string?
#1



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!
Reply
#2

you mean string in dialog?
not sure use strcat
Reply
#3

inputtext = The dialog row.

I'll have a look at strcat now.

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

erm.. leave only %s?
Reply
#5

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
Reply
#6

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.
Reply
#7

bump......
Reply
#8

Is anyone available to help?

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


Forum Jump:


Users browsing this thread: 4 Guest(s)