23.10.2017, 19:09
Pessoal, fiz uma intro para meu servidor, o problema й que quando uma outra pessoa loga... a pessoa que jб estб Spawnada vк a intro e a intro trava pra pessoa que estava comeзando a ver, como se estivesse global. Como eu posso resolver isso? cуdigo:
PHP код:
new NumeroIntro[MAX_PLAYERS];
new AutoIntro[MAX_PLAYERS];
new PlayerText:textIntro[11][MAX_PLAYERS];
static
PlayerText:FADE_BOX[MAX_PLAYERS],
FADE_STATUS = 0x01,
FADE_TIMER[MAX_PLAYERS]
;
public OnPlayerConnect(playerid)
{
AutoIntro[playerid] = 0;
return 1;
}
stock CarregarPlayer(playerid)
{
new Arquivo[40];
format(Arquivo, sizeof(Arquivo), "Contas/%s.ini", PlayerName(playerid));
if(DOF2_FileExists(Arquivo))
{
PlayerInfo[playerid][pLevel] = DOF2_GetInt(Arquivo, "Level");
ResetPlayerMoney(playerid);
SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
DOF2_SaveFile();
}
ResetPlayerMoney(playerid);
hideTelaLogin(playerid);
SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
//GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
gPlayerLogged[playerid] = 1;
if(PlayerInfo[playerid][pReg] == 0)
{
InterpolateCameraPos(playerid, -1473.536987, 929.034118, 27.499238, -1473.536987, 929.034118, 27.499238, 4000);
InterpolateCameraLookAt(playerid, -1468.784301, 927.625915, 26.844387, -1468.784301, 927.625915, 26.844387, 4000);
// AQUI ELE CHAMA UMA TEXTDRAW E QUANDO CLICAR NELA VAI PRO TUTORIAL.. CУDIGO NO OnPlayerClickTextDraw
}
else
{
AutoIntro[playerid] = 0;
NumeroIntro[playerid] = 5;
FADE_TIMER[playerid] = SetTimerEx("FadeEffect", FADE_VELOCITY, true, "i", playerid);
PlayerTextDrawShow(playerid, FADE_BOX[playerid]);
}
return 1;
}
stock Intro(playerid)
{
NumeroIntro[playerid] ++;
new numero = NumeroIntro[playerid];
ClearChatbox(playerid, 20);
switch(numero){
case 1:
{
StopAudioStreamForPlayer(playerid);
PlayAudioStreamForPlayer(playerid, "https://dl.dropboxusercontent.com/s/m5w2f6olrnmaxrv/Soundtrack%20-%20Intro.mp3?dl=0");
ClearChatbox(playerid, 20);
PlayerTextDrawShow(playerid, textIntro[0][playerid]);
PlayerTextDrawShow(playerid, textIntro[1][playerid]);
InterpolateCameraPos(playerid, -1585.274414, 904.302001, 32.613651, -1528.172241, 915.250549, 24.124784, 10000);
InterpolateCameraLookAt(playerid, -1580.596313, 905.566223, 31.382064, -1523.501464, 916.339660, 22.711526, 10000);
SetTimer("LoadFadeEffect", 5000, false);
}
case 2:
{
PlayerTextDrawHide(playerid, textIntro[0][playerid]);
PlayerTextDrawHide(playerid, textIntro[1][playerid]);
PlayerTextDrawShow(playerid, textIntro[2][playerid]);
PlayerTextDrawShow(playerid, textIntro[3][playerid]);
InterpolateCameraPos(playerid, -1437.165161, 999.103515, 35.027973, -1498.252075, 966.628295, 35.027973, 9000);
InterpolateCameraLookAt(playerid, -1434.941528, 994.780395, 33.859199, -1495.894287, 962.354431, 33.944114, 9000);
SetTimer("LoadFadeEffect", 5000, false);
}
case 3:
{
PlayerTextDrawHide(playerid, textIntro[0][playerid]);
PlayerTextDrawHide(playerid, textIntro[1][playerid]);
PlayerTextDrawHide(playerid, textIntro[2][playerid]);
PlayerTextDrawHide(playerid, textIntro[3][playerid]);
PlayerTextDrawShow(playerid, textIntro[4][playerid]);
PlayerTextDrawShow(playerid, textIntro[5][playerid]);
InterpolateCameraPos(playerid, -1487.162841, 919.103210, 14.610277, -1461.596923, 920.933471, 14.877431, 9000);
InterpolateCameraLookAt(playerid, -1484.466308, 923.266784, 13.983280, -1456.598999, 921.003967, 15.004137, 9000);
SetTimer("LoadFadeEffect", 5000, false);
}
case 4:
{
PlayerTextDrawHide(playerid, textIntro[0][playerid]);
PlayerTextDrawHide(playerid, textIntro[1][playerid]);
PlayerTextDrawHide(playerid, textIntro[2][playerid]);
PlayerTextDrawHide(playerid, textIntro[3][playerid]);
PlayerTextDrawHide(playerid, textIntro[4][playerid]);
PlayerTextDrawHide(playerid, textIntro[5][playerid]);
PlayerTextDrawShow(playerid, textIntro[6][playerid]);
PlayerTextDrawShow(playerid, textIntro[7][playerid]);
PlayerTextDrawShow(playerid, textIntro[8][playerid]);
PlayerTextDrawShow(playerid, textIntro[9][playerid]);
PlayerTextDrawShow(playerid, textIntro[10][playerid]);
InterpolateCameraPos(playerid, -1451.406494, 916.080383, 16.590414, -1452.305053, 915.994323, 26.902656, 9000);
InterpolateCameraLookAt(playerid, -1446.423706, 915.947875, 16.198200, -1447.309570, 916.006652, 26.690147, 9000);
SetTimer("LoadFadeEffect", 5000, false);
}
default:{
GameTextForPlayer(playerid, "~w~~y~Bem-vindo a ~n~ BullWorth", 1000, 1);
NumeroIntro[playerid] = 0;
AutoIntro[playerid] = 0;
TogglePlayerSpectating(playerid, 0);
CancelSelectTextDraw(playerid);
SetPlayerPos(playerid, -1501.2959, 920.4486, 7.2524);
SetPlayerFacingAngle(playerid, 269.8085);
if(PlayerInfo[playerid][pSex] == 1)
SetPlayerSkin(playerid, 121);
if(PlayerInfo[playerid][pSex] == 2)
SetPlayerSkin(playerid, 190);
for(new x; x != 36; x++){
PlayerTextDrawShow(playerid, TextProgressBar[x][playerid]);}
for(new x; x != 5; x++){
TextDrawShowForPlayer(playerid, textRodape[x]);}
StopAudioStreamForPlayer(playerid);
PlayAudioStreamForPlayer(playerid, "https://dl.dropboxusercontent.com/s/v9ndl3fvawwt4li/Sound-Bully.mp3?dl=0");
ClearChatbox(playerid, 20);
}
}
return 1;
}
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
if(clickedid == sexo_draw[12])
{
PlayerInfo[playerid][pSex] = 1;
AutoIntro[playerid] = 1;
NumeroIntro[playerid] = 0;
for(new x; x != 14; x++) TextDrawHideForPlayer(playerid, sexo_draw[x]);
CancelSelectTextDraw(playerid);
FADE_TIMER[playerid] = SetTimerEx("FadeEffect", FADE_VELOCITY, true, "i", playerid);
PlayerTextDrawShow(playerid, FADE_BOX[playerid]);
}
if(clickedid == sexo_draw[13])
{
PlayerInfo[playerid][pSex] = 2;
AutoIntro[playerid] = 1;
NumeroIntro[playerid] = 0;
for(new x; x != 14; x++) TextDrawHideForPlayer(playerid, sexo_draw[x]);
CancelSelectTextDraw(playerid);
FADE_TIMER[playerid] = SetTimerEx("FadeEffect", FADE_VELOCITY, true, "i", playerid);
PlayerTextDrawShow(playerid, FADE_BOX[playerid]);
}
return 1;
}
public FadeEffect(playerid)
{
PlayerTextDrawBoxColor(playerid, FADE_BOX[playerid], (FADE_STATUS = (FADE_STATUS + 0x01)));
PlayerTextDrawShow(playerid, FADE_BOX[playerid]);
if(FADE_STATUS == 0xFF)
{
FADE_STATUS = 0x01;
KillTimer(FADE_TIMER[playerid]);
PlayerTextDrawHide(playerid, FADE_BOX[playerid]);
if(AutoIntro[playerid] == 1) Intro(playerid);
}
return 1;
}
public LoadFadeEffect(playerid)
{
for(new x; x != 11; x++){
PlayerTextDrawHide(playerid, textIntro[x][playerid]);}
FADE_TIMER[playerid] = SetTimerEx("FadeEffect", FADE_VELOCITY, true, "i", playerid);
PlayerTextDrawShow(playerid, FADE_BOX[playerid]);
return 1;
}