29.12.2010, 16:27
It should give me correct messages after each 4 seconds.. But it will give me 3 times the same. :S
pawn Код:
//______________//
// The Gamemode //
//______________//
//////////////////
public OnPlayerSpawn(playerid)
{
CallRemoteFunction("ShowInfoBoxPersonal","isi",playerid, "IS SHOULD SHOW MESSAGE NUMBERO 1 I HOPE IT DOES", 4000);
CallRemoteFunction("ShowInfoBoxPersonal","isi",playerid, "IS SHOULD SHOW MESSAGE NUMBERO 2 I HOPE IT DOES", 8000);
CallRemoteFunction("ShowInfoBoxPersonal","isi",playerid, "IS SHOULD SHOW MESSAGE NUMBERO 3 I HOPE IT DOES", 12000);
}
//__________________//
// The FilterScript //
//__________________//
//////////////////////
forward ShowInfoBoxPersonal(playerid, text[], time);
public ShowInfoBoxPersonal(playerid, text[], time)
{
Slots--;
SetTimers[Slots] = SetTimerEx("CreateBox", time, false, "is", playerid, text);
if(Slots == 0) { Slots = 3; }
if(!ProcessingPersonal[playerid])
{
ProcessingPersonal[playerid] = 1;
}
}
forward CreateBox(playerid, text[]);
public CreateBox(playerid, text[])
{
printf("playerid = %d, text = %s",playerid,text);
KillTimer(HideBox[playerid]);
HideBox[playerid] = SetTimerEx("HideInfoBox",4500,false,"i",playerid);
TextDrawHideForPlayer(playerid, InfoBox[playerid]);
TextDrawSetString(InfoBox[playerid], text);
TextDrawShowForPlayer(playerid, InfoBox[playerid]);
return 1;
}
//______________________________________//
// What happens in server log by printf //
//______________________________________//
//////////////////////////////////////////
[18:19:26] playerid = 0, text = IS SHOULD SHOW MESSAGE NUMBERO 3 I HOPE IT DOES
[18:19:30] playerid = 0, text = IS SHOULD SHOW MESSAGE NUMBERO 3 I HOPE IT DOES
[18:19:35] playerid = 0, text = IS SHOULD SHOW MESSAGE NUMBERO 3 I HOPE IT DOES