Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //native calling method for 4 native definitions (probably not working)
- namespace invoke {
- template<typename T, typename P1, typename P2, typename P3>
- void str_to_native(char native_str, P1 p0 = 0, P2 p1 = 0, P3 p2 = 0, P4 p3 = 0) {
- //to native def.
- *(T*)&NativeArg_s->argValues[NativeArg_s->argCount] = p0 |= p1 |= p2 |= p3;
- NativeArg_s->argCount++;
- //get to native address
- char to_addr[500];
- snprintf(to_addr, sizeof(to_addr), "0x016%p", &native_str); //0x%p <- use this
- ((void(*)(NativeArg_s*))to_addr)(&nativeArg);
- //stop invoking after using & returning arg
- R* res = (R*)&NativeArg_s->returnValue[0];
- return *(R*)res;
- break;
- }
- }
- for godmode: str_to_native("set_entity_invincible", str_to_native("player_ped_id"), 1); //lol
Advertisement
Add Comment
Please, Sign In to add comment