21.11.2014, 06:06
When you put a timer under OnPlayerConnect, it doesn't mean that you stopped the connection for a while. Here you go to make what you want:
You can change the loop number from 20 to 50 as maximum to increase the timer interval, otherwise players will timeout on their connect.
pawn Код:
public OnPlayerConnect(playerid)
{
for(new i = 0; i < 20; i ++)
{
ShowConnectTextDraws(playerid);
}
HideConnectTextDraws(playerid);
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
if(fexist(Path(playerid)))
{
INI_ParseFile(Path(playerid),"loadaccount_%s", .bExtra = true, .extra = playerid);
ShowPlayerDialog(playerid,LOGIN_DIALOG,DIALOG_STYLE_INPUT,"Login","Enter Your Password Here","Login","Cancel");
}
else
{
ShowPlayerDialog(playerid,REGISTER_DIALOG,DIALOG_STYLE_INPUT,"Register","Register Your Account Here","Register","Quit");
return 1;
}
return 1;
}
forward ShowConnectTextDraws(playerid);
public ShowConnectTextDraws(playerid)
{
TextDrawShowForPlayer(playerid, ConnectTD0);
TextDrawShowForPlayer(playerid, ConnectTD1);
TextDrawShowForPlayer(playerid, ConnectTD2);
TextDrawShowForPlayer(playerid, ConnectTD3);
TextDrawShowForPlayer(playerid, ConnectTD4);
TextDrawShowForPlayer(playerid, ConnectTD5);
TextDrawShowForPlayer(playerid, ConnectTD6);
TextDrawShowForPlayer(playerid, ConnectTD7);
TextDrawShowForPlayer(playerid, ConnectTD8);
TextDrawShowForPlayer(playerid, ConnectTD9);
TextDrawShowForPlayer(playerid, ConnectTD10);
return 1;
}
forward HideConnectTextDraws(playerid);
public HideConnectTextDraws(playerid)
{
TextDrawHideForPlayer(playerid, ConnectTD0);
TextDrawHideForPlayer(playerid, ConnectTD1);
TextDrawHideForPlayer(playerid, ConnectTD2);
TextDrawHideForPlayer(playerid, ConnectTD3);
TextDrawHideForPlayer(playerid, ConnectTD4);
TextDrawHideForPlayer(playerid, ConnectTD5);
TextDrawHideForPlayer(playerid, ConnectTD6);
TextDrawHideForPlayer(playerid, ConnectTD7);
TextDrawHideForPlayer(playerid, ConnectTD8);
TextDrawHideForPlayer(playerid, ConnectTD9);
TextDrawHideForPlayer(playerid, ConnectTD10);
return 1;
}