percent symol crash server
#1

del pls
Reply
#2

String hax!

EDIT: They are trying to get the server to say something to you my trying to do something else in the format thingy. SA-MP should block that!
Reply
#3

maybe bag in /sms? and really fix it?
Reply
#4

What SA-MP version are you using? The placeholder was fixed a release back if I recall correctly.
Reply
#5

Quote:
Originally Posted by Calg00ne
Посмотреть сообщение
What SA-MP version are you using? The placeholder was fixed a release back if I recall correctly.
The latest version. 0.3c R2
Reply
#6

oh we find problem...
The problem was not in command, and dialog boxes. If press tab and click to player Send sms. In dialog write %skript - server crash
Reply
#7

Hmm.
How i can check all inputtext ?
Now i check:
[code]if(inputtext[0]=='%') inputtext[0]=' ';[code]
but it check only the beginning of the text.
Reply
#8

pawn Код:
for(new iCh; iCh < strlen(cmdtext); iCh++) {
    if(cmdtext[iCh] == '%')
        cmdtext[iCh] = ' ';
}
Place this at the top of OnPlayerCommandText.
Reply
#9

with this work incorrectly.

this full my code of dialog:

Код:
	if(dialogid==17)  //send sms dialog
	{
		if(response)
		{
			new string[128];
			new targetid=PhoneTargetID[playerid];
			if(!strlen(inputtext))
			{
				GetPlayerName(targetid, string, sizeof(string));
				format(string, sizeof(string), " Name: %s  (phone.: %d)\n\n\nWrite message:\n\n", string, PlayerInfo[targetid][pPnumber]);
				ShowPlayerDialog(playerid, 17, DIALOG_STYLE_INPUT, "Sending", string, "Send", "Cancel");
				return 1;
			}


	        if(inputtext[0]=='%') inputtext[0]=' ';
			{
                SendClientMessage(playerid,COLOR_ALLDEPT," error");
			}
		    format(string, sizeof(string), "/sms %d %s", PlayerInfo[targetid][pPnumber], inputtext);
			OnPlayerCommandText(playerid, string);
		}
		return 1;
	}
need check all inputtext
Reply
#10

No, you need to check more than just the FIRST cell.

To filter the placeholder (%) from dialogs too, add this code at the top of OnDialogResponse:

pawn Код:
for(new iCh; iCh < strlen(inputtext); iCh++) {
    if(inputtext[iCh] == '%')
        inputtext[iCh] = ' ';
}
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)