23.08.2012, 06:34
В одном из модов на форуме я заметил код который меня заинтересовал. Кто знает, для чего он? Спасибо!
После инклудов:
в коллбэке OnDialogResponse:
После инклудов:
pawn Код:
forward ShowPlayerSafeDialog(playerid, dialogid, style, caption[], info[], button_1[], button_2[]);
public ShowPlayerSafeDialog(playerid, dialogid, style, caption[], info[], button_1[], button_2[])
{
new i = -1;
while(caption[++i]) if(caption[i] == 0x25) caption[i] -= 0x2;
i = -1;
while(info[++i]) if(info[i] == 0x25) info[i] -= 0x2;
i = -1;
while(button_1[++i]) if(button_1[i] == 0x25) button_1[i] -= 0x2;
i = -1;
while(button_2[++i]) if(button_2[i] == 0x25) button_2[i] -= 0x2;
return ShowPlayerDialog(playerid, dialogid, style, caption, info, button_1, button_2);
}
pawn Код:
new b = -1;
while(inputtext[++b])
{
switch(inputtext[b])
{
case 0x12..0xFF: continue;
default: return 0;
}
}