OnPlayerPickupPickup Problem
#1

Код:
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?

Reply
#2

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.
Reply
#3

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;
}
Reply
#4

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

Gonna try out the second one atm...
Reply
#5

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

Anyone...
Reply
#6

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.
Reply
#7

It is the right pickup ID.

Paytas, fix it then, im clueless
Reply
#8

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)