09.04.2010, 22:28
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.
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.
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; }
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.