25.09.2009, 16:59
why in some commands we have return 1 or return 0??
and how i can know when i need use them?>
tmx for anybody help
and how i can know when i need use them?>
tmx for anybody help
MyFunc(playerid)
{
//Code here
return 1;
}
public OnPlayerConnect(playerid)
{
if(MyFunc(playerid) == 1) //This is now 1 so statement is true
}
MyFunc(playerid)
{
//Code here
return 0;
}
public OnPlayerConnect(playerid)
{
if(MyFunc(playerid) == 1) //This is now 0 so statement is false
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/teleport", cmdtext, true, 9) == 0)
{
if(IsPlayerAdmin(playerid))
{
SetPlayerPos(playerid,0,0,0);
return 1;
}
else
return 0;
}
return 0;
}