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

Help please?

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

PHP код:
forward OnPlayerEnterDynamicCP(playeridcheckpointid);
public 
OnPlayerEnterDynamicCP(playeridcheckpointid)
{
    if(
checkpointid == CP[CAPZONE])
    {
        if(
UnderAttack[CAPZONE] == 0)
        {
            if(
tCP[CAPZONE] != gTeam[playerid])
            {
                
CountVar[playerid][CAPZONE] = 25;
                
ActiveCAPZONE(playerid);
            } else return 
SendClientMessage(playeridCOLOR_RED,"*This zone is already captured by your team!");
        } else return 
CaptureZoneMessage(playerid2);
    }

Reply
#2

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

Reply
#3

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;
}
Reply
#4

Oh shit i forgot HAHAH XD thank you all! +1 REP
Quote:

return 1;

Reply
#5

Yes bro and the error tells you

Quote:

"OnPlayerEnterDynamicCP" should "return" a value

hahaa
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)