Code:
LootObjects[0] = CreateObject(356, 2384.59448, -1674.36279, 13.74557, 87.72005, -23.87996, 0.00000); //M4A1 LootObjects[1] = CreateObject(355, 2409.01392, -1673.93286, 12.65986, 87.36000, -16.68000, 0.00000); //AK47 LootObjects[2] = CreateObject(358, 2362.54614, -1644.61816, 12.61388, -101.64005, -18.41999, 0.00000); //Sniper Rifle LootObjects[3] = CreateObject(357, 2393.15576, -1647.44202, 12.58709, -94.92001, -69.59998, -58.37999); //Counry Rifle LootObjects[4] = CreateObject(349, 2326.31885, -1646.21326, 13.87297, -97.07997, -51.83994, -90.54002); //Shotgun LootObjects[5] = CreateObject(351, 2324.06274, -1646.22961, 13.86012, -94.55995, -61.14002, 0.00000); //Spas LootObjects[6] = CreateObject(346, 2328.17944, -1681.76965, 13.70912, 88.20000, 23.28000, 0.00000); //9mm pistol LootObjects[7] = CreateObject(347, 2413.82813, -1647.04639, 13.05190, -84.78008, -118.08011, 0.00000); //9mm silenced LootObjects[8] = CreateObject(348, 2306.93921, -1678.13745, 12.99543, 80.76003, 0.72000, 11.22000); //Desert Eagle |
Sorry for eventual bumping. I made myself objects and they won't let me pick them up. Even when being near them
|
//example
if(IsValidObject(LootObjects[0]) && IsPlayerInRangeOfPoint(playerid,2.0,2384.59448,-1674.36279,13.74557))
No problem man, did you increase the MAX_LOOTS? its default 100 but if you have more loot objects than 100 you need to increase it.
and you have to be sure you have this: pawn Code:
|
if(IsValidObject(LootObjects[0]) && IsPlayerInRangeOfPoint(playerid, 10.0, 233.95, 4106.39, 5.69)) { AddItem(playerid,"Beer Bottle", 1); SendClientMessage(playerid, -1, "* Beer bottle added to your inventory."); DestroyObject(LootObjects[0]); }
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if (newkeys & KEY_WALK) { ShowInventory(playerid); return 1; } if (newkeys & KEY_CROUCH) { if(IsValidObject(LootObjects[0]) && IsPlayerInRangeOfPoint(playerid, 10.0, 233.95, 4106.39, 5.69)) { AddItem(playerid,"Beer Bottle", 1); SendClientMessage(playerid, -1, "* Beer bottle added to your inventory."); DestroyObject(LootObjects[0]); } if(IsValidObject(LootObjects[1]) && IsPlayerInRangeOfPoint(playerid, 3.0, 233.95, 4106.39, 5.69)) { AddItem(playerid,"Pork Chop", 1); SendClientMessage(playerid, -1, "* Pork Chop added to your inventory."); DestroyObject(LootObjects[1]); } else { SendClientMessage(playerid, -1, "You are not near an object."); return 1; } } return 1; }
233.95, 4106.39, 5.69 //notice how your coords have less numbers (i have 5 numbers after the "." and you dont.
2393.15576, -1647.44202, 12.58709 //all 5 numbers behind the ".'
How would you go about dropping the objects when a player dies?
|