Function Not Working :(
#1

Why It Doesn't Send Me Any Message in this?

pawn Код:
public OnPlayerLeaveDynamicCP(playerid, checkpointid)
{
    if(!IsPlayerInDynamicCP(playerid, Grove))
    {
        if(iCP[Police] == gTeam[playerid])
        {
        SendClientMessage(playerid, 0x00FF007A, "You have left the checkpoint , You have failed to capture");
        GangZoneStopFlashForAll(Grove);
        SendClientMessageToAll(0x00FF007A, "Grove GangZone was not taken over");
        KillTimer(timer[playerid][Grove]);
        Checkpoint[playerid] = 0;
        UnderAttack[Grove] = 0;
        }
    }
    if(!IsPlayerInDynamicCP(playerid, Ballas))
    {
        if(iCP[Ballas] == gTeam[playerid])
        {
        SendClientMessage(playerid, 0x00FF007A, " You have left the checkpoint , You have failed to capture");
        GangZoneStopFlashForAll(Ballas);
        SendClientMessageToAll(0x00FF007A, "Ballas GangZone was not taken over");
        KillTimer(timer[playerid][Ballas]);
        Checkpoint[playerid] = 0;
        UnderAttack[Ballas] = 0;
        }
    }
    if(!IsPlayerInDynamicCP(playerid, Aztecas))
    {
        if(iCP[Aztecas] == gTeam[playerid])
        {
        SendClientMessage(playerid, 0x00FF007A, " You have left the checkpoint , You have failed to capture");
        GangZoneStopFlashForAll(Aztecas);
        SendClientMessageToAll(0x00FF007A, "Aztecas GangZone was not taken over");
        KillTimer(timer[playerid][Aztecas]);
        Checkpoint[playerid] = 0;
        UnderAttack[Aztecas] = 0;
        }
    }
    if(!IsPlayerInDynamicCP(playerid, Vagos))
    {
        if(iCP[Vagos] == gTeam[playerid])
        {
        SendClientMessage(playerid, 0x00FF007A, " You have left the checkpoint , You have failed to capture");
        GangZoneStopFlashForAll(Vagos);
        SendClientMessageToAll(0x00FF007A, "Vagos GangZone was not taken over");
        KillTimer(timer[playerid][Vagos]);
        Checkpoint[playerid] = 0;
        UnderAttack[Vagos] = 0;
        }
    }
    if(!IsPlayerInDynamicCP(playerid, Police))
    {
        if(iCP[Police] == gTeam[playerid])
        {
        SendClientMessage(playerid, 0x00FF007A, " You have left the checkpoint , You have failed to capture");
        GangZoneStopFlashForAll(Police);
        SendClientMessageToAll(0x00FF007A, "Police GangZone was not taken over");
        KillTimer(timer[playerid][Police]);
        Checkpoint[playerid] = 0;
        UnderAttack[Police] = 0;
        }
    }
    return 1;
}
Reply
#2

please,anyone?
Reply
#3

try to use this instead of using "!IsPlayerInDynamicCP(...)":
pawn Код:
if(checkpointid == Ballas)
{
...
}
Reply
#4

same,it doesn't send me any message when i leave the checkpoint. i use a variable (tCP) to send to the player that he have captured the zone,the iCP is the opposite of it.
Reply
#5

probably, you have some problems with conditions with iCP and gTeam. try to use "printf("%d, %d", iCP[Ballas], gTeam[playerid])" before if statement. also you have condition "iCP[Police] == gTeam[playerid]" in Grove checkpoint.
Reply
#6

hmm,i dont know how to do it,can you show me how,please?
Reply
#7

here is the definations of iCP, gTeam and tCP:
pawn Код:
new tCP[30];
new iCP[30];
new gTeam[MAX_PLAYERS];
Reply
#8

i believe there is error with gTeam variables, but I cannot say anything until I see the whole code
Reply
#9

whole code of the 3 variables?
Reply
#10

of the script
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)