Pickup problem
#1

Ok... First, I show the script:

Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == hiddenpackage) created[playerid] = 0;
    if(pickupid == hiddenpackage) SendClientMessage(playerid, yellow, "Congratulations! You have found a Hidden Package!");
    if(pickupid == hiddenpackage) GameTextForAll("~r~Hidden Package ~b~has been found!", 5000, 4);
    if(pickupid == hiddenpackage) DestroyPickup(hiddenpackage);
    if(pickupid == infopickup1) SendClientMessage(playerid,yellow,"Text 1");
    if(pickupid == infopickup2) SendClientMessage(playerid,yellow,"Text 2");
    if(pickupid == infopickup3) SendClientMessage(playerid,yellow,"Text 3");   
    if(pickupid == flowers) SendClientMessage(playerid,yellow,"You have found some flowers!");
}
When I pick up "infopickup1", there appears Text 1 text, and that what is in "hidden package". When I pick up "hidden package", there appears that what is in "hiddenpackage" and "infopickup1". With other is ok. Can anyone fix this?
Reply
#2

pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == hiddenpackage) created[playerid] = 0 && SendClientMessage(playerid, yellow, "Congratulations! You have found a Hidden Package!") && GameTextForAll("~r~Hidden Package ~b~has been found!", 5000, 4) && DestroyPickup(hiddenpackage);
    if(pickupid == infopickup1) SendClientMessage(playerid,yellow,"Text 1");
    if(pickupid == infopickup2) SendClientMessage(playerid,yellow,"Text 2");
    if(pickupid == infopickup3) SendClientMessage(playerid,yellow,"Text 3");  
    if(pickupid == flowers) SendClientMessage(playerid,yellow,"You have found some flowers!");
}
or that 2 pickups are too close to each other?
Reply
#3

I don't understand what the problem is. Could you try to explain it more clearly?

EDIT:
Try this:
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == hiddenpackage)
    {
        created[playerid] = 0;
        SendClientMessage(playerid, yellow, "Congratulations! You have found a Hidden Package!");
        GameTextForAll("~r~Hidden Package ~b~has been found!", 5000, 4);
        DestroyPickup(hiddenpackage);
    }
    else if(pickupid == infopickup1) SendClientMessage(playerid,yellow,"Text 1");
    else if(pickupid == infopickup2) SendClientMessage(playerid,yellow,"Text 2");
    else if(pickupid == infopickup3) SendClientMessage(playerid,yellow,"Text 3");
    else if(pickupid == flowers) SendClientMessage(playerid,yellow,"You have found some flowers!");

    return 1;
}
Reply
#4

Quote:
Originally Posted by HrvojeCro
Посмотреть сообщение
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == hiddenpackage) created[playerid] = 0 && SendClientMessage(playerid, yellow, "Congratulations! You have found a Hidden Package!") && GameTextForAll("~r~Hidden Package ~b~has been found!", 5000, 4) && DestroyPickup(hiddenpackage);
    if(pickupid == infopickup1) SendClientMessage(playerid,yellow,"Text 1");
    if(pickupid == infopickup2) SendClientMessage(playerid,yellow,"Text 2");
    if(pickupid == infopickup3) SendClientMessage(playerid,yellow,"Text 3");  
    if(pickupid == flowers) SendClientMessage(playerid,yellow,"You have found some flowers!");
}
or that 2 pickups are too close to each other?
Thanks, works better, but if I pick up the "hiddenpackage", no effect...
Reply
#5

Quote:
Originally Posted by Libra_PL
Посмотреть сообщение
Thanks, works better, but if I pick up the "hiddenpackage", no effect...
Try the code I posted instead. AND operator doesn't work like that.
Reply
#6

Quote:
Originally Posted by TheXIII
Посмотреть сообщение
Try the code I posted instead. AND operator doesn't work like that.
yea I fu***d that code lol
didnt check just wrote what was on my mind at first
EDIT:
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == hiddenpackage)
    {
        created[playerid] = 0;
        SendClientMessage(playerid, yellow, "Congratulations! You have found a Hidden Package!");
        GameTextForAll("~r~Hidden Package ~b~has been found!", 5000, 4);
        DestroyPickup(hiddenpackage);
    }
    else if(pickupid == infopickup1)
       {
               SendClientMessage(playerid,yellow,"Text 1");
       }
    else if(pickupid == infopickup2)
       {
               SendClientMessage(playerid,yellow,"Text 2");
       }
    else if(pickupid == infopickup3)
       {
              SendClientMessage(playerid,yellow,"Text 3");
       }
    else if(pickupid == flowers)
      {
             SendClientMessage(playerid,yellow,"You have found some flowers!");
      }
      return 1;
}
there use this
Reply
#7

Thanks guys. It works!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)