22.02.2015, 18:19
So I tested with printf.
It printed all,if i write wrong it will be nothing.
Print(i wrote wrong that random code):
What's wrong?
It printed all,if i write wrong it will be nothing.
Код:
#include a_samp new PlayerKickTimer[MAX_PLAYERS]; new PlayerString[MAX_PLAYERS]; public OnPlayerConnect(playerid) { PlayerKickTimer[playerid] = SetTimerEx("KickEx", 300*60, false, "i", playerid); randomString(PlayerString[playerid], 10); new string[64]; format(string, sizeof string, "Type the following string: %s", PlayerString[playerid]); ShowPlayerDialog(playerid, 6973, DIALOG_STYLE_INPUT, "String", string, "ok", "ok"); return 1; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == 6973 && response) { printf("asd0"); if(strcmp(inputtext, PlayerString[playerid], true) != -1) { // correct printf("asd1"); } else Kick(playerid); printf("asd2"); } printf("asd3"); return 1; } stock randomString(strDest[], strLen = 10) { while(strLen--) strDest[strLen] = random(2) ? (random(26) + (random(2) ? 'a' : 'A')) : (random(10) + '0'); }
Код:
[20:51:32] asd0 [20:51:32] asd1 [20:51:32] asd2 [20:51:32] asd3