SA-MP Forums Archive
how to make 2 pickups - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: how to make 2 pickups (/showthread.php?tid=99983)



how to make 2 pickups - cubaton3 - 02.10.2009

hello how do i make 2 pickups i have this

pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == IraqHealthPickup)
    {
    SetPlayerHealth(playerid, 100.0);
    }
    return 1;
}
    if(pickupid == IraqArmourPickup)
    {
    SetPlayerArmour(playerid, 100.0);
    }
    return 1;
}
but it gives me 2 errors

C:\Users\Jonnie\Desktop\Server\gamemodes\USA.pwn(1 017) : error 010: invalid function or declaration
C:\Users\Jonnie\Desktop\Server\gamemodes\USA.pwn(1 021) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
2 Errors.



how to fix??


Re: how to make 2 pickups - Jefff - 02.10.2009

Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
	if(pickupid == IraqHealthPickup)
	{
	SetPlayerHealth(playerid, 100.0);
	}
  	if(pickupid == IraqArmourPickup)
	{
	SetPlayerArmour(playerid, 100.0);
	}
	return 1;
}



Re: how to make 2 pickups - cubaton3 - 02.10.2009

Quote:
Originally Posted by Jefff
Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
	if(pickupid == IraqHealthPickup)
	{
	SetPlayerHealth(playerid, 100.0);
	}
  	if(pickupid == IraqArmourPickup)
	{
	SetPlayerArmour(playerid, 100.0);
	}
	return 1;
}
thnx

worked


Re: how to make 2 pickups - ded - 02.10.2009

Sorry but ... why don't you just use CreatePickup?

CreatePickup(1240, X , Y, Z, virtualworld); // Health
CreatePickup(1242, X , Y, Z, virtualworld); // Armour