SA-MP Forums Archive
Weird simple thing - 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: Weird simple thing (/showthread.php?tid=130750)



Weird simple thing - shoru93 - 28.02.2010

{
beginmarker = AddStaticPickup(1318, 1 ,-1674.0707,2603.3926,81.3388, 0); //Begin Marker

AddStaticPickup(1242, 2,1878.4462,2127.0789,32.5571, 0); //rw armour
AddStaticPickup(1240, 2,1393.9027,2173.9392,9.7578, 0); //tdm health
AddStaticPickup(1242, 2,1393.7491,2170.0439,9.7578, 0); //tdm armour
AddStaticPickup(1242, 2, 2101.2607,2191.6355,13.4786, 0); //ww armour
AddStaticPickup(1240, 2,2101.2024,2189.1536,13.4786, 0); //ww health
AddStaticPickup(1240, 2,1878.5581,2142.9817,32.5571, 0); //rw health
return 1;
}
_________________________________________________
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == beginmarker) SendClientMessage(playerid,COLOR_YELLOW,"Hello!");
return 1;
}
_________________________________________________
It says "Hello!" when I enter in that first pickup (rw armour), why?


Re: Weird simple thing - Gozerr - 28.02.2010

Quote:
Originally Posted by shoru93
{
beginmarker = AddStaticPickup(1318, 1 ,-1674.0707,2603.3926,81.3388, 0); //Begin Marker

AddStaticPickup(1242, 2,1878.4462,2127.0789,32.5571, 0); //rw armour
AddStaticPickup(1240, 2,1393.9027,2173.9392,9.7578, 0); //tdm health
AddStaticPickup(1242, 2,1393.7491,2170.0439,9.7578, 0); //tdm armour
AddStaticPickup(1242, 2, 2101.2607,2191.6355,13.4786, 0); //ww armour
AddStaticPickup(1240, 2,2101.2024,2189.1536,13.4786, 0); //ww health
AddStaticPickup(1240, 2,1878.5581,2142.9817,32.5571, 0); //rw health
return 1;
}
_________________________________________________
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == beginmarker) SendClientMessage(playerid,COLOR_YELLOW,"Hello!");
return 1;
}
_________________________________________________
It says "Hello!" when I enter in that first pickup (rw armour), why?
What is your point here?
pawn Код:
beginmarker = AddStaticPickup(1318, 1 ,-1674.0707,2603.3926,81.3388, 0); //Begin Marker
if(pickupid == beginmarker) SendClientMessage(playerid,COLOR_YELLOW,"Hello!");
Do you want it to display Hello! for all pickups?

pawn Код:
new pickups[7];

pickups[0] = AddStaticPickup(1318, 1 ,-1674.0707,2603.3926,81.3388, 0); //Begin Marker
pickups[1] = AddStaticPickup(1242, 2,1878.4462,2127.0789,32.5571, 0); //rw armour
pickups[2] = AddStaticPickup(1240, 2,1393.9027,2173.9392,9.7578, 0); //tdm health
pickups[3] = AddStaticPickup(1242, 2,1393.7491,2170.0439,9.7578, 0); //tdm armour
pickups[4] = AddStaticPickup(1242, 2, 2101.2607,2191.6355,13.4786, 0); //ww armour
pickups[5] = AddStaticPickup(1240, 2,2101.2024,2189.1536,13.4786, 0); //ww health
pickups[6] = AddStaticPickup(1240, 2,1878.5581,2142.9817,32.5571, 0); //rw health

public OnPlayerPickUpPickup(playerid, pickupid)
{
for(new p = 0; p < 7; p++)
{
if(pickupid == pickups[p])
{
SendClientMessage(playerid,COLOR_YELLOW,"Hello!");
return 1;
}
}
return 1;
}
EDIT:
Oops, read wrong.
Try this for the OnPlayerPickupPickup:

pawn Код:
if(pickupid == beginmarker)
{
SendClientMessage(playerid,COLOR_YELLOW,"Hello!");
}
return 1;
And try changing the mode of the first pickup to 23 or 19.


Re: Weird simple thing - Gozerr - 01.03.2010

Sorry, I made a mistake.
You should use CreatePickup, This return the PickupID, AddStaticPickup returns 1 or 0 for succes.


Re: Weird simple thing - aircombat - 01.03.2010

public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == beginmarker) { SendClientMessage(playerid,COLOR_YELLOW,"Hello!"); }
return 1;
}
________
LANDY