I need help (+REP for help)
#1

Hi i tried to fix this warning but i can't.
so i'm here to post a topic requesting for help

Код:
C:\Users\infogenie\Desktop\Zombies VS Humans V1.1\gamemodes\own.pwn(942) : warning 209: function "OnPlayerEnterCheckpoint" should return a value
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
here is the line :
Код:
public OnPlayerEnterCheckpoint(playerid)
{

    if(onCheck[playerid])
	{

	   GivePlayerMoney(playerid,5000);
	   DisablePlayerCheckpoint(playerid);
	   onCheck[playerid] = false;
	   SetPlayerPos(playerid,2024.8163,1344.3187,10.8203);
	   SetPlayerFacingAngle(playerid,10.8203);
	   SetPlayerColor(playerid,GREEN);
       return 1;
	}

}
line 941 is the last "}" of the lines
Reply
#2

PHP код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(
onCheck[playerid])
    {
       
GivePlayerMoney(playerid,5000);
       
DisablePlayerCheckpoint(playerid);
       
onCheck[playerid] = false;
       
SetPlayerPos(playerid,2024.8163,1344.3187,10.8203);
       
SetPlayerFacingAngle(playerid,10.8203);
       
SetPlayerColor(playerid,GREEN);
       return 
1;
    }
    return 
1;

test that
Reply
#3

Hello!

PHP код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(
onCheck[playerid])
    {
       
GivePlayerMoney(playerid,5000);
       
DisablePlayerCheckpoint(playerid);
       
onCheck[playerid] = false;
       
SetPlayerPos(playerid,2024.8163,1344.3187,10.8203);
       
SetPlayerFacingAngle(playerid,10.8203);
       
SetPlayerColor(playerid,GREEN);
       return 
1;
    }
    return 
1;

A callback must return a value (mostly the value is 1).
Reply
#4

Код:
public OnPlayerEnterCheckpoint(playerid)
{

    if(onCheck[playerid])
	{

	   GivePlayerMoney(playerid,5000);
	   DisablePlayerCheckpoint(playerid);
	   onCheck[playerid] = false;
	   SetPlayerPos(playerid,2024.8163,1344.3187,10.8203);
	   SetPlayerFacingAngle(playerid,10.8203);
	   SetPlayerColor(playerid,GREEN);
	}
    return 1;
}
Reply
#5

Код:
public OnPlayerEnterCheckpoint(playerid)
{

    if(onCheck[playerid])
	{

	   GivePlayerMoney(playerid,5000);
	   DisablePlayerCheckpoint(playerid);
	   onCheck[playerid] = false;
	   SetPlayerPos(playerid,2024.8163,1344.3187,10.8203);
	   SetPlayerFacingAngle(playerid,10.8203);
	   SetPlayerColor(playerid,GREEN);
	}
        return 1; // swapped it from braces to here
}
Reply
#6

thanks all it's fixed. let me give you the reputations
oh shit i gave one last 24 hours. don't worry i will add all of you as friends then give you the reputations
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)