SA-MP Forums Archive
OnPlayerPickupPickup Problem - 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: OnPlayerPickupPickup Problem (/showthread.php?tid=90283)



OnPlayerPickupPickup Problem - Memoryz - 07.08.2009

Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
  if(pickupid == mechanicjobtake)
	 			SendClientMessage(playerid, 0xFFC801C8, "Mechanic Job: Do /takejob to take this job!");
				PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
	return 1;
}
Okay, thats my code embedded into my GM, on compile, no errors or warnings!

Now, when I go to that pick-up, It doesn't send the message, it just playes the sound, so I know its a problem with the SendClientMessage, can anyone help me out here?




Re: OnPlayerPickupPickup Problem - paytas - 07.08.2009

This mean your not checking the right pickupid.

The sound plays, because it's outside of the if statement. As there is no brackets, only the first instruction (the SendClientMessage) is inside the if statement.


Re: OnPlayerPickupPickup Problem - Abernethy - 07.08.2009

pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
  if (pickupid == mechanicjobtake)
  {
    SendClientMessage(playerid, 0xFFC801C8, "Mechanic Job: Do /takejob to take this job!");
     PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  }
  return 1;
}
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
  if (pickupid == mechanicjobtake)
  {
  if (PlayerToPoint(3.00, playerid, YOUR_X, YOUR_Y, YOUR_Z))
  {
      SendClientMessage(playerid, 0xFFC801C8, "Mechanic Job: Do /takejob to take this job!");
      PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    }
  }
  return 1;
}



Re: OnPlayerPickupPickup Problem - Memoryz - 07.08.2009

Abernethy, the first one isnt working, doesnt send the message nor play the sound.

Gonna try out the second one atm...


Re: OnPlayerPickupPickup Problem - Memoryz - 07.08.2009

The second one doesnt work either, it plays the sound, but no message is sent....

Anyone...


Re: OnPlayerPickupPickup Problem - paytas - 07.08.2009

This mean your not checking the right pickupid.

The sound plays, because it's outside of the if statement. As there is no brackets, only the first instruction (the SendClientMessage) is inside the if statement.


Re: OnPlayerPickupPickup Problem - Memoryz - 07.08.2009

It is the right pickup ID.

Paytas, fix it then, im clueless


Re: OnPlayerPickupPickup Problem - paytas - 07.08.2009

No. If it was the right pickup you should recieve the message. But you don't.

Just test it:
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
  printf("pickupid: %d, mechanicjobtake: %d", pickupid, mechanicjobtake);
}
If this prints the same numbers then, i'm clueless too. f not, then find out why it isn't the right id.