Das Erstellen der Pickups funktioniert.
Lediglich das "Bekommen" der Waffe nicht. Wenn ich durch das Pickup laufe passiert einfach nichts.
stock CreateWeaponPickup(id, weaponid, ammo, type, Float:px, Float:py, Float:pz, world = 0, playerid)
{
if(weaponid == 0) return SendClientMessage(playerid,COLOR_GREY,"Es gibt kein Weaponpickup für die Faust.");
if(weaponid == 19 || weaponid == 20 || weaponid == 21) return SendClientMessage(playerid,COLOR_GREY,"Diese Waffen existieren nicht.");
else if(weaponid == 1) return WeaponData[id][wID]=CreatePickup(331, type, px, py, pz, world);
else if(weaponid == 2) return WeaponData[id][wID]=CreatePickup(333, type, px, py, pz, world);
else if(weaponid == 3) return WeaponData[id][wID]=CreatePickup(334, type, px, py, pz, world);
else if(weaponid == 4) return WeaponData[id][wID]=CreatePickup(335, type, px, py, pz, world);
else if(weaponid == 5) return WeaponData[id][wID]=CreatePickup(336, type, px, py, pz, world);
else if(weaponid == 6) return WeaponData[id][wID]=CreatePickup(337, type, px, py, pz, world);
else if(weaponid == 7) return WeaponData[id][wID]=CreatePickup(338, type, px, py, pz, world);
else if(weaponid == 8) return WeaponData[id][wID]=CreatePickup(339, type, px, py, pz, world);
else if(weaponid == 9) return WeaponData[id][wID]=CreatePickup(341, type, px, py, pz, world);
else if(weaponid == 10) return WeaponData[id][wID]=CreatePickup(321, type, px, py, pz, world);
else if(weaponid == 11) return WeaponData[id][wID]=CreatePickup(322, type, px, py, pz, world);
else if(weaponid == 12) return WeaponData[id][wID]=CreatePickup(323, type, px, py, pz, world);
else if(weaponid == 13) return WeaponData[id][wID]=CreatePickup(324, type, px, py, pz, world);
else if(weaponid == 14) return WeaponData[id][wID]=CreatePickup(325, type, px, py, pz, world);
else if(weaponid == 15) return WeaponData[id][wID]=CreatePickup(326, type, px, py, pz, world);
else if(weaponid == 16) return WeaponData[id][wID]=CreatePickup(342, type, px, py, pz, world);
else if(weaponid == 17) return WeaponData[id][wID]=CreatePickup(343, type, px, py, pz, world);
else if(weaponid == 18) return WeaponData[id][wID]=CreatePickup(344, type, px, py, pz, world);
else if(weaponid == 22) return WeaponData[id][wID]=CreatePickup(346, type, px, py, pz, world);
else if(weaponid == 23) return WeaponData[id][wID]=CreatePickup(347, type, px, py, pz, world);
else if(weaponid == 24) return WeaponData[id][wID]=CreatePickup(348, type, px, py, pz, world);
else if(weaponid == 25) return WeaponData[id][wID]=CreatePickup(349, type, px, py, pz, world);
else if(weaponid == 26) return WeaponData[id][wID]=CreatePickup(350, type, px, py, pz, world);
else if(weaponid == 27) return WeaponData[id][wID]=CreatePickup(351, type, px, py, pz, world);
else if(weaponid == 28) return WeaponData[id][wID]=CreatePickup(352, type, px, py, pz, world);
else if(weaponid == 29) return WeaponData[id][wID]=CreatePickup(353, type, px, py, pz, world);
else if(weaponid == 30) return WeaponData[id][wID]=CreatePickup(355, type, px, py, pz, world);
else if(weaponid == 31) return WeaponData[id][wID]=CreatePickup(356, type, px, py, pz, world);
else if(weaponid == 32) return WeaponData[id][wID]=CreatePickup(372, type, px, py, pz, world);
else if(weaponid == 33) return WeaponData[id][wID]=CreatePickup(357, type, px, py, pz, world);
else if(weaponid == 34) return WeaponData[id][wID]=CreatePickup(358, type, px, py, pz, world);
else if(weaponid == 35) return WeaponData[id][wID]=CreatePickup(359, type, px, py, pz, world);
else if(weaponid == 36) return WeaponData[id][wID]=CreatePickup(360, type, px, py, pz, world);
else if(weaponid == 37) return WeaponData[id][wID]=CreatePickup(361, type, px, py, pz, world);
else if(weaponid == 38) return WeaponData[id][wID]=CreatePickup(362, type, px, py, pz, world);
else if(weaponid == 39) return WeaponData[id][wID]=CreatePickup(363, type, px, py, pz, world);
else if(weaponid == 40) return WeaponData[id][wID]=CreatePickup(364, type, px, py, pz, world);
else if(weaponid == 41) return WeaponData[id][wID]=CreatePickup(365, type, px, py, pz, world);
else if(weaponid == 42) return WeaponData[id][wID]=CreatePickup(366, type, px, py, pz, world);
else if(weaponid == 43) return WeaponData[id][wID]=CreatePickup(367, type, px, py, pz, world);
else if(weaponid == 44) return WeaponData[id][wID]=CreatePickup(368, type, px, py, pz, world);
else if(weaponid == 45) return WeaponData[id][wID]=CreatePickup(369, type, px, py, pz, world);
else if(weaponid == 46) return WeaponData[id][wID]=CreatePickup(371, type, px, py, pz, world);
WeaponData[id][weapon] = weaponid;
WeaponData[id][ammos] = ammo;
WeaponData[id][created] = 1;
WeaponData[id][wX] = px;
WeaponData[id][wY] = py;
WeaponData[id][wZ] = pz;
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
for(new i = 0; i < MAX_W_PICKUP; i++)
{
if(pickupid == WeaponData[i][wID])
{
if(WeaponData[i][weapon] < 0 || WeaponData[i][weapon] > 47)
{
CallLocalFunction("OnPlayerPickUpWeaponPickup", "ii", playerid, WeaponData[i][wID]);
GivePlayerServerWeapon(playerid, WeaponData[i][weapon], WeaponData[i][ammos]);
return 1;
}
}
}
return 1;
}
Alles anzeigen