What should this return
#8

You need to set 'return true/false' only if you are using the value that you get from 'returns'.

Example:
pawn Код:
//Some stock: (It can be a callback too..)
stock DoSomethingTo(playerid)
{
    if(!IsPlayerConnected(playerid)) return false;

    SetPlayerBlaBla(...);
    SetPlayerOther(...);
    //...
   
    return true;
}

//In this case, the stock will return true after executing your functions
//and making changes to a player.
//If the player isn't connected, it returns false.


//Now, you can make use of the returned value:
if(!DoSomethingTo(targetplayer))  SendClientMessage(playerid, -1, "Sorry, the player isn't connected.");
else SendClientMessage(playerid, -1, "Changes has taken place successfully!");
Reply


Messages In This Thread
What should this return - by Snowman12 - 13.01.2012, 09:34
Re: What should this return - by Gh05t_ - 13.01.2012, 10:23
Re: What should this return - by Snowman12 - 13.01.2012, 10:29
Re: What should this return - by Gh05t_ - 13.01.2012, 10:37
Re: What should this return - by Gh05t_ - 13.01.2012, 10:58
Re: What should this return - by Snowman12 - 13.01.2012, 11:05
Re: What should this return - by Gh05t_ - 13.01.2012, 11:23
Re: What should this return - by iPLEOMAX - 13.01.2012, 11:35

Forum Jump:


Users browsing this thread: 1 Guest(s)