Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Attempt 1: Returns a random value each argument <- not usable
- cell GetPlayerPos(B_STREAM_VECTOR::iterator amx_it, cell playerid, float &x, float &y, float &z)
- {
- if((amx_it->hooked_natives&0x2) == 0) return 0;
- cell params[5] = {4, playerid, NULL, NULL, NULL}, ret = amx_it->GetPlayerPos(amx_it->amx_ptr, params), *addr[5];
- amx_GetAddr(amx_it->amx_ptr, params[2], &addr[0]);
- amx_GetAddr(amx_it->amx_ptr, params[3], &addr[1]);
- amx_GetAddr(amx_it->amx_ptr, params[4], &addr[2]);
- x = amx_ctof(*addr[0]);
- y = amx_ctof(*addr[1]);
- z = amx_ctof(*addr[2]);
- return ret;
- }
- // Attempt 2: Same as attempt 1 <- not usable
- cell GetPlayerPos(B_STREAM_VECTOR::iterator amx_it, cell playerid, float &x, float &y, float &z)
- {
- if((amx_it->hooked_natives&0x2) == 0) return 0;
- cell *params = new cell[5];
- CheckPtr((int)params);
- params[0] = 4;
- params[1] = playerid;
- cell ret = amx_it->GetPlayerPos(amx_it->amx_ptr, params), *addr[3];
- amx_GetAddr(amx_it->amx_ptr, params[2], &addr[0]);
- amx_GetAddr(amx_it->amx_ptr, params[3], &addr[1]);
- amx_GetAddr(amx_it->amx_ptr, params[4], &addr[2]);
- x = amx_ctof(*addr[0]);
- y = amx_ctof(*addr[1]);
- z = amx_ctof(*addr[2]);
- delete[] params;
- return ret;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement