void CALLBACK mainloop()
{
static bool init = false;
if (!init)
{
if (GAME == nullptr)
return;
if (GAME->GetSystemState() != eSystemState::GS_PLAYING_GAME)
return;
if (!SF->getSAMP()->IsInitialized())
return;
SF->getSAMP()->getChat()->AddChatMessage(D3DCOLOR_XRGB(255,55,55), "хуйня загружена." );
init = true;
}
if (SF->getSAMP()->getDialog()->iIsActive && (SF->getSAMP()->getDialog()->DialogID == 1)
{
static DWORD dwTime = 0;
char result[5];
char * text = "лох";
static int state = 0;
switch (state)
{
case 0: dwTime = GetTickCount(); state ++;
case 1:
{
if (GetTickCount() - dwTime > 500)
{
sprintf(result, "%c", text[0]);
SF->getSAMP()->getDialog()->SetInputText(result);
state ++;
dwTime = GetTickCount();
}
}
case 2:
{
if (GetTickCount() - dwTime > 600)
{
sprintf(result, "%c%c", text[0], text[1]);
SF->getSAMP()->getDialog()->SetInputText(result);
state ++;
dwTime = GetTickCount();
}
}
case 3:
{
if (GetTickCount() - dwTime > 700)
{
sprintf(result, "%c%c%c", text[0], text[1], text[2]);
SF->getSAMP()->getDialog()->SetInputText(result);
state ++;
dwTime = GetTickCount();
}
}
}
char result2[255];
sprintf(result2, "%d | %d | %d", GetTickCount(), GetTickCount() - dwTime, state);
SF->getSAMP()->getChat()->AddChatMessage(-1, result2);
}
}