Raised This Month: $ Target: $400
 0% 

Need help with this plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
godlike
Senior Member
Join Date: Apr 2005
Old 12-17-2006 , 09:06   Need help with this plugin
Reply With Quote #1

hej , Mateo10 made this plugin for me i requested it. Its called santa mod. everyone will have a santa model and a machine gun .(machine gun is also a custom model) the terror team has a red glow and the ct team got a blue glow. They are suposed to have 250hp,200AP and double speed but the only thing that works is the glow thing with the terrorist team.This is the code that mateo made for me. Can someone helpme plz.

Code:
#include <amxmodx>
#include <fakemeta>
#include <cstrike>
#include <fun>

new g_PlayerModel[] = "models/christmas_santa.mdl"
new g_WeaponVModel[] = "models/santa_v_m249.mdl"
new g_WeaponWModel[] = "models/santa_w_m249.mdl"
new g_RoundStartSound[] = "sound/hohoho.wav"

new g_Switch, g_BulletSpeed

public plugin_init() {
    register_plugin("Christmas Santa", "0.1", "MaTTe")
    
    g_Switch = register_cvar("cs_enable", "1")
    g_BulletSpeed = register_cvar("cs_bulletspeed", "450")
    
    register_event("CurWeapon", "switch_weaponmodel", "b", "CSW_M249")
    register_event("HLTV", "round_start", "a", "1=0", "2=0")
    register_event("ResetHUD", "switch_playermodel", "be")
    register_logevent("round_end", 2, "1=Round_End")
}

public round_start(id) {
    emit_sound(0, CHAN_AUTO, g_RoundStartSound, 1.0, ATTN_NORM, 0, PITCH_NORM)
    santa(id)
}

public santa(id) {
    if(!get_pcvar_num(g_Switch))
        return PLUGIN_HANDLED
        
    set_user_health(id, 250)
    set_user_armor(id, 200)
    
    if((pev(id, pev_button) & IN_ATTACK)) {
        bullet_slowdown(id)
    }
    return PLUGIN_CONTINUE
}

public bullet_slowdown(id) {
    new clipTemp, ammoTemp, wpnid = get_user_weapon(id, clipTemp, ammoTemp)
    if(wpnid==CSW_HEGRENADE || wpnid==CSW_SMOKEGRENADE || wpnid==CSW_C4 || wpnid==CSW_FLASHBANG
    || wpnid==CSW_KNIFE || wpnid==CSW_VEST || wpnid==CSW_VESTHELM)
        return PLUGIN_HANDLED

    
    new Float:viewOfs[3], Float:vOrigin[3], Float:vAngle[3] 
    pev(id, pev_origin, vOrigin)
    pev(id, pev_view_ofs, viewOfs)

    vOrigin[0] += viewOfs[0]
    vOrigin[1] += viewOfs[1]
    vOrigin[2] += viewOfs[2]

    pev(id, pev_v_angle, vAngle)

    vOrigin[0] += ( floatcos(vAngle[1], degrees) * floatcos(vAngle[0], degrees) ) * 26.0
    vOrigin[1] += ( floatsin(vAngle[1], degrees) * floatcos(vAngle[0], degrees) ) * 26.0
    vOrigin[2] += ( floatsin(vAngle[0], degrees) * -1.0 ) * 26.0

    vAngle[0] *= -1.0

    new NewEnt = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
    set_pev(NewEnt, pev_classname, "santaBullet")

    set_pev(NewEnt, pev_flags, wpnid)
    engfunc(EngFunc_SetModel, NewEnt, "models/shell.mdl")

    new Float:VecMins[3] = {-1.0, -1.0, -1.0}
    new Float:VecMaxs[3] = {1.0, 1.0, 1.0}
    set_pev(NewEnt, pev_mins, VecMins)
    set_pev(NewEnt, pev_maxs, VecMaxs)

    engfunc(EngFunc_SetOrigin, NewEnt, vOrigin)
    set_pev(NewEnt, pev_angles, vAngle)

    set_pev(NewEnt, pev_solid, SOLID_BBOX)
    set_pev(NewEnt, pev_movetype, MOVETYPE_FLY)
    set_pev(NewEnt, pev_owner, id)

    new Float:fNewVelocity[3]
    velocity_by_aim(id, get_pcvar_num(g_BulletSpeed), fNewVelocity)

    set_pev(NewEnt, pev_velocity, fNewVelocity)
    return PLUGIN_CONTINUE
}

public switch_playermodel(id) {
    new team[32]
    get_user_team(id, team, 31)
    
    if(equal(team, "TERRORIST")) {
        cs_set_user_model(id, g_PlayerModel)
        set_user_rendering(id, kRenderFxGlowShell, 155, 0, 0, kRenderGlow, 155)
    } else if(equal(team, "COUNTER_TERRORIST")) {
        cs_set_user_model(id, g_PlayerModel)
        set_user_rendering(id, kRenderFxGlowShell, 0, 0, 155, kRenderGlow, 155)
    }
}

public switch_weaponmodel(id) {
    new wpnid, clip, ammo = get_user_weapon(id, clip, ammo)
    if(wpnid==CSW_M249) {
        set_pev(id, pev_viewmodel2, g_WeaponVModel)
        set_pev(id, pev_viewmodel2, g_WeaponWModel)
    }
}

public plugin_precache() {
    precache_model(g_PlayerModel)
    precache_model(g_WeaponWModel)
    precache_model(g_WeaponVModel)
    precache_sound(g_RoundStartSound)
}
__________________
Read the rules before posting something stupid: click here

Any questions about amxx PM me
godlike is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 12-17-2006 , 09:19   Re: Need help with this plugin
Reply With Quote #2

round_start(id) <-----
//no id passed here.

round_start() {
get_players
then loop
}
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
godlike
Senior Member
Join Date: Apr 2005
Old 12-17-2006 , 09:24   Re: Need help with this plugin
Reply With Quote #3

Code:
public round_start() {
    get_players
    emit_sound(0, CHAN_AUTO, g_RoundStartSound, 1.0, ATTN_NORM, 0,PITCH_NORM)
    santa(id)
}
Like this?
__________________
Read the rules before posting something stupid: click here

Any questions about amxx PM me
godlike is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 12-17-2006 , 09:30   Re: Need help with this plugin
Reply With Quote #4

Code:
new players[32],num,player
get_players(players, num)
for(new i=0; i<num; i++)
{
    player = players[i]
    emit_sound(player, ...
    santa(player)
}
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
godlike
Senior Member
Join Date: Apr 2005
Old 12-17-2006 , 09:34   Re: Need help with this plugin
Reply With Quote #5

thx im totally noob in scripting.
__________________
Read the rules before posting something stupid: click here

Any questions about amxx PM me
godlike is offline
godlike
Senior Member
Join Date: Apr 2005
Old 12-17-2006 , 10:28   Re: Need help with this plugin
Reply With Quote #6

still the same old problem ...
__________________
Read the rules before posting something stupid: click here

Any questions about amxx PM me
godlike is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 12-17-2006 , 10:32   Re: Need help with this plugin
Reply With Quote #7

register_event("CurWeapon", "switch_weaponmodel", "b", "CSW_M249")
to
register_event("CurWeapon", "switch_weaponmodel", "b", "1=1","2=20")
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 12-17-2006 , 10:34   Re: Need help with this plugin
Reply With Quote #8

if((pev(id, pev_button) & IN_ATTACK)) {
bullet_slowdown(id)
}
should in FM_PlayerPreThink forward
basiclly this script need rewriting
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
godlike
Senior Member
Join Date: Apr 2005
Old 12-17-2006 , 12:42   Re: Need help with this plugin
Reply With Quote #9

hmmm. What do you mean with rewriting?
__________________
Read the rules before posting something stupid: click here

Any questions about amxx PM me
godlike is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 12-17-2006 , 18:19   Re: Need help with this plugin
Reply With Quote #10

The plugin needs to be redone.
Change everything/Start from scratch.
[ --<-@ ] Black Rose is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:02.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode