// Float:ns_get_weap_dmg(WeaponID) static cell AMX_NATIVE_CALL ns_get_weapon_dmg(AMX *amx, cell *params) { CreateNonPlayerEdict(amx,params[1]); if (Entity->pvPrivateData == NULL || Entity->free) { return 0; } REAL ret=get_private_f(Entity,MAKE_OFFSET(WEAPDMG)); return amx_ftoc2(ret); }
cell Call_Float_Void(AMX *amx, cell *params) { SETUP(1); #if defined(_WIN32) float ret=reinterpret_cast<float (__fastcall *)(void*, int)>(__func)(pv, 0); #elif defined(__linux__) || defined(__APPLE__) float ret=reinterpret_cast<float (*)(void *)>(__func)(pv); #endif *MF_GetAmxAddr(amx, params[3])=amx_ftoc2(ret); return 1; }
cell Call_Float_Float(AMX *amx, cell *params) { SETUP(2); float f3=amx_ctof2(*MF_GetAmxAddr(amx, params[3])); #if defined(_WIN32) float ret=reinterpret_cast<float (__fastcall *)(void *, int, float)>(__func)(pv, 0, f3); #elif defined(__linux__) || defined(__APPLE__) float ret=reinterpret_cast<float (*)(void *, float)>(__func)(pv, f3); #endif *MF_GetAmxAddr(amx, params[4])=amx_ftoc2(ret); return 1; }
cell Call_Float_Float_Cbase(AMX* amx, cell* params) { SETUP(3); float f3=amx_ctof2(*MF_GetAmxAddr(amx, params[3])); int id4=*MF_GetAmxAddr(amx, params[4]); CHECK_ENTITY(id4); void *p4 = IndexToPrivate(id4); #if defined(_WIN32) float ret = reinterpret_cast<float(__fastcall *)(void*, int, float, void*)>(__func)(pv, 0, f3, p4); #elif defined(__linux__) || defined(__APPLE__) float ret = reinterpret_cast<float (*)(void*, float, void*)>(__func)(pv, f3, p4); #endif *MF_GetAmxAddr(amx, params[5]) = amx_ftoc2(ret); return 1; }
cell Call_Int_pVector_pVector_Cbase_pFloat(AMX *amx, cell *params) { SETUP(4); Vector v3; Vector v4; float *fl3=(float *)MF_GetAmxAddr(amx, params[3]); float *fl4=(float *)MF_GetAmxAddr(amx, params[4]); v3.x=fl3[0]; v3.y=fl3[1]; v3.z=fl3[2]; v4.x=fl4[0]; v4.y=fl4[1]; v4.z=fl4[2]; int id5=*MF_GetAmxAddr(amx, params[5]); CHECK_ENTITY(id5); void *p5=IndexToPrivate(id5); float f6; #if defined(_WIN32) int ret=reinterpret_cast<int (__fastcall *)(void *, int, Vector*, Vector*, void*, float*)>(__func)(pv, 0, &v3, &v4, p5, &f6); #elif defined(__linux__) || defined(__APPLE__) int ret=reinterpret_cast<int (*)(void *, Vector*, Vector*, void*, float*)>(__func)(pv, &v3, &v4, p5, &f6); #endif fl3[0]=v3.x; fl3[1]=v3.y; fl3[2]=v3.z; fl4[0]=v4.x; fl4[1]=v4.y; fl4[2]=v4.z; *MF_GetAmxAddr(amx, params[6]) = amx_ftoc2(f6); return ret; }
// Float:ns_get_exp(Player) static cell AMX_NATIVE_CALL ns_get_exp(AMX *amx, cell *params) { if (!GameMan.IsCombat()) { return 0; } CreatePlayerPointer(amx,params[1]); if (!player->IsConnected()) { return 0; } if (!player->HasPrivateData()) { return 0; } return amx_ftoc2(get_private_f(player->GetEdict(),MAKE_OFFSET(EXP))); }
// Float:ns_add_res(Player,Float:res) static cell AMX_NATIVE_CALL ns_add_res(AMX *amx, cell *params) { if (GameMan.IsCombat()) { return 0; } CreatePlayerPointer(amx,params[1]); if (!player->IsConnected()) { return 0; } if (!player->HasPrivateData()) { return 0; } return amx_ftoc2(inc_private_f(player->GetEdict(),MAKE_OFFSET(RESOURCES),amx_ctof2(params[2]),0.0,100.0)); }