PDA

View Full Version : ERROR : warning 209: function "OnPlayerEnterDynamicCP" should return a value


jamesmith12
30/07/2015, 03:44 PM
Help please?

ERROR : warning 209: function "OnPlayerEnterDynamicCP" should return a value

forward OnPlayerEnterDynamicCP(playerid, checkpointid);
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
if(checkpointid == CP[CAPZONE])
{
if(UnderAttack[CAPZONE] == 0)
{
if(tCP[CAPZONE] != gTeam[playerid])
{
CountVar[playerid][CAPZONE] = 25;
ActiveCAPZONE(playerid);
} else return SendClientMessage(playerid, COLOR_RED,"*This zone is already captured by your team!");
} else return CaptureZoneMessage(playerid, 2);
}
}

youssefehab500
30/07/2015, 04:12 PM
forward OnPlayerEnterDynamicCP(playerid, checkpointid);
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
if(checkpointid == CP[CAPZONE])
{
if(UnderAttack[CAPZONE] == 0)
{
if(tCP[CAPZONE] != gTeam[playerid])
{
CountVar[playerid][CAPZONE] = 25;
ActiveCAPZONE(playerid);
} else return SendClientMessage(playerid, COLOR_RED,"*This zone is already captured by your team!");
} else return CaptureZoneMessage(playerid, 2);
}
return 1;
}

Fancy
30/07/2015, 04:15 PM
This will work:

forward OnPlayerEnterDynamicCP(playerid, checkpointid);
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
if(checkpointid == CP[CAPZONE])
{
if(UnderAttack[CAPZONE] == 0)
{
if(tCP[CAPZONE] != gTeam[playerid])
{
CountVar[playerid][CAPZONE] = 25;
ActiveCAPZONE(playerid);
} else return SendClientMessage(playerid, COLOR_RED,"*This zone is already captured by your team!");
} else return CaptureZoneMessage(playerid, 2);
}
return 1;
}

jamesmith12
30/07/2015, 04:19 PM
Oh shit i forgot HAHAH XD thank you all! +1 REP return 1;

Hemeei
30/07/2015, 04:23 PM
Yes bro and the error tells you

"OnPlayerEnterDynamicCP" should "return" a value

hahaa