return 0/1; any difference?
#1

Hey,
Is there any difference if I return 1 or return 0 at (let's say) callback OnPlayerPickupPickUp?
Like:
[pawn]
public OnPlayerPickUpPickup(playerid,pickupid)
{
if(pickupid == SomePickup)
{

}

if(pickupid == AnotherPickup)
{

}
return 0/1; (as well as here, at the very end of callback?)
}
Reply
#2

pawn Код:
if(pickupid == SomePickup)
{
// Depending on what code goes here, yes.
return 0/1; //does it makes any difference here, if I return 0 or return 1?)
}
Reply
#3

Let's say OnPlayerCommandText
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  new pName[MAX_PLAYER_NAME];
  GetPlayerName(playerid, pName, sizeof(pName));
  
  printf("Command: %s: %s" ,pName, cmdtext);// Prints for example: Command: [NWA]Hannes: /kickme
  return 0/1; //If you return 0, it will only print for commands in this script. If you return 1, it will print for all scripts that uses commands.
}
Reply
#4

Ok, but how about OnPlayerPickupPickUp?
Reply
#5

Quote:
Originally Posted by SiJ
Ok, but how about OnPlayerPickupPickUp?
If we take this for example:
Код:
OnPlayerPickupPickup(playerid, pickupid)
{
  SetPlayerArmour(playerid, 100);
  GameTextForPlayer(playerid, "~b~~h~~h~You got armour!", 3000, 3);
  return 0/1;// Returning 0 Only gives armour for pickups in this script. Returning 1 gives armour for pickups in all scripts on server.
}
Reply
#6

Quote:
Originally Posted by [NWA
Hannes ]
Quote:
Originally Posted by SiJ
Ok, but how about OnPlayerPickupPickUp?
If we take this for example:
Код:
OnPlayerPickupPickup(playerid, pickupid)
{
  SetPlayerArmour(playerid, 100);
  GameTextForPlayer(playerid, "~b~~h~~h~You got armour!", 3000, 3);
  return 0/1;// Returning 0 Only gives armour for pickups in this script. Returning 1 gives armour for pickups in all scripts on server.
}
Ok, thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)