Posts: 3,351
Threads: 780
Joined: Jan 2010
Hello, im creating a turf take over system and everything is ok, the problem is in the checkpoints. It doesnt start capturing..
OnPlayerEnterDynamicCP:
pawn Код:
if(checkpointid == CPs[AbandonedAp])
{
if(tCP[AbandonedAp] == gTeam[playerid]) return SendClientMessage(playerid, COLOR_RED,"This zone is already captured by your team");
if(UnderAttack[AbandonedAp] == 1) return SendClientMessage(playerid, COLOR_RED,"This zone is already being taken over!");
UnderAttack[AbandonedAp] = 1;
timer[playerid][AbandonedAp] = SetTimerEx("SetZone",30000,false,"i", playerid);
SendClientMessage(playerid, COLOR_YELLOW,"You're Capturing this zone! Wait here for 30 Seconds!");
iCP[playerid] = AbandonedAp;
}
Seems he can't detect when im inside the checkpoint, but i exit the cp..
pawn Код:
if(checkpointid == CPs[AbandonedAp])
{
GameTextForPlayer(playerid, "Left CP", 1000, 3);
KillTimer(timer[playerid][AbandonedAp]);
UnderAttack[AbandonedAp] = 0;
iCP[playerid] = -1;
}
It gives me "Left cp" message.
What can be wrong?
Posts: 3,351
Threads: 780
Joined: Jan 2010
Nothing, i don't get even the message.
Posts: 3,715
Threads: 358
Joined: Apr 2012
Reputation:
0
there are some include blocking the callback from being called.
What include are you using?
Can you show us your OnPlayerEnterDynamicCP.
Posts: 3,351
Threads: 780
Joined: Jan 2010
Quote:
Originally Posted by _Jake_
there are some include blocking the callback from being called.
What include are you using?
Can you show us your OnPlayerEnterDynamicCP.
|
I'm 100% sure no include is blocking the callback because other checkpoints are called, however:
pawn Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
if(checkpointid == CPs[0]) //Usa Team Shop
{
Shop(playerid);
}
if(checkpointid == CPs[1]) //GermanyTeamShop
{
Shop(playerid);
}
if(checkpointid == CPs[2]) //RussianTeamShop
{
Shop(playerid);
}
if(checkpointid == CPs[3]) //JapanTeamShop
{
Shop(playerid);
}
if(checkpointid == CPs[4]) //A69 Prototype CP
{
if(StealingA69Prot[playerid] == 1)
{
new playervehicleid = GetPlayerVehicleID(playerid);
if(playervehicleid == A69Prot)
{
SetPlayerScore(playerid, GetPlayerScore(playerid) + 5);
SetVehicleToRespawn(A69Prot);
GivePlayerMoney(playerid, 15000);
StealingA69Prot[playerid] = 0;
GameTextForPlayer(playerid, "You ~r~stole ~w~the ~g~Area69 Prototype ~w~!", 5000, 3);
CheckForLevelUpdate(playerid);
new pname[24];
GetPlayerName(playerid, pname, 24);
new kk[128];
format(kk, sizeof(kk), "** %s (%d) successfully stole the Area69 Prototype!",pname,playerid);
SCMTA(0xC93CCE00,kk);
new string[128];
format(string, sizeof(string), "05,8** %s (%d) successfully stole the Area69 Prototype!", pname,playerid);
IRC_GroupSay(gGroupID, IRC_CHANNEL, string);
SetPVarInt(playerid,"StealingTime",GetTickCount()+600000);
DisablePlayerCheckpoint(playerid);
}
}
//Gangzons checkpoint
if(checkpointid == CPs[AbandonedAp])
{
if(tCP[AbandonedAp] == gTeam[playerid]) return SendClientMessage(playerid, COLOR_RED,"This zone is already captured by your team");
if(UnderAttack[AbandonedAp] == 1) return SendClientMessage(playerid, COLOR_RED,"This zone is already being taken over!");
UnderAttack[AbandonedAp] = 1;
timer[playerid][AbandonedAp] = SetTimerEx("SetZone",30000,false,"i", playerid);
SendClientMessage(playerid, COLOR_YELLOW,"You're Capturing this zone! Wait here for 30 Seconds!");
iCP[playerid] = AbandonedAp;
}
}
return 1;
}
Posts: 3,351
Threads: 780
Joined: Jan 2010
Quote:
Originally Posted by HurtLocker
If you have that code inside your script its pretty reasonable to show the text "left cp".
|
That code is inside OnPlayerLeaveDynamicCP.
Posts: 3,351
Threads: 780
Joined: Jan 2010
Finally it works, thanks!