SA-MP Forums Archive
Function Not Working :( - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Function Not Working :( (/showthread.php?tid=492433)



Function Not Working :( - Youssef214 - 03.02.2014

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;
}



Re: Function Not Working :( - Youssef214 - 03.02.2014

please,anyone?


Re: Function Not Working :( - Borg - 03.02.2014

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



Re: Function Not Working :( - Youssef214 - 03.02.2014

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.


Re: Function Not Working :( - Borg - 03.02.2014

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.


Re: Function Not Working :( - Youssef214 - 03.02.2014

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


Re: Function Not Working :( - Youssef214 - 03.02.2014

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



Re: Function Not Working :( - Borg - 03.02.2014

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


Re: Function Not Working :( - Youssef214 - 03.02.2014

whole code of the 3 variables?


Re: Function Not Working :( - Borg - 03.02.2014

of the script