all freeze with me -
Honest_Player - 13.08.2011
hello all here is a bug with me here is code when race start only oneplayer unfreeze other still freeze plz tell me and help here!
pawn Код:
public StartRace()
{
SetTimer("Three", 3000, 0);
SetTimer("Two", 6000, 0);
SetTimer("One", 9000, 0);
SetTimer("GoGoGo", 12000, 0);
}
forward Three();
public Three()
{
GameTextForAll("~w~- ~r~ 3 ~w~- ~r~ 3 ~w~- ~r~ 3 ~w~ -", 4000, 3);
//SendClientMessageToAll(0x008000FF, "3");
return 1;
}
forward Two();
public Two()
{
GameTextForAll("~n~~n~~w~- ~r~ 2 ~w~- ~r~ 2 ~w~- ~r~ 2 ~w~ -", 4000, 3);
//SendClientMessageToAll(0x008000FF, "2");
return 1;
}
forward One();
public One()
{
GameTextForAll("~n~~n~~n~~n~~w~- ~r~ 1 ~w~- ~r~ 1 ~w~- ~r~ 1 ~w~ -", 4000, 3);
//SendClientMessageToAll(0x008000FF, "1");
return 1;
}
forward GoGoGo(playerid);
public GoGoGo(playerid)
{
GameTextForAll("~n~~n~~n~~n~~n~~n~~w~- ~r~ Start ~w~- ~r~ Start ~w~- ~r~ Start ~w~ -", 4000, 3);
//SendClientMessageToAll(0x008000FF, "go");
TogglePlayerControllable(playerid,true);
return 1;
}
Re: all freeze with me -
Honest_Player - 13.08.2011
canan oe help me
Re: all freeze with me -
CoLLYY - 13.08.2011
Код:
public StartRace()
{
SetTimer("Three", 3000, 0);
SetTimer("Two", 6000, 0);
SetTimer("One", 9000, 0);
SetTimer("GoGoGo", 12000, 0);
}
forward Three();
public Three()
{
GameTextForAll("~w~- ~r~ 3 ~w~- ~r~ 3 ~w~- ~r~ 3 ~w~ -", 4000, 3);
//SendClientMessageToAll(0x008000FF, "3");
TogglePlayerControllable(playerid,1);
return 1;
}
forward Two();
public Two()
{
GameTextForAll("~n~~n~~w~- ~r~ 2 ~w~- ~r~ 2 ~w~- ~r~ 2 ~w~ -", 4000, 3);
//SendClientMessageToAll(0x008000FF, "2");
return 1;
}
forward One();
public One()
{
GameTextForAll("~n~~n~~n~~n~~w~- ~r~ 1 ~w~- ~r~ 1 ~w~- ~r~ 1 ~w~ -", 4000, 3);
//SendClientMessageToAll(0x008000FF, "1");
return 1;
}
forward GoGoGo(playerid);
public GoGoGo(playerid)
{
GameTextForAll("~n~~n~~n~~n~~n~~n~~w~- ~r~ Start ~w~- ~r~ Start ~w~- ~r~ Start ~w~ -", 4000, 3);
//SendClientMessageToAll(0x008000FF, "go");
TogglePlayerControllable(playerid,0);
return 1;
}
Try it
Re: all freeze with me -
Riddick94 - 13.08.2011
My god.. type /count to start.
pawn Код:
#include "a_samp"
new Count;
new Timer;
public OnGameModeExit()
{
KillTimer(Timer);
return true;
}
forward CountDown();
public CountDown()
{
for(new i = 0; i < GetMaxPlayers(); i++)
{
Count += 1;
switch(Count)
{
case 3:GameTextForAll("~w~- ~r~ 3 ~w~- ~r~ 3 ~w~- ~r~ 3 ~w~ -", 4000, 3);
case 6:GameTextForAll("~n~~n~~w~- ~r~ 2 ~w~- ~r~ 2 ~w~- ~r~ 2 ~w~ -", 4000, 3);
case 9:GameTextForAll("~n~~n~~n~~n~~w~- ~r~ 1 ~w~- ~r~ 1 ~w~- ~r~ 1 ~w~ -", 4000, 3);
case 12:
{
GameTextForAll("~n~~n~~n~~n~~n~~n~~w~- ~r~ Start ~w~- ~r~ Start ~w~- ~r~ Start ~w~ -", 4000, 3);
TogglePlayerControllable(i, true);
KillTimer(Timer);
}
}
TogglePlayerControllable(i, false);
}
return true;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/count", cmdtext, true, 10) == 0)
{
Timer = SetTimer("CountDown", 1000, true);
return true;
}
return false;
}
Re: all freeze with me -
PrawkC - 13.08.2011
pawn Код:
#include <a_samp>
new RaceTimer;
new RaceCount = 1;
public OnFilterScriptInit()
{
RaceTimer = SetTimer("StartRace", 1000, true);
return 1;
}
forward StartRace();
public StartRace()
{
switch(RaceCount)
{
case 2:
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
GameTextForAll("~w~- ~r~ 3 ~w~- ~r~ 3 ~w~- ~r~ 3 ~w~ -", 4000, 3);
TogglePlayerControllable(i, false);
}
}
case 4: GameTextForAll("~n~~n~~w~- ~r~ 2 ~w~- ~r~ 2 ~w~- ~r~ 2 ~w~ -", 4000, 3);
case 6: GameTextForAll("~n~~n~~n~~n~~w~- ~r~ 1 ~w~- ~r~ 1 ~w~- ~r~ 1 ~w~ -", 4000, 3);
case 8:
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
GameTextForAll("~n~~n~~n~~n~~n~~n~~w~- ~r~ Start ~w~- ~r~ Start ~w~- ~r~ Start ~w~ -", 4000, 3);
TogglePlayerControllable(i, true);
}
}
case 10: KillTimer(RaceTimer);
}
RaceCount++;
return 1;
}
@Riddick your code wont work, you have your count in your for loop.
Re: all freeze with me -
0_o - 13.08.2011
pawn Код:
public StartRace()
{
SetTimer("Three", 3000, 0);
SetTimer("Two", 6000, 0);
SetTimer("One", 9000, 0);
SetTimer("GoGoGo", 12000, 0);
}
forward Three();
public Three()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
GameTextForAll("~w~- ~r~ 3 ~w~- ~r~ 3 ~w~- ~r~ 3 ~w~ -", 4000, 3);
//SendClientMessageToAll(0x008000FF, "3");
TogglePlayerControllable(i,1);
}
return 1;
}
forward Two();
public Two()
{
GameTextForAll("~n~~n~~w~- ~r~ 2 ~w~- ~r~ 2 ~w~- ~r~ 2 ~w~ -", 4000, 3);
//SendClientMessageToAll(0x008000FF, "2");
return 1;
}
forward One();
public One()
{
GameTextForAll("~n~~n~~n~~n~~w~- ~r~ 1 ~w~- ~r~ 1 ~w~- ~r~ 1 ~w~ -", 4000, 3);
//SendClientMessageToAll(0x008000FF, "1");
return 1;
}
forward GoGoGo(playerid);
public GoGoGo(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
GameTextForAll("~n~~n~~n~~n~~n~~n~~w~- ~r~ Start ~w~- ~r~ Start ~w~- ~r~ Start ~w~ -", 4000, 3);
//SendClientMessageToAll(0x008000FF, "go");
TogglePlayerControllable(i,0);
}
return 1;
}
Try This, It'll Work.
Re: all freeze with me -
Honest_Player - 13.08.2011
i fixed this
but i want if player spawn after start rac then set his toogleplayercontol 1 only after race
Re: all freeze with me -
Intoxicated - 13.08.2011
Rather try this, simplified and more efficient.
Код:
new
Ctimer,
tCountdown;
public StartRace()
{
tCountdown = SetTimer("CountDown",1000, 1);
}
forward CountDown()
{
#define SEC 1000
Ctimer++;
if(Ctimer == (3*SEC))
{
GameTextForAll("~w~- ~r~ 3 ~w~- ~r~ 3 ~w~- ~r~ 3 ~w~ -", 4000, 3);
}
if(Ctimer == (5*SEC))
{
GameTextForAll("~n~~n~~w~- ~r~ 2 ~w~- ~r~ 2 ~w~- ~r~ 2 ~w~ -", 4000, 3);
}
if(Ctimer == (7*SEC))
{
GameTextForAll("~n~~n~~n~~n~~w~- ~r~ 1 ~w~- ~r~ 1 ~w~- ~r~ 1 ~w~ -", 4000, 3);
}
if(Ctimer == (10*SEC))
{
GameTextForAll("~n~~n~~n~~n~~n~~n~~w~- ~r~ Start ~w~- ~r~ Start ~w~- ~r~ Start ~w~ -", 4000, 3);
Ctimer=0;
for(new i=0; 1 < MAX_PLAYERS i++)
{
TogglePlayerControllable(i, 1);
}
KillTimer(tCountdown);
return 1;
}
}
Re: all freeze with me -
Riddick94 - 13.08.2011
pawn Код:
if(IsPlayerAfterRace(playerid))
{
TogglePlayerControllable(playerid, 1);
return true;
}
Stupid questions gots stupid answers.