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!"); }
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!");
}
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;
}
pawn Код:
|
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.
|
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;
}