SA-MP Forums Archive
Help with pickupid's - 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: Help with pickupid's (/showthread.php?tid=79352)



Help with pickupid's - Snyper - 27.05.2009

When I try to put this code in "OnPlayerPickupPickup":
Quote:

public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == P1 || P2 || P3 || P4 || P5 || P6 || P7 || P8 || P9 || P10 || P11 || P12 || P13 || P14 || P15 || P16 || P17 || P18 || P19 || P20 || P21 || P22 || P23 || P24 || P25 || P26 || P27 || P28 || P29 || P30 || P31 || P32 || P33 || P34 || P35)
{
new string[128];
Moneybag[playerid] += 1;
GameTextForPlayer(playerid, "You have found a~n~~r~Money Bag~w~ worth ~g~100$!", 5000, 5);
format(string, sizeof(string), "[INFO:] You have found %d/35 Money Bags. Keep searching!", Moneybag[playerid]);
SendClientMessage(playerid, YELLOW, string);
GivePlayerCash(playerid, 100);
}
else if(pickupid == P35)
{
if(Moneybag[playerid] == 34)
{
Moneybag[playerid] += 1;
GameTextForPlayer(playerid, "Congratulations, you have found the last ~r~Money Bag!", 5000, 5);
SendClientMessage(playerid, COLOR_GREEN, "You've been given 20000$ as a reward");
GivePlayerCash(playerid,20000);
}
}
return 1;
}

... it affects every single pickup in my game including the houses and info icons. How do I make it so the command affects only my moneybags?


Re: Help with pickupid's - GammerZ - 27.05.2009

you must put "Pickupid =.." in all the pickups ids

example

Код:
if(pickupid == P1 || pickupid == P2 || pickupid == P3 ||pickupid == P4 || pickupid == P5 || pickupid == P6 ||pickupid == P7 || pickupid == P8 ...
  {



Re: Help with pickupid's - Snyper - 27.05.2009

I wrote:
Quote:

if(pickupid == P1 ||pickupid == P2 ||pickupid == P3 ||pickupid == P4 ||pickupid == P5 ||pickupid == P6 ||pickupid == P7 ||pickupid == P8 ||pickupid == P9 ||pickupid == P10 ||pickupid == P11

Now it says:
Quote:

error 075: input line too long (after substitutions)

Edit: Nevermind, I did something completely else. It works now.


Re: Help with pickupid's - Snyper - 28.05.2009

I'm sorry for the double post but I'm still running into an issue with items.

Quote:

if(pickupid == P1)
{
new string[128];
Moneybag[playerid] += 1;
GameTextForPlayer(playerid, "You have found a~n~~r~Money Bag~w~ worth ~g~100$!", 5000, 5);
format(string, sizeof(string), "[INFO:] You have found %d/35 Money Bags. Keep searching!", Moneybag[playerid]);
SendClientMessage(playerid, YELLOW, string);
GivePlayerCash(playerid, 100);
return 1;
}
else if(pickupid == P2)
{
new string[128];
Moneybag[playerid] += 1;
GameTextForPlayer(playerid, "You have found a~n~~r~Money Bag~w~ worth ~g~100$!", 5000, 5);
format(string, sizeof(string), "[INFO:] You have found %d/35 Money Bags. Keep searching!", Moneybag[playerid]);
SendClientMessage(playerid, YELLOW, string);
GivePlayerCash(playerid, 100);
return 1;
}

... Which it repeats to 35. Now when I pickup mabye 2 or 3 of them, it makes all my other pickups (Houses, businesses) into moneybags too.

Can someone help?