Senior Member
Join Date: Jan 2010
Location: Warsaw, Poland
|
12-18-2012
, 16:12
Re: Quakemod in progress!
|
#104
|
Well as I said, I had to recode it. Haven't really done it yet but here is some code of rocket launcher you might want (because I haven't done any other weps yet, lol)
Rocket launcher
PHP Code:
public fwTouchRocket(iEnt, iCos){ if(!pev_valid(iEnt)) return; new Float:fOrigin[0x3]; pev(iEnt, pev_origin, fOrigin); message_begin(MSG_BROADCAST, SVC_TEMPENTITY); write_byte(TE_EXPLOSION); engfunc(EngFunc_WriteCoord, fOrigin[0x0]); engfunc(EngFunc_WriteCoord, fOrigin[0x1]); engfunc(EngFunc_WriteCoord, fOrigin[0x2]); write_short(g_sSprites[0x0]); write_byte(0x10); write_byte(0x5); write_byte(0x0); message_end(); new iAttacker = pev(iEnt, pev_owner); new iEntities[0x21]; new iPlayersFound = find_sphere_class(iEnt, "player", 145.0, iEntities, 0x20); new iDamage; new Float:fPlayerOrigin[0x3]; for(new i ; i < iPlayersFound ; i++){ if(is_user_alive(iEntities[i])){ pev(iEntities[i], pev_origin, fPlayerOrigin); iDamage = _quakefunc_damageByRange(fm_entity_range(iEntities[i], iEnt), 30.0, 2.0, 0.2); if(iAttacker==iEntities[i]) iDamage = floatround(iDamage*0.32); message_begin(MSG_BROADCAST, SVC_TEMPENTITY); write_byte(TE_BLOODSPRITE); engfunc(EngFunc_WriteCoord, fPlayerOrigin[0x0]); engfunc(EngFunc_WriteCoord, fPlayerOrigin[0x1]); engfunc(EngFunc_WriteCoord, fPlayerOrigin[0x2]); write_short(g_sSprites[0x3]); write_short(g_sSprites[0x2]); write_byte(0xF8); write_byte(0x10); message_end(); xs_vec_sub(fPlayerOrigin, fOrigin, fPlayerOrigin); fPlayerOrigin[0x0]*=6.5; fPlayerOrigin[0x1]*=6.5 fPlayerOrigin[0x2]=floatmin(470.0, fPlayerOrigin[0x2]*15.0); set_pev(iEntities[i], pev_velocity, /*fVelocity*/fPlayerOrigin); _quakefunc_executeDamage(iAttacker, iEntities[i], iDamage, false); } } engfunc(EngFunc_RemoveEntity, iEnt); }
_quakefunc_executeDamage(iAttacker, iOfiara, iDamage, bool:bHitBox){ new iAimingOrigin[0x3], iHitbox, iBron, Float:fAimingOrigin[0x3], Float:fDamage, Float:fHealth, sTypBroni[0x20]; fDamage = float(iDamage); iBron = _quakefunc_getCurrentWeapon(iAttacker); get_user_origin(iAttacker, iAimingOrigin, 0x3); IVecFVec(iAimingOrigin, fAimingOrigin); formatex(sTypBroni, sizeof sTypBroni, g_sTypyBroni[iBron]); if(bHitBox){ new Float:fViewOfs[0x3], Float:fEnd[0x3], Float:fOrigin[0x3]; pev(iAttacker, pev_origin, fOrigin); pev(iAttacker, pev_view_ofs, fViewOfs); xs_vec_add(fOrigin, fViewOfs, fOrigin); pev(iAttacker, pev_v_angle, fEnd); angle_vector(fEnd, ANGLEVECTOR_FORWARD, fEnd); xs_vec_mul_scalar(fEnd, 999.0, fEnd); xs_vec_add(fOrigin, fEnd, fEnd); new iTr = create_tr2(); engfunc(EngFunc_TraceLine, fOrigin, fEnd, 0, iAttacker, iTr); new iHit = get_tr2(iTr, TR_pHit); if(is_user_connected(iHit) && is_user_alive(iHit)){ pev(iHit, pev_health, fHealth); iHitbox = get_tr2(iTr, TR_iHitgroup); fDamage *= g_fItemDmgMulti[iHitbox]; message_begin(MSG_BROADCAST, SVC_TEMPENTITY); write_byte(TE_BLOODSPRITE); engfunc(EngFunc_WriteCoord, fAimingOrigin[0x0]); engfunc(EngFunc_WriteCoord, fAimingOrigin[0x1]); engfunc(EngFunc_WriteCoord, fAimingOrigin[0x2]); write_short(g_sSprites[0x3]); write_short(g_sSprites[0x2]); write_byte(0xF8); write_byte(floatround(g_fItemDmgMulti[iHitbox] * 0xD)); message_end(); set_msg_block(g_mDeathMsg, BLOCK_ONCE); fm_fakedamage(iHit, sTypBroni, fDamage, DMG_GENERIC); set_msg_block(g_mDeathMsg, BLOCK_NOT); if(floatround(fHealth - fDamage) < 0x1){ make_deathmsg(iAttacker, iHit, 0x1, ""); user_silentkill(iHit); } } } else{ pev(iOfiara, pev_health, fHealth); set_msg_block(g_mDeathMsg, BLOCK_ONCE); fm_fakedamage(iOfiara, sTypBroni, fDamage, DMG_GENERIC); set_msg_block(g_mDeathMsg, BLOCK_NOT); if(floatround(fHealth - fDamage) < 0x1){ make_deathmsg(iAttacker, iOfiara, 0x1, ""); user_silentkill(iOfiara); } } }
Damage based on distance
PHP Code:
_quakefunc_damageByRange(Float:fOdleglosc, Float:fDamage, Float:fMnoznik, Float:fRoznica){ new Float:fMaxDmg = fDamage*fMnoznik; new Float:fIle; fIle = fMaxDmg - fOdleglosc*fRoznica; if(fIle > fMaxDmg) fIle = fMaxDmg; return floatround(floatmax(fIle, fDamage*random_float(0.1, 0.3))); }
btw I see no point at scamming, old code was working for sure, it was just pretty bad and I promised you, to give you the new version when it's done, but ofc u already said im scammer and we lost contact.
Last edited by diablix; 12-18-2012 at 16:13.
|
|