Return 0; and return 1;
#7

Basically, you can think of it this way, 1 = success/true, 0 = failed/false

Examples:
pawn Код:
MyGateIsOpen = 1; //It is open
if(MyGateIsOpen == 1)
{
   CloseGate;
   MyGateIsOpen = 0; //It is now closed or false (without the use of booleans)
//...
pawn Код:
public OnPlayerSpawn(playerid)
{
    return 1; //The player has spawned
}

public OnPlayerRequestClass(playerid, classid)
{
    if(classid == 12) return 0; //Do not spawn player, player spawned with class = false
    return 1; //Else let them spawn by returning 1
}
I don't know of any existing tutorials about returning values, based around 0 and 1, but keep searching if you need help with it. Or check out the SA-MP Wiki.
Reply


Messages In This Thread
Return 0; and return 1; - by XProtocol - 28.12.2012, 06:39
Re: Return 0; and return 1; - by rockerman - 28.12.2012, 06:47
Re: Return 0; and return 1; - by XProtocol - 28.12.2012, 06:52
Re: Return 0; and return 1; - by Grim_ - 28.12.2012, 06:54
Re: Return 0; and return 1; - by rockerman - 28.12.2012, 07:01
Re: Return 0; and return 1; - by XProtocol - 28.12.2012, 09:14
Re: Return 0; and return 1; - by Threshold - 28.12.2012, 09:17
Re: Return 0; and return 1; - by tyler12 - 28.12.2012, 09:21
Re: Return 0; and return 1; - by XProtocol - 28.12.2012, 10:12

Forum Jump:


Users browsing this thread: 2 Guest(s)