[AJUDA]Aonde estб o erro pessoal?
#1

pawn Код:
#include <a_samp>

#define TOTAIS_CHECKS 19

new Stats[MAX_PLAYERS];
new bool:PlayerRa[500];

new Float:Checkpoints[TOTAIS_CHECKS][19] =
{
 { -302.1711,1508.3451,75.3594 },
 { -305.4507,1395.2365,72.3118
 },{ -375.1031,1461.8661,62.1423
 },{ -328.6879,1316.2310,52.4871
 },{ -447.1574,1500.4052,34.9547
 },{ -399.9567,1750.0654,42.6130
 },{ -409.4537,1918.7510,57.7848
 },{ -439.1856,1759.7423,72.0444
 },{ -480.7166,1939.3983,86.4597
 },{ -388.9103,2080.4001,61.1164
 },{ -532.2165,1990.8622,60.3906
 },{ -384.1641,2075.6667,60.9181
 },{ -439.3697,1761.9298,72.0275
 },{ -418.0215,1917.2354,57.4656
 },{ -443.9293,1630.9391,35.6589
 },{ -324.8012,1316.9939,52.8978
 },{ -370.5130,1462.3467,62.6581
 },{ -308.6009,1395.1691,72.2705 },
   { -301.6882,1501.4779,75.5935 }

};
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/corrida", true))
    {
        SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: Vocк foi para o Race");
        PlayerRa[playerid] = true;
        SetPlayerRaceCheckpoint(playerid, 0, Checkpoints[Stats[playerid]][0], Checkpoints[Stats[playerid]][1], Checkpoints[Stats[playerid]][2], Checkpoints[Stats[playerid]+1][0], Checkpoints[Stats[playerid]+1][1], Checkpoints[Stats[playerid]+1][2], 10);
        Stats[playerid]++;
        return true;
    }
    return false;
}
public OnPlayerEnterCheckpoint(playerid)
{
    if(PlayerRa[playerid] == true)
    {
        Stats[playerid]++;
        DisablePlayerRaceCheckpoint(playerid);
        SetPlayerRaceCheckpoint(playerid, 0, Checkpoints[Stats[playerid]][0], Checkpoints[Stats[playerid]][1], Checkpoints[Stats[playerid]][2], Checkpoints[Stats[playerid]+1][0], Checkpoints[Stats[playerid]+1][1], Checkpoints[Stats[playerid]+1][2], 10);
    }
    if(Stats[playerid] == TOTAIS_CHECKS-1 && PlayerRa[playerid] == true)
    {
        DisablePlayerRaceCheckpoint(playerid);
        SetPlayerRaceCheckpoint(playerid,1, Checkpoints[Stats[playerid]][0], Checkpoints[Stats[playerid]][1], Checkpoints[Stats[playerid]][2], Checkpoints[Stats[playerid]+1][0], Checkpoints[Stats[playerid]+1][1], Checkpoints[Stats[playerid]+1][2], 10);
        SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: Vocк esta quase acabando a corrida!!");
    }
    if(Stats[playerid] == TOTAIS_CHECKS && PlayerRa[playerid] == true)
    {
        PlayerRa[playerid] = false;
        Stats[playerid] = 0;
        SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: Vocк acabou o Race parabйns");
        DisablePlayerRaceCheckpoint(playerid);
    }
    return true;
}
Pessoal й o seguinte nao sei o que esta acontecendo mais quando nao esta criandos novos Checkpoint.. ex: eu passo me um Checkpoint ai nao cria outro a frente.. o que esta errado ?
Reply
#2

pawn Код:
#include <a_samp>

#define TOTAIS_CHECKS 19

new Stats[MAX_PLAYERS];
new bool:PlayerRa[500];

new Float:Checkpoints[TOTAIS_CHECKS][3] =
{
{ -302.1711,1508.3451,75.3594 },
{ -305.4507,1395.2365,72.3118 },
{ -375.1031,1461.8661,62.1423 },
{ -328.6879,1316.2310,52.4871 },
{ -447.1574,1500.4052,34.9547 },
{ -399.9567,1750.0654,42.6130 },
{ -409.4537,1918.7510,57.7848 },
{ -439.1856,1759.7423,72.0444 },
{ -480.7166,1939.3983,86.4597 },
{ -388.9103,2080.4001,61.1164 },
{ -532.2165,1990.8622,60.3906 },
{ -384.1641,2075.6667,60.9181 },
{ -439.3697,1761.9298,72.0275 },
{ -418.0215,1917.2354,57.4656 },
{ -443.9293,1630.9391,35.6589 },
{ -324.8012,1316.9939,52.8978 },
{ -370.5130,1462.3467,62.6581 },
{ -308.6009,1395.1691,72.2705 },
{ -301.6882,1501.4779,75.5935 }
};

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/corrida", true))
    {
        SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: Vocк foi para o Race");
        PlayerRa[playerid] = true;
        SetPlayerRaceCheckpoint(playerid, 0, Checkpoints[Stats[playerid]][0], Checkpoints[Stats[playerid]][1], Checkpoints[Stats[playerid]][2], Checkpoints[Stats[playerid]+1][0], Checkpoints[Stats[playerid]+1][1], Checkpoints[Stats[playerid]+1][2], 10);
        Stats[playerid]++;
        return true;
    }
    return false;
}
public OnPlayerEnterCheckpoint(playerid)
{
    if(PlayerRa[playerid] == true)
    {
        Stats[playerid]++;
        DisablePlayerRaceCheckpoint(playerid);
        SetPlayerRaceCheckpoint(playerid, 0, Checkpoints[Stats[playerid]][0], Checkpoints[Stats[playerid]][1], Checkpoints[Stats[playerid]][2], Checkpoints[Stats[playerid]+1][0], Checkpoints[Stats[playerid]+1][1], Checkpoints[Stats[playerid]+1][2], 10);
    }
    if(Stats[playerid] == TOTAIS_CHECKS-1 && PlayerRa[playerid] == true)
    {
        DisablePlayerRaceCheckpoint(playerid);
        SetPlayerRaceCheckpoint(playerid,1, Checkpoints[Stats[playerid]][0], Checkpoints[Stats[playerid]][1], Checkpoints[Stats[playerid]][2], Checkpoints[Stats[playerid]+1][0], Checkpoints[Stats[playerid]+1][1], Checkpoints[Stats[playerid]+1][2], 10);
        SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: Vocк esta quase acabando a corrida!!");
    }
    if(Stats[playerid] == TOTAIS_CHECKS && PlayerRa[playerid] == true)
    {
        PlayerRa[playerid] = false;
        Stats[playerid] = 0;
        SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: Vocк acabou o Race parabйns");
        DisablePlayerRaceCheckpoint(playerid);
    }
    return true;
}
coloca assim...
Olha ae:

https://sampforum.blast.hk/showthread.php?tid=143924
Reply
#3

continua badio..
Reply
#4

o erro estб no cуdigo.
Reply
#5

... consegui porem nao ta funcionado do geito que eu quero eu substitui OnPlayerEnterCheckpoint(playerid) para OnPlayerEnterRaceCheckpoint(playerid) porem quando eu chego no penultimo ele fica la parado e nao da pra ir pro ultimo.. e tbm nao da pra iniciar uma nova corrida.. ajuda ?
Reply
#6

tenta
pawn Код:
#include <a_samp>

#define TOTAIS_CHECKS 19

new Stats[MAX_PLAYERS];
new bool:PlayerRa[500];

new Float:Checkpoints[TOTAIS_CHECKS][3] =
{
{ -302.1711,1508.3451,75.3594 },
{ -305.4507,1395.2365,72.3118 },
{ -375.1031,1461.8661,62.1423 },
{ -328.6879,1316.2310,52.4871 },
{ -447.1574,1500.4052,34.9547 },
{ -399.9567,1750.0654,42.6130 },
{ -409.4537,1918.7510,57.7848 },
{ -439.1856,1759.7423,72.0444 },
{ -480.7166,1939.3983,86.4597 },
{ -388.9103,2080.4001,61.1164 },
{ -532.2165,1990.8622,60.3906 },
{ -384.1641,2075.6667,60.9181 },
{ -439.3697,1761.9298,72.0275 },
{ -418.0215,1917.2354,57.4656 },
{ -443.9293,1630.9391,35.6589 },
{ -324.8012,1316.9939,52.8978 },
{ -370.5130,1462.3467,62.6581 },
{ -308.6009,1395.1691,72.2705 },
{ -301.6882,1501.4779,75.5935 }
};

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/corrida", true))
    {
        SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: Vocк foi para o Race");
        PlayerRa[playerid] = true;
        SetPlayerRaceCheckpoint(playerid, 0, Checkpoints[Stats[playerid]][0], Checkpoints[Stats[playerid]][1], Checkpoints[Stats[playerid]][2], Checkpoints[Stats[playerid]+1][0], Checkpoints[Stats[playerid]+1][1], Checkpoints[Stats[playerid]+1][2], 10);
        Stats[playerid]++;
        return true;
    }
    return false;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
    if(PlayerRa[playerid] == true)
    {
        Stats[playerid]++;
        DisablePlayerRaceCheckpoint(playerid);
        SetPlayerRaceCheckpoint(playerid, 0, Checkpoints[Stats[playerid]][0], Checkpoints[Stats[playerid]][1], Checkpoints[Stats[playerid]][2], Checkpoints[Stats[playerid]+1][0], Checkpoints[Stats[playerid]+1][1], Checkpoints[Stats[playerid]+1][2], 10);
    }
    if(Stats[playerid] == TOTAIS_CHECKS-1 && PlayerRa[playerid] == true)
    {
        DisablePlayerRaceCheckpoint(playerid);
        SetPlayerRaceCheckpoint(playerid,1, Checkpoints[Stats[playerid]][0], Checkpoints[Stats[playerid]][1], Checkpoints[Stats[playerid]][2], Checkpoints[Stats[playerid]+1][0], Checkpoints[Stats[playerid]+1][1], Checkpoints[Stats[playerid]+1][2], 10);
        SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: Vocк esta quase acabando a corrida!!");
    }
    if(Stats[playerid] == TOTAIS_CHECKS && PlayerRa[playerid] == true)
    {
        PlayerRa[playerid] = false;
        Stats[playerid] = 0;
        SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: Vocк acabou o Race parabйns");
        DisablePlayerRaceCheckpoint(playerid);
    }
    return true;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)