13.12.2016, 00:16
(
Последний раз редактировалось OneDay; 04.04.2017 в 13:21.
)
PHP код:
#if defined _INC_od_stdio
#endinput
#endif
#define _INC_od_stdio
new File:stdin;
new File:stdout;
#define OD_STDIO_Flush IO_Flush
#define OD_STDIO_CarriageReturn IO_CarriageReturn
#define OD_STDIO_NewLine IO_NewLine
#define OD_STDIO_Write IO_Write
#define OD_STDIO_Read IO_Read
public OnGameModeInit()
{
stdin = fopen("CON", io_read);
stdout = fopen("CON", io_write);
#if defined OD_STDIO_OnGameModeInit
OD_STDIO_OnGameModeInit();
#endif
return 1;
}
#if defined _ALS_OnGameModeInit
#undef OnGameModeInit
#else
#define _ALS_OnGameModeInit
#endif
#define OnGameModeInit OD_STDIO_OnGameModeInit
#if defined OD_STDIO_OnGameModeInit
forward OD_STDIO_OnGameModeInit();
#endif
public OnGameModeExit()
{
fclose(stdin);
fclose(stdout);
#if defined OD_STDIO_OnGameModeExit
OD_STDIO_OnGameModeExit();
#endif
return 1;
}
#if defined _ALS_OnGameModeExit
#undef OnGameModeExit
#else
#define _ALS_OnGameModeExit
#endif
#define OnGameModeExit OD_STDIO_OnGameModeExit
#if defined OD_STDIO_OnGameModeExit
forward OD_STDIO_OnGameModeExit();
#endif
stock IO_Flush() {
fclose(stdout);
stdout = fopen("CON", io_write);
}
stock IO_CarriageReturn() {
fwrite(stdout, "\r");
}
stock IO_NewLine() {
fwrite(stdout, "\n");
}
stock IO_Write(str[]) {
fwrite(stdout, str);
}
stock IO_Read(str[], size = sizeof (str)) {
// Press enter first.
fread(stdin, str, size);
}
PHP код:
ln -s /dev/tty ./scriptfiles/CON
Password for server example:
http://forum.sa-mp.com/showthread.ph...24#post3812624
Moving progress bar example:
http://forum.sa-mp.com/showthread.ph...29#post3812629
Scrolling text example:
http://forum.sa-mp.com/showthread.ph...87#post3812687