Pickup help? - 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: Pickup help? (
/showthread.php?tid=140645)
Pickup help? -
ruckfules99 - 09.04.2010
I'm trying to add weapon pickups into my GM that give a certain amount of Ammo... But it's not working.
Here is what i tried.
Код:
new Sawnoff;
new Armour;
new Health;
new Tec9;
Код:
Sawnoff = CreatePickup(350, 2, -1043.9336,1094.0066,1346.3627, -1); //sawnoff
Armour = CreatePickup(1240, 2, -1038.3934,1025.3640,1343.3010, -1); //health
Health = CreatePickup(1242, 2, -1067.4795,1088.3970,1346.5259, -1); //armour
Tec9 = CreatePickup(372, 2, -1018.7241,1062.9752,1343.0780, -1); //tec9
Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == Armour)
{
SetPlayerArmour(playerid, 100.0);
}
else if(pickupid == Sawnoff)
{
GivePlayerWeapon(playerid,26,500);
}
else if(pickupid == Tec9)
{
GivePlayerWeapon(playerid,32,500);
}
else if(pickupid == Health)
{
SetPlayerHealth(playerid, 100);
}
return 1;
}
According to the wiki guide, this should work. I'm not sure why it doesn't?
So i read closely and this is what it says: "Some pickups such as health, armour and weapons are internally coded to work automatically, so there is no need to do anything under OnPlayerPickUpPickup. "
I know there is a way of doing this even though they are internally coded. because i have seen it on many servers.
Re: Pickup help? -
Naxix - 09.04.2010
What's wrong with these codes? errors? not working`?
Re: Pickup help? -
ruckfules99 - 09.04.2010
No errors.
No warnings.
It's all good. Pickup spawns, but the pickup does not give the 500 ammo that it should.