Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Plugin check function
- PLUGIN_FUNCTION ePickup_check(AMX* amx, cell* params)
- {
- // begin:
- for (int i = 0; i < countpickups; i++)
- if (Pickup[i].pID == params[2])
- {
- cell onpick = 0;
- do
- {
- int time = 400000000;
- while (time)
- --time;
- int idx;
- int func = amx_FindPublic(amx, "GetPosit", &idx);
- if (func != AMX_ERR_NONE)
- {
- logprintf("\n[ePickup_check] ERROR %i\n", func);
- return 0;
- }
- amx_Push(amx, amx_ftoc(Pickup[i].posZ));
- amx_Push(amx, amx_ftoc(Pickup[i].posY));
- amx_Push(amx, amx_ftoc(Pickup[i].posX));
- // amx_Push(amx, amx_ftoc(PickupRange));
- amx_Push(amx, params[1]);
- amx_Exec(amx, &onpick, idx);
- // logprintf("onpick = %i", onpick);
- if (!onpick)
- {
- func = amx_FindPublic(amx, "OnPlayerPickupExit", &idx);
- if (func != AMX_ERR_NONE)
- return 0;
- amx_Push(amx, params[2]);
- amx_Push(amx, params[1]);
- amx_Exec(amx, NULL, idx);
- // return 1;
- }
- } while (onpick);
- // goto begin;
- logprintf("onpick = %i", onpick);
- }
- return 1;
- }
- // PAWN include file
- forward GetPosit(playerid, Float:pps_X, Float:pps_Y, Float:pps_Z);
- public GetPosit(playerid, Float:pps_X, Float:pps_Y, Float:pps_Z)
- return IsPlayerInRangeOfPoint(playerid, 1.4, pps_X, pps_Y, pps_Z);
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- EPKP_Hook_OnPlayerPickUpPickup(playerid, pickupid);
- #if defined EPKP_OnPlayerPickUpPickup
- return EPKP_OnPlayerPickUpPickup(playerid, pickupid);
- #else
- return 1;
- #endif
- }
- #if defined _ALS_OnPlayerPickUpPickup
- #undef OnPlayerPickUpPickup
- #else
- #define _ALS_OnPlayerPickUpPickup
- #endif
- #define OnPlayerPickUpPickup EPKP_OnPlayerPickUpPickup
- #if defined EPKP_OnPlayerPickUpPickup
- forward EPKP_OnPlayerPickUpPickup(playerid, pickupid);
- #endif
Advertisement
Add Comment
Please, Sign In to add comment