SA-MP Forums Archive
Pickup Help!!! - 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)
+--- Thread: Pickup Help!!! (/showthread.php?tid=352522)



Pickup Help!!! - Kerlan - 20.06.2012

I created a pickup and i'm not seeing it. (my positions are correct) XYZ coord

here's my code:
Код:
new healthpickup; 


public OnFilterScriptInit()
{

healthpickup = CreatePickup(1242, 23, 2240.7236,2449.3508,10.8203, 1); 
printf("healthpickup = %d", healthpickup);


public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == healthpickup)
    {
        GameTextForPlayer(playerid, "~w~Type ~r~/enter~w~ to go inside", 5000, 5);
       return 1;
    }
    return 1;
}
pickup won't load. :/


Re: Pickup Help!!! - Mr.1337 - 20.06.2012

pawn Код:
newhealthpickup;
There's no space between the new and the health pickup.

try this

pawn Код:
new healthpickup;



Re: Pickup Help!!! - Skaizo - 20.06.2012

pawn Код:
new healthpickup;


public OnFilterScriptInit()
{
   healthpickup = CreatePickup(1242, 23, 2240.7236,2449.3508,10.8203, 1);
   printf("healthpickup = %d", healthpickup);
   return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == healthpickup)
    {
        GameTextForPlayer(playerid, "~w~Type ~r~/enter~w~ to go inside", 5000, 5);
    }
    return 1;
}



Re: Pickup Help!!! - Kerlan - 20.06.2012

Quote:
Originally Posted by Skaizo
Посмотреть сообщение
pawn Код:
new healthpickup;


public OnFilterScriptInit()
{
   healthpickup = CreatePickup(1242, 23, 2240.7236,2449.3508,10.8203, 1);
   printf("healthpickup = %d", healthpickup);
   return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == healthpickup)
    {
        GameTextForPlayer(playerid, "~w~Type ~r~/enter~w~ to go inside", 5000, 5);
    }
    return 1;
}
Thanks i know it was a typing error.. that's not the issue. The problem still persist. Thanks anyway


Re: Pickup Help!!! - [MM]RoXoR[FS] - 20.06.2012

Try changing virtual world to -1


Re: Pickup Help!!! - [MM]RoXoR[FS] - 20.06.2012

Quote:
Originally Posted by ******
Посмотреть сообщение
This implies you didn't copy and paste the code, but instead rewrote it. That's never a good idea because sometimes the original may be wrong but the rewritten version on the forums is actually correct, leading people to be unable to find the bug at all.
****** believe in copy paste :O :O


Re: Pickup Help!!! - Kerlan - 20.06.2012

Quote:
Originally Posted by ******
Посмотреть сообщение
This implies you didn't copy and paste the code, but instead rewrote it. That's never a good idea because sometimes the original may be wrong but the rewritten version on the forums is actually correct, leading people to be unable to find the bug at all.
Thanks here the code:


Код:
new healthpickup;


public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" blah blah blah LOADED!!!!");
	print("--------------------------------------\n");

	healthpickup = CreatePickup(1242, 23, 2240.7236,2449.3508,10.8203, 1); 
	printf("healthpickup = %d", healthpickup);

	return 1;
}


public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == healthpickup)
    {
        GameTextForPlayer(playerid, "~w~Type ~r~/enter~w~ to go inside", 5000, 5);
        return 1;
    }
    return 1;
}



Re: Pickup Help!!! - mickos - 20.06.2012

The easy way is: AddStaticPickup(1242, 2, x.y.z);

And the number 2 after 1242 can u change in what u want

https://sampwiki.blast.hk/wiki/PickupTypes