27.11.2013, 09:15
(
Last edited by bigtigerbeee; 28/11/2013 at 11:52 AM.
)
Delete Thx a lot
case DIALOG_RP_NAME_CHANGE: { new charCounts[5]; if(strlen(inputtext) > 20) { SendClientMessage(playerid, COLOR_GREY, "ЄЧиНўН§¤ШіµйН§БХ¤ЗТБВТЗµиУЎЗиТ 20 µСЗНСЎЙГ"); invalidNameChange(playerid); return 1; } format(szPlayerName, MAX_PLAYER_NAME, "%s", inputtext); for(new n; n < MAX_PLAYER_NAME; n++) { switch(szPlayerName[n]) { case '[', ']', '.', '$', '(', ')', '@', '=': charCounts[1]++; case '_': charCounts[0]++; case '0' .. '9': charCounts[2]++; case 'a' .. 'z': charCounts[3]++; case 'A' .. 'Z': charCounts[4]++; } } if(charCounts[0] == 0 || charCounts[0] >= 3) { SendClientMessage(playerid, COLOR_GREY, "ЄЧиНўН§¤ШідБи¶ЩЎµйН§ {FFFFFF}ЎГШіТгЄйа¤ГЧиН§ЛБТВ КС*»ГРЎТИ '_' аѕЧиНбВЎГРЛЗиТ§ЄЧиНбЕР№ТБКЎШЕ (µСЗНВиТ§ Dennis_Ritchie)"); invalidNameChange(playerid); } else if(charCounts[1] >= 1) { SendClientMessage(playerid, COLOR_GREY, "ЄЧиНўН§¤ШідБи¶ЩЎµйН§, »ГСͺ仴йЗВКС*ЕСЎЙімѕФаИЙ ЎГШіТгЄйЄЧиНбєє Roleplay (µСЗНВиТ§ James_Gosling)"); invalidNameChange(playerid); } else if(charCounts[2] >= 1) { SendClientMessage(playerid, COLOR_GREY, "ЄЧиНўН§¤ШідБи¶ЩЎµйН§, »ГСͺ仴йЗВµСЗаЕў ЎГШіТгЄйЄЧиНбєє Roleplay (µСЗНВиТ§ Alan_Cooper)"); invalidNameChange(playerid); } else if(charCounts[3] == strlen(szPlayerName) - 1) { SendClientMessage(playerid, COLOR_GREY, "ЄЧиНўН§¤ШідБи¶ЩЎµйН§, БХбµиНСЎЙГµСЗаЕзЎ ЎГіТгЄйЄЧиНбєє Roleplay (µСЗНВиТ§ James_Miller)"); invalidNameChange(playerid); } else if(charCounts[4] == strlen(szPlayerName) - 1) { SendClientMessage(playerid, COLOR_GREY, "ЄЧиНўН§¤ШідБи¶ЩЎµйН§, БХбµиНСЎЙГµСЗгЛ*и ЎГіТгЄйЄЧиНбєє Roleplay (µСЗНВиТ§ Michael_Scofield)"); invalidNameChange(playerid); } else { mysql_real_escape_string(inputtext, PlayerInfo[playerid][pNormalName]); SetPlayerName(playerid, PlayerInfo[playerid][pNormalName]); format(szQueryOutput, sizeof(szQueryOutput), "SELECT `playerName` FROM `playeraccounts` WHERE `playerName` = '%s'", PlayerInfo[playerid][pNormalName]); mysql_query(szQueryOutput, THREAD_CHECK_ACCOUNT_USERNAME, playerid); } }
pls I got a crash detect
Code:
[16:53:13] [debug] Server crashed while executing tolrp.amx [16:53:13] [debug] AMX backtrace: [16:53:13] [debug] #0 native SetPlayerName () [01ee5700] from sscanf.dll [16:53:13] [debug] #1 000b77cc in public OnDialogResponse (0x00000006, 0x00000037, 0x00000000, 0xffffffff, 0x00342380) from tolrp.amx [16:53:13] [debug] Native backtrace: |
// Add it under the includes:
#if !defined isnull
#define isnull(%1) \
((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))
#endif
if(!isnull(PlayerInfo[playerid][pNormalName])) SetPlayerName(playerid, PlayerInfo[playerid][pNormalName]);