OnPlayerEnterDynamicCP problem.
#1

Hello.I am helping on a TDM server, but I have a problem with the function on the title.I tried debugging but nothing gets called.Here is the script:
pawn Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
    if(checkpointid == CP[CityHall])
    {
        if(UnderAttack[CityHall] == 0) {
            if(tCP[CityHall] != gTeam[playerid]) {
                print("OnPlayerEnterDynamicCP: Checkpoint entered");
                CountVar[playerid][CityHall] = 25;
                ActiveCityHall(playerid);
                print("OnPlayerEnterDynamicCP: ActiveCityHall started");
            } else return SendClientMessage(playerid, COLOR_RED,"*This zone is already captured by your team!");
        } else return CaptureZoneMessage(playerid, 2);
    }
    return 1;
}
And the CreateDynamicCP
pawn Код:
CP[CityHall] = CreateDynamicCP(-2706.1326,375.9625,4.9686,3,-1,-1,-1,100.0);
I have no errors or anything...
Reply
#2

Add checks after each if statement as well so you can see where the code execution stops. Then you will have your problem.
Reply
#3

Did this:
pawn Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
    if(checkpointid == CP[CityHall])
    {
        print("OnPlayerEnterDynamicCP: Entered");
        if(UnderAttack[CityHall] == 0) {
            print("OnPlayerEnterDynamicCP: Not under attack");
            if(tCP[CityHall] != gTeam[playerid]) {
                print("OnPlayerEnterDynamicCP: Checkpoint entered");
                CountVar[playerid][CityHall] = 25;
                ActiveCityHall(playerid);
                print("OnPlayerEnterDynamicCP: ActiveCityHall started");
            } else return SendClientMessage(playerid, COLOR_RED,"*This zone is already captured by your team!");
        } else return CaptureZoneMessage(playerid, 2);
    }
    return 1;
}
Still didn't call anything...
Reply
#4

The only thing to conclude from that is that you aren't entering that checkpoint then!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)