Difference in returns
#1

Which the difference between


pawn Код:
forward Test(playerid);
public Test(playerid)
{
    SendClientMessage(playerid, ~1, "test");
    return 1;
}
and

pawn Код:
forward Test(playerid);
public Test(playerid)
{
    SendClientMessage(playerid, ~1, "test");
}
?


The same case in plain functions:


pawn Код:
Test(playerid)
{
    SendClientMessage(playerid, ~1, "test");
    return 1;
}
and

pawn Код:
Test(playerid)
{
    SendClientMessage(playerid, ~1, "test");
}

Which is the difference?

I already know that if I need a value I can return it with return but in void functions, in pawn doesn't exist void so, in void functions that executes 1 time and don't need to return any value.

like

Case with callback:

pawn Код:
public OnPlayerConnect(playerid)
{
    SetTimerEx("Test", 1000, false, "d", playerid);
    return 1;
}

Case with plain function:

pawn Код:
public OnPlayerConnect(playerid)
{
    Test(playerid);
    return 1;
}

I need to return a value in the Test function in both cases?


Thanks and respond only people that have understanded my doubt and have experience with this cases to avoid confusions.


Thanks again.
Reply


Messages In This Thread
Difference in returns - by JavoDiaz - 09.01.2013, 11:57
Re: Difference in returns - by u3ber - 09.01.2013, 12:16
Re: Difference in returns - by JavoDiaz - 09.01.2013, 12:24
Re: Difference in returns - by JavoDiaz - 09.01.2013, 12:40
Re: Difference in returns - by JavoDiaz - 09.01.2013, 12:48
Re: Difference in returns - by u3ber - 09.01.2013, 12:48

Forum Jump:


Users browsing this thread: 1 Guest(s)