public jetPackFireEffect(location[3])
{
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(17)
write_coord(location[0])
write_coord(location[1])
write_coord(location[2])
write_short(g_spriteFire)
write_byte(5)
write_byte(125)
message_end()
}
//----------------------------------------------------------------------------------------------
public ironman_loop(id)
{
new Float:velocity[3]
new origin[3], userArmor
if ( !is_user_alive(id) || posiada_plecak[id] != 1 ) return PLUGIN_HANDLED
// Increase armor for this guy
userArmor = get_user_armor(id)
if ( userArmor < 100 && g_jetPackRunning[id] == 0 ) {
//Give the armor item first so CS knows the player has armor
if (userArmor <= 0) give_item(id, "item_assaultsuit")
//Set the armor to what we want it to be
set_user_armor(id, userArmor + 1 )
return PLUGIN_HANDLED
}
// OK - We'll make this armor based - but also add armor
// So you can run out of fuel, but get it back too
if (gUseFuel != 0 && 1 > userArmor && g_jetPackRunning[id] == 1 ) {
g_jetPackRunning[id] = 0
emit_sound(id, CHAN_WEAPON, "debris/beamstart11.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
client_print(id, print_center, "[Diablo II Mod]Skonczylo Ci sie paliwo rakietowe")
return PLUGIN_HANDLED
}
if (g_jetPackRunning[id] == 1) {
// Decrement Fuel
if ( gUseFuel != 0 ) {
set_user_armor(id, userArmor - 1 )
}
Entvars_Get_Vector(id, EV_VEC_velocity, velocity)
velocity[0] = velocity[0] * gMultiplier
velocity[1] = velocity[1] * gMultiplier
velocity[2] += float(gThrust)
if ( velocity[0] > gMaxSpeed ) velocity[0] = gMaxSpeed
if ( velocity[0] < (gMaxSpeed * -1) ) velocity[0] = gMaxSpeed * -1
if ( velocity[1] > gMaxSpeed ) velocity[1] = gMaxSpeed
if ( velocity[1] < (gMaxSpeed * -1) ) velocity[1] = gMaxSpeed * -1
if ( velocity[2] > gThrust * 2.0 ) velocity[2] = gThrust * 2.0
Entvars_Set_Vector(id, EV_VEC_velocity, velocity)
get_user_origin(id, origin, 0)
jetPackFireEffect(origin)
emit_sound(id, CHAN_WEAPON, "ambience/flameburst1.wav", 1.0, ATTN_NORM, 0, PITCH_LOW)
}
return PLUGIN_CONTINUE
}
PreThink:
if (button2 & IN_USE && on_knife[id] && button[id]==0 && (posiada_plecak[id] == 1)){
button[id] = 1;
g_jetPackRunning[id] = 1
ironman_loop(id)
}
Init:
gUseFuel = get_cvar_num("armor_fuel")
register_cvar("armor_fuel", "1" )
Globalne zmienne:
new g_jetPackRunning[33];
new gThrust, Float:gMaxSpeed, Float:gMultiplier, g_spriteFire, gUseFuel;
new posiada_plecak[33];
Oczywiście Precache, ale nie daje, bo jest ok.
Co tutaj mam źle? Gdy na nożu wcisnę E, to się nie unosze, przyciska mnie do zmieni, pancerza nie odbiera, efekt się pojawia. Proszę o pomoc.