[SOLVED]Help with OnPlayerPickupPickup
#1

Hi, I am having a problem with this Pickup stuff.

I have the pickups clearly added, but my problem is this, When I pickup a pickup, it always Splashes "You get 50k Dollars" instead of something else. For example, if the player picks up the armour pickup, he Must get the Message : "You got some armour, go own some noobs" But instead he gets the Message "You got 50k dollars!" and receives the armour +50k dollars, which shouldn't happen.

This is the code

Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
	if (pickup == pickupSaveDisk)
	{
	  GivePlayerMoney(playerid, 50000);
		GameTextForPlayer(playerid, "~g~You got 50k Dollars !", 3500, 0);
		return 1;
	}
	else if (pickup == pickupDollar)
	{
	  GivePlayerMoney(playerid, 100000);
	  GameTextForPlayer(playerid, "~g~You got 100k Dollars !", 3500, 0);
	  return 1;
	}
	else if (pickup == pickupArmour)
	{
		SetPlayerArmour(playerid, 100.0);
		GameTextForPlayer(playerid, "~b~~h~~h~You got armour ! Go own some noobs !", 3500, 0);
		return 1;
	}
	else if (pickup == pickupHealth)
	{
		SetPlayerHealth(playerid, 100.0);
		GameTextForPlayer(playerid, "~r~~h~You have been healed !", 3500, 0);
		return 1;
	}
	return 1;
}
Reply
#2

Can you show how you added the pickup itself?
Reply
#3

Uhh, sure. I followed the tutorial on SA:MP wiki for the pickups.

Код:
AddStaticPickup(1277, 2, -2197.9531,2322.2080,4.9844);
	AddStaticPickup(1274, 2, -2257.5752,2275.1821,4.9844);
	AddStaticPickup(1242, 2, -2292.2000,2229.9719,4.9822);
	AddStaticPickup(1240, 2, -2295.0957,2230.3643,4.9822);
And that is under OnGameModeInit(); Is that what you mean?

Otherwise I have these

Код:
new pickup;
new pickupSaveDisk;
new pickupDollar;
new pickupArmour;
new pickupHealth;
Reply
#4

you have to define each pickup like this
pawn Код:
pickupSaveDisk = AddStaticPickup(1277, 2, -2197.9531,2322.2080,4.9844);
  pickupDollar = AddStaticPickup(1274, 2, -2257.5752,2275.1821,4.9844);
Reply
#5

pickup id's in 02x are buggy. This is a known issue.
Reply
#6

Quote:
Originally Posted by ĸнelιғaтι
you have to define each pickup like this
pawn Код:
pickupSaveDisk = AddStaticPickup(1277, 2, -2197.9531,2322.2080,4.9844);
  pickupDollar = AddStaticPickup(1274, 2, -2257.5752,2275.1821,4.9844);
Where would I go about adding this?
Quote:
Originally Posted by kaisersouse
pickup id's in 02x are buggy. This is a known issue.
Hmm, I never knew that, but I hope maybe in 0.3 there will be a few fixes towards this issue
Reply
#7

Use AddStaticPickup doesn't even return its ID...


Quote:

# AddStaticPickup - Doesn't return an id
# CreatePickup - Pickup ids are often different for different players. I presume it is a problem with keeping track of them and assigning ids for players. This affects OnPlayerPickUpPickup and DestroyPickup as they will be used with different pickups for players.

https://sampwiki.blast.hk/wiki/Bugs
Reply
#8

Quote:
Originally Posted by Hiitch[WS
- WestSide Servers ]
Quote:
Originally Posted by ĸнelιғaтι
you have to define each pickup like this
pawn Код:
pickupSaveDisk = AddStaticPickup(1277, 2, -2197.9531,2322.2080,4.9844);
  pickupDollar = AddStaticPickup(1274, 2, -2257.5752,2275.1821,4.9844);
Where would I go about adding this?
Quote:
Originally Posted by kaisersouse
pickup id's in 02x are buggy. This is a known issue.
this goes under OnGameModeInit

pawn Код:
pickupSaveDisk = AddStaticPickup(1277, 2, -2197.9531,2322.2080,4.9844);
  pickupDollar = AddStaticPickup(1274, 2, -2257.5752,2275.1821,4.9844);

Hmm, I never knew that, but I hope maybe in 0.3 there will be a few fixes towards this issue
Reply
#9

Код:
if (pickup == pickupSaveDisk)
	{
Isnt that supposed to be

Код:
 if (pickupid == pickupSaveDisk)
	{
Reply
#10

Quote:
Originally Posted by timmehhh
Код:
if (pickup == pickupSaveDisk)
	{
Isnt that supposed to be

Код:
 if (pickupid == pickupSaveDisk)
	{
I tried using (pickupid == pickupSaveDisk)

But it didnt work, now what happens is, if a Player walks into the Pickup, only 1 of them shows the splash, and the rest of them dont... Is there any way to fix this?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)