Checkpoint problem
#1

hi there i want to ask
im making a checkpoint system for my server

this is my code
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
     //usa
    new nama[MAX_PLAYER_NAME];
    GetPlayerName(playerid, nama, sizeof(nama));
    new text[128];
    if(IsCapturing[playerid][usapro] == 1)
    {
        if(IsPlayerInVehicle(playerid, usapro))
        {
            DisablePlayerCheckpoint(playerid);
            IsCapturing[playerid][usapro] = 0;
            format(text, sizeof(text), "%s has captured America prototype for his team!", nama);
            SendClientMessageToAll(COLOR_ORANGE, text);
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_GREEN, "Congratulations! You got +3 score and +10000 cash!");
            GivePlayerMoney(playerid, 10000);
            SetVehicleToRespawn(usapro);
            RecentlyCaptured[usapro] = 1;
            SetTimer("usatime", 480000, false);
            SetPlayerScore(playerid, GetPlayerScore(playerid)+3);
            TogglePlayerAllDynamicCPs(playerid, 1);

        }
        else
        {
            SendClientMessage(playerid, COLOR_RED, "You're not in the America Prototype.");
        }
    }

    //europe
    if(IsCapturing[playerid][europro] == 1)
    {
        if(IsPlayerInVehicle(playerid, europro))
        {
            DisablePlayerCheckpoint(playerid);
            IsCapturing[playerid][europro] = 0;
            format(text, sizeof(text), "%s has captured Europe prototype for his team!", nama);
            SendClientMessageToAll(COLOR_ORANGE, text);
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_GREEN, "Congratulations! You got +3 score and +10000 cash!");
            GivePlayerMoney(playerid, 10000);
            SetVehicleToRespawn(europro);
            RecentlyCaptured[europro] = 1;
            SetTimer("eurotime", 480000, false);
            SetPlayerScore(playerid, GetPlayerScore(playerid)+3);
            TogglePlayerAllDynamicCPs(playerid, 1);

        }
        else
        {
            SendClientMessage(playerid, COLOR_RED, "You're not in the Europe Prototype.");
        }
    }
    //asia
    if(IsCapturing[playerid][asiapro] == 1)
    {
        if(IsPlayerInVehicle(playerid, asiapro))
        {
            DisablePlayerCheckpoint(playerid);
            IsCapturing[playerid][asiapro] = 0;
            format(text, sizeof(text), "%s has captured Asia prototype for his team!", nama);
            SendClientMessageToAll(COLOR_ORANGE, text);
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_GREEN, "Congratulations! You got +3 score and +10000 cash!");
            GivePlayerMoney(playerid, 10000);
            SetVehicleToRespawn(asiapro);
            RecentlyCaptured[asiapro] = 1;
            SetTimer("asiatime", 480000, false);
            SetPlayerScore(playerid, GetPlayerScore(playerid)+3);
            TogglePlayerAllDynamicCPs(playerid, 1);

        }
        else
        {
            SendClientMessage(playerid, COLOR_RED, "You're not in the Asia Prototype.");
        }
    }
    //africa
    if(IsCapturing[playerid][africapro] == 1)
    {
        if(IsPlayerInVehicle(playerid, africapro))
        {
            DisablePlayerCheckpoint(playerid);
            IsCapturing[playerid][africapro] = 0;
            format(text, sizeof(text), "%s has captured Africa prototype for his team!", nama);
            SendClientMessageToAll(COLOR_ORANGE, text);
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_GREEN, "Congratulations! You got +3 score and +10000 cash!");
            GivePlayerMoney(playerid, 10000);
            SetVehicleToRespawn(africapro);
            RecentlyCaptured[africapro] = 1;
            SetTimer("africatime", 480000, false);
            SetPlayerScore(playerid, GetPlayerScore(playerid)+3);
            TogglePlayerAllDynamicCPs(playerid, 1);

        }
        else
        {
            SendClientMessage(playerid, COLOR_RED, "You're not in the Africa Prototype.");
        }
    }
    //australia
    if(IsCapturing[playerid][auspro] == 1)
    {
        if(IsPlayerInVehicle(playerid, auspro))
        {
            DisablePlayerCheckpoint(playerid);
            IsCapturing[playerid][auspro] = 0;
            format(text, sizeof(text), "%s has captured Australia prototype for his team!", nama);
            SendClientMessageToAll(COLOR_ORANGE, text);
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_GREEN, "Congratulations! You got +3 score and +10000 cash!");
            GivePlayerMoney(playerid, 10000);
            SetVehicleToRespawn(auspro);
            RecentlyCaptured[auspro] = 1;
            SetTimer("austime", 480000, false);
            SetPlayerScore(playerid, GetPlayerScore(playerid)+3);
            TogglePlayerAllDynamicCPs(playerid, 1);

        }
        else
        {
            SendClientMessage(playerid, COLOR_RED, "You're not in the Australia Prototype.");
        }
    }
    return 1;
}
but when i enter the checkpoint it doesnt respond anything (no respond)

and i got this error from crashdetect
Quote:

[debug] #0 0015bc48 in public Streamer_OnPlayerEnterCP (0) from GM.amx
[00:36:57] [debug] #1 native CallLocalFunction () from samp-server.exe
[00:36:57] [debug] #2 0001774c in ?? (0) from GM.amx
[00:36:57] [debug] #3 00006880 in public OnPlayerEnterCheckpoint (0) from GM.amx
[00:37:37] [debug] Run time error 4: "Array index out of bounds"
[00:37:37] [debug] Accessing element at index 65535 past array upper bound 499

plss help me

sry for my bad english
Reply


Messages In This Thread
Checkpoint problem - by semara123 - 06.06.2016, 07:48
Re: Checkpoint problem - by BornHuman - 06.06.2016, 08:12
Re: Checkpoint problem - by semara123 - 06.06.2016, 10:29

Forum Jump:


Users browsing this thread: 1 Guest(s)