[HELP] Race Checkpoint [Streamer]
#1

if someone help me, i will be give hem +REP
hi guys :X
I created my auto race in server but there is a problem (bug).
Code:
pawn Код:
new CP0;
new CP1;
new CP2;
new CP3;
new CP4;
new CP5;
new CP6;
new CP7;
pawn Код:
ShostanCPS0 = CreateDynamicRaceCP(0, -2018.7242,924.6336,45.1436, -2087.2236,930.4537,68.7196, 10.0, -1, -1, playerid, 1000000.0);// in the command
pawn Код:
public OnPlayerEnterDynamicRaceCP(playerid, checkpointid)
{
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 522)
    {
        if(checkpointid == CP0)
        {
            DestroyDynamicRaceCP(CP0);
            GameTextForPlayer(playerid, "~r~1/8", 5000, 3);
            PlayerPlaySound(playerid,1053,0.0,0.0,0.0);
            CP1 = CreateDynamicRaceCP(0, -2087.2236,930.4537,68.7196, -2142.8618,919.0911,79.4255, 10.0, -1, -1, playerid, 1000000.0);
            return 1;
        }
        if(checkpointid == CP1)
        {
            DestroyDynamicRaceCP(CP1);
            PlayerPlaySound(playerid,1053,0.0,0.0,0.0);
            GameTextForPlayer(playerid, "~r~2/8", 5000, 3);
            CP2 = CreateDynamicRaceCP(0, -2142.8618,919.0911,79.4255, -2037.5515,1175.8153,44.8528, 10.0, -1, -1, playerid, 1000000.0);
            return 1;
        }
        if(checkpointid == CP2)
        {
            DestroyDynamicRaceCP(CP2);
            GameTextForPlayer(playerid, "~r~3/8", 5000, 3);
            PlayerPlaySound(playerid,1053,0.0,0.0,0.0);
            CP3 = CreateDynamicRaceCP(0, -2037.5515,1175.8153,44.8528, -1966.5742,1104.3687,55.0706, 10.0, -1, -1, playerid, 1000000.0);
            return 1;
        }
        if(checkpointid == CP3)
        {
            DestroyDynamicRaceCP(CP3);
            PlayerPlaySound(playerid,1053,0.0,0.0,0.0);
            GameTextForPlayer(playerid, "~r~4/8", 5000, 3);
            CP4 = CreateDynamicRaceCP(0, -1966.5742,1104.3687,55.0706, -1884.3412,1053.7308,44.8704, 10.0, -1, -1, playerid, 1000000.0);
            return 1;
        }
        if(checkpointid == CP4)
        {
            DestroyDynamicRaceCP(CP4);
            PlayerPlaySound(playerid,1053,0.0,0.0,0.0);
            GameTextForPlayer(playerid, "~r~5/8", 5000, 3);
            CP5 = CreateDynamicRaceCP(0, -1884.3412,1053.7308,44.8704, -1902.6556,924.7991,34.5872, 10.0, -1, -1, playerid, 1000000.0);
            return 1;
        }
        if(checkpointid == CP5)
        {
            DestroyDynamicRaceCP(CP5);
            PlayerPlaySound(playerid,1053,0.0,0.0,0.0);
            GameTextForPlayer(playerid, "~r~6/8", 5000, 3);
            CP6 = CreateDynamicRaceCP(0, -1902.6556,924.7991,34.5872, -1984.4913,941.0320,45.0158, 10.0, -1, -1, playerid, 1000000.0);
            return 1;
        }
        if(checkpointid == CP6)
        {
            DestroyDynamicRaceCP(CP6);
            PlayerPlaySound(playerid,1053,0.0,0.0,0.0);
            GameTextForPlayer(playerid, "~r~7/8", 5000, 3);
            CP7 = CreateDynamicRaceCP(0, -1984.4913,941.0320,45.0158, -1884.3412,1053.7308,44.8704,10.0, -1, -1, playerid, 1000000.0);
            return 1;
        }
        if(checkpointid == CP7)
        {
            DestroyDynamicRaceCP(CP7);
            GameTextForPlayer(playerid,"You Won The Race",5000,3);
            PlayerPlaySound(playerid,1052,0.0,0.0,0.0);
            return 1;
        }
    }
    return 1;
}
So, the problem is. when player use a command. the first cp will be show. as you see in the second pawn code.
and when player enter first cp (CP0) second cp will be show ! but when player enter second cp (CP1) the race checkpoint not destroy and will be stay.
like not destroy and player stay on that, every Second will be delete and show. i don't know how to Explanation.but
Reply
#2

This is easy butt bet nmigam
Reply
#3

Tirediranian
don't spam!
i think some day you will be ban from this forum !
Reply
#4

Up...
Reply
#5

Try to remove return 1; from every statement.
Reply
#6

Quote:
Originally Posted by dominik523
Посмотреть сообщение
Try to remove return 1; from every statement.
Not Work !.
you mean like ?
pawn Код:
if(checkpointid == CP2)
        {
            DestroyDynamicRaceCP(CP2);
            GameTextForPlayer(playerid, "~r~3/8", 5000, 3);
            PlayerPlaySound(playerid,1053,0.0,0.0,0.0);
            CP3 = CreateDynamicRaceCP(0, -2037.5515,1175.8153,44.8528, -1966.5742,1104.3687,55.0706, 10.0, -1, -1, playerid, 1000000.0);
        }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)