if(dialogid == 16516) { if(response) { if(strlen(inputtext) >= 2 && strlen(inputtext) <= 64) { arrUpdates[iUpd][g_Update1] = strlen(inputtext); format(string, sizeof(string), "You have change Update 1 to %s.", inputtext); SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string); CreateDynamicUpdates(strlen(inputtext)); SaveDynamicUpdates(); } else return ShowPlayerDialog(playerid, 16513, DIALOG_STYLE_LIST, "Update 1:", "Input text\nClear Update", "Select", "Cancel"); } } |
CreateDynamicUpdates(iUpd) { new Filename[64], line[256]; format(Filename, sizeof(Filename), "Updates.ini"); new File:handle = fopen(Filename, io_write); format(line, sizeof(line), "Update 1=%s\r\n", arrUpdates[iUpd][g_Update1]); fwrite(handle, line); format(line, sizeof(line), "Update 2=%s\r\n", arrUpdates[iUpd][g_Update2]); fwrite(handle, line); format(line, sizeof(line), "Update 3=%s\r\n", arrUpdates[iUpd][g_Update3]); fwrite(handle, line); format(line, sizeof(line), "Update 4=%s\r\n", arrUpdates[iUpd][g_Update4]); fwrite(handle, line); format(line, sizeof(line), "Update 5=%s\r\n", arrUpdates[iUpd][g_Update5]); fwrite(handle, line); format(line, sizeof(line), "Update 6=%s\r\n", arrUpdates[iUpd][g_Update6]); fwrite(handle, line); format(line, sizeof(line), "Update 7=%s\r\n", arrUpdates[iUpd][g_Update7]); fwrite(handle, line); format(line, sizeof(line), "Update 8=%s\r\n", arrUpdates[iUpd][g_Update8]); fwrite(handle, line); format(line, sizeof(line), "Update 9=%s\r\n", arrUpdates[iUpd][g_Update9]); fwrite(handle, line); format(line, sizeof(line), "Update 10=%s\r\n", arrUpdates[iUpd][g_Update10]); fwrite(handle, line); format(line, sizeof(line), "Update 11=%s\r\n", arrUpdates[iUpd][g_Update11]); fwrite(handle, line); format(line, sizeof(line), "Update 12=%s\r\n", arrUpdates[iUpd][g_Update12]); fwrite(handle, line); fclose(handle); }
enum eUpdateSystem { g_Update1[64], g_Update2[64], g_Update3[64], g_Update4[64], g_Update5[64], g_Update6[64], g_Update7[64], g_Update8[64], g_Update9[64], g_Update10[64], g_Update11[64], g_Update12[64], g_Update13[64], g_Update14[64], g_Update15[64], }; |
///
if( response )
{
if(strlen(inputtext) >= 2 && strlen(inputtext) <= 64)
{
strmid(arrUpdates[iUpd][g_Update1], inputtext, 0, strlen(inputtext), sizeof arrUpdates);
//arrUpdates[iUpd][g_Update1] = strlen(inputtext);
format(string, sizeof(string), "You have change Update 1 to %s.", inputtext);
SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
CreateDynamicUpdates(strlen(inputtext));
SaveDynamicUpdates();
}
else return ShowPlayerDialog(playerid, 16513, DIALOG_STYLE_LIST, "Update 1:", "Input text\nClear Update", "Select", "Cancel");
}
CMD:updates(playerid, params[]) { new string[245], iUpd; format(string, sizeof(string), "(1) %s\n(2) %s\n(3) %s\n(4) %s\n(5) %s\n(6) %s\n( ![]() ShowPlayerDialog(playerid, 0, DIALOG_STYLE_LIST, "Updates", string, "Close", "Cancel"); return 1; } |
if(dialogid == 16512) { if(response) { if(strlen(inputtext) >= 2 && strlen(inputtext) <= 64) { strmid(arrUpdates[iUpd][g_Update1], inputtext, 0, strlen(inputtext), sizeof arrUpdates); //arrUpdates[iUpd][g_Update1] = strlen(inputtext); format(string, sizeof(string), "You have changed Update 1 to %s. (/updates)", inputtext); SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string); CreateDynamicUpdates(strlen(inputtext)); SaveDynamicUpdates(); } else return ShowPlayerDialog(playerid, 16512, DIALOG_STYLE_LIST, "Update 1:", "Input text\nClear Update", "Select", "Cancel"); } } |
if(dialogid == 16525) { if(response) { if(listitem == 0) { format(string, sizeof(string), "(Updates must remain under 64 characters)", arrUpdates[iUpd][g_Update1]); ShowPlayerDialog(playerid, 16512, DIALOG_STYLE_INPUT, "Edit Updates", string, "Select", "Cancel"); } if(listitem == 1) { arrUpdates[iUpd][g_Update1] = 0; SendClientMessage(playerid, COLOR_WHITE, "You have cleared Update 1 and it no longer exists."); SaveDynamicUpdates(); } } } |
if(dialogid == 16512)
{
if(response)
{
new len = strlen(inputtext);
if(len > 1 && len < 65)
{
strmid(arrUpdates[iUpd][g_Update1], inputtext, 0, strlen(inputtext), sizeof(arrUpdates));
//arrUpdates[iUpd][g_Update1] = strlen(inputtext);
format(string, sizeof(string), "You have changed Update 1 to %s. (/updates)", inputtext);
SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
CreateDynamicUpdates(strlen(inputtext));
SaveDynamicUpdates();
}
else
{
ShowPlayerDialog(playerid, 16512, DIALOG_STYLE_LIST, "Update 1:", "Input text\nClear Update", "Select", "Cancel");
}
}