Best way to do this?
#1

Код:
public TenSecondTimerForDeliveries(playerid) {
    TogglePlayerControllable(playerid,0);
	SetTimer(GameTextForPlayer(playerid, "1", 1000, 5),1000,false);
    SetTimer(GameTextForPlayer(playerid, "2", 1000, 5),1000,false);
    SetTimer(GameTextForPlayer(playerid, "3", 1000, 5),1000,false);
    SetTimer(GameTextForPlayer(playerid, "4", 1000, 5),1000,false);
    SetTimer(GameTextForPlayer(playerid, "5", 1000, 5),1000,false);
    SetTimer(GameTextForPlayer(playerid, "6", 1000, 5),1000,false);
    SetTimer(GameTextForPlayer(playerid, "7", 1000, 5),1000,false);
    SetTimer(GameTextForPlayer(playerid, "8", 1000, 5),1000,false);
    SetTimer(GameTextForPlayer(playerid, "9", 1000, 5),1000,false);
    SetTimer(GameTextForPlayer(playerid, "10", 1000, 5),1000,false);
    TogglePlayerControllable(playerid,1);
}
I get errors because of using the GameTextForPlayer function in it, and I don't know if it will even work.
Reply
#2

What do you actually want to do?

Definition of SetTimerEx:

SetTimerEx(funcname[], interval, repeating, const format[], {Float,_}:...)

What you are trying to do in this code is calling the function GameTextForPlayer with parameters instead of entering the function name only.
Reply
#3

Код:
new CountDown[MAX_PLAYERS]; //Top Of Your Script
new Bool:Frozen[MAX_PLAYERS]; //Top Of Your Script

forward TenSecondTimerForDeliveries(playerid);
public TenSecondTimerForDeliveries(playerid) 
{
    new String[128];
    if(Frozen[playerid] == false)
    {
      TogglePlayerControllable(playerid,0);
      Frozen[playerid] = true;
    }
    if(CountDown[playerid] == 10)
    {
      TogglePlayerControllable(playerid,1);
      Frozen[playerid] = false;
      CountDown[playerid] = 0;
      return 1;
    }
    else
    {
      CountDown[playerid]++;
      format(String,128,"~r~~h~%d",CountDown[playerid]);
      GameTextForPlayer(Playerid,String,1200,5);
      SetTimerEx("TenSecondTimerForDeliveries",1000,0,"i",playerid);
    }
    return 1;
}
Untested.
Reply
#4

Killa_, there were a couple of capitalization errors but it worked, thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)