Raised This Month: $ Target: $400
 0% 

Whats wrong with this code T-800EditedJelle


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Shippo
Junior Member
Join Date: Oct 2012
Old 07-21-2013 , 04:24   Whats wrong with this code T-800EditedJelle
Reply With Quote #1

Code:
/* Plugin generated by AMXX-Studio */

#include <superheromod>

new gHeroID
new gHeroName[] = "T-800"
new bool:gHasT[SH_MAXSLOTS+1]
new const gParaModel[] = "models/shmod/t800_m249.mdl"
new const gPlayerModel[] = "models/player/t800/t800.mdl"
new const gViewModel[] = "models/shmod/t800_minigun.mdl"

public plugin_init()
{
    //plugin info
    register_plugin("SUPERHERO T-800", "2.2", "Jelle/Bum_Boy16")
    
    //cvars
    new pcvarLevel = register_cvar("t800_level", "10")
    new pcvarHealth = register_cvar("t800_health", "150")
    new pcvarArmor = register_cvar("t800_armor", "150")
    new pcvarGrav = register_cvar("t800_grav", "0.5")
    new pcvarmult = register_cvar("t800_mult", "5")
    
    //create hero!
    gHeroID = sh_create_hero(gHeroName, pcvarLevel)
    sh_set_hero_info(gHeroID, "Change into a T-800", "Get a giant mini gun")
    
    //set hero power
    sh_set_hero_hpap(gHeroID, pcvarHealth, pcvarArmor)
    sh_set_hero_grav(gHeroID, pcvarGrav)
    sh_set_hero_dmgmult(gHeroID, pcvarmult, CSW_M249)
    
    //events
    register_event("CurWeapon", "weapon_change", "be", "1=1")
}


public plugin_precache()
{
    precache_model(gParaModel)
    precache_model(gPlayerModel)
    precache_model(gViewModel)
}

public sh_hero_init(id, heroID, mode)
{
    //if no power return
    if (gHeroID != gHeroID) return
    
    //check if they get or lose power
    switch(mode)
    {
        case SH_HERO_ADD:
        {
            gHasT[id] = true
            switch_model(id)
            t_morph(id)
        }
        case SH_HERO_DROP:
        {
            gHasT[id] = false
            t_unmorph(id)
        }
    }
}

public sh_client_spawn(id)
{
    //if they have power give weapon
    if (gHasT[id])
    {
        t800_weapon(id)
        t_morph(id)
    }
}

t800_weapon(id)
{
    //if client is alive and have power give para
    if (sh_is_active() && is_user_alive(id) && gHasT[id])
    {
        sh_give_weapon(id, CSW_M249, true)
    }
}

switch_model(id)
{
    //if sh off, user is dead or user does nothave power do nothing
    if ( !sh_is_active() || !is_user_alive(id) || !gHasT[id] ) return
    
    //if client has para set model
    if ( get_user_weapon(id) == CSW_M249)
    {
        set_pev(id, pev_viewmodel2, gParaModel)
        set_pev(id, pev_weaponmodel2, gViewModel)
    }
}

public weapon_change(id)
{
    //do nothing if client does not have hero or sh is off
    if ( !sh_is_active() || !gHasT[id] ) return
    
    new weaponID = read_data(2)
    if ( weaponID != CSW_M249 ) return
    
    //go set model
    switch_model(id)
    
    if ( read_data(3) == 0 )
    {
        sh_reload_ammo(id, 1)
    }
}

t_morph(id)
{
    cs_set_user_model(id, gPlayerModel)
}

t_unmorph(id)
{
    cs_reset_user_model(id)
}



Im new here so forgive me if there is something wrong with my post

Last edited by Shippo; 07-21-2013 at 06:38.
Shippo is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-21-2013 , 04:36   Re: Whats wrong with this code T-800EditedJelle
Reply With Quote #2

Use [code] or [pawn] BBCode to show code.

And you don't explain what is your problem.
__________________

Last edited by Arkshine; 07-21-2013 at 04:37.
Arkshine is offline
Shippo
Junior Member
Join Date: Oct 2012
Old 07-21-2013 , 04:43   Re: Whats wrong with this code T-800EditedJelle
Reply With Quote #3

Code:
/tmp/textpxqBtg.sma(31) : error 017: undefined symbol "sh_set_hero_mult" /tmp/textpxqBtg.sma(35) : warning 204: symbol is assigned a value that is never used: "pcvarmult"

Last edited by Shippo; 07-22-2013 at 05:15.
Shippo is offline
Shippo
Junior Member
Join Date: Oct 2012
Old 07-21-2013 , 04:45   Re: Whats wrong with this code T-800EditedJelle
Reply With Quote #4

Quote:
Originally Posted by Shippo View Post
/tmp/textpxqBtg.sma(31) : error 017: undefined symbol "sh_set_hero_mult" /tmp/textpxqBtg.sma(35) : warning 204: symbol is assigned a value that is never used: "pcvarmult"
Shippo is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-21-2013 , 04:46   Re: Whats wrong with this code T-800EditedJelle
Reply With Quote #5

I was meant

Code:
Your code
using [code] [ /code]

You have to compile with superheromod.inc file. There is a tutorial (in the Tutorial section), if you don't know how to compile with third-party includes.
__________________
Arkshine is offline
Shippo
Junior Member
Join Date: Oct 2012
Old 07-21-2013 , 04:47   Re: Whats wrong with this code T-800EditedJelle
Reply With Quote #6

I hope this works thx you can you give me the link

Last edited by Shippo; 07-21-2013 at 04:50.
Shippo is offline
Old 07-21-2013, 04:52
Shippo
This message has been deleted by Shippo.
Shippo
Junior Member
Join Date: Oct 2012
Old 07-21-2013 , 05:17   Re: Whats wrong with this code T-800EditedJelle
Reply With Quote #7

Code:
//AMXXPC compile.exe
// by the AMX Mod X Dev Team


//// compiletut.sma
// C:\Program Files (x86)\Steam\SteamApps\zakiaz\dedicated server\czero\addons\a
mxmodx\scripting\compiletut.sma(29) : error 017: undefined symbol "sh_set_hero_d
mgmult"
// C:\Program Files (x86)\Steam\SteamApps\zakiaz\dedicated server\czero\addons\a
mxmodx\scripting\compiletut.sma(33) : warning 204: symbol is assigned a value th
at is never used: "pcvarmult"
//
// 1 Error.
// Could not locate output file C:\Program Files (x86)\Steam\SteamApps\zakiaz\de
dicated server\czero\addons\amxmodx\scripting\compiled\compiletut.amx (compile f
ailed).
//
// Compilation Time: 0,41 sec
// ----------------------------------------

Press enter to exit ...

Last edited by Shippo; 07-21-2013 at 05:24.
Shippo is offline
Shippo
Junior Member
Join Date: Oct 2012
Old 07-21-2013 , 11:05   Re: Whats wrong with this code T-800EditedJelle
Reply With Quote #8

Anyone know the error please help
Shippo is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-21-2013 , 11:06   Re: Whats wrong with this code T-800EditedJelle
Reply With Quote #9

I've already answered you...
__________________
Arkshine is offline
Shippo
Junior Member
Join Date: Oct 2012
Old 07-22-2013 , 04:08   Re: Whats wrong with this code T-800EditedJelle
Reply With Quote #10

This is the error now
Code:
//AMXXPC compile.exe // by the AMX Mod X Dev Team   //// compiletut.sma // C:\Program Files (x86)\Steam\SteamApps\zakiaz\dedicated server\czero\addons\a mxmodx\scripting\compiletut.sma(29) : error 017: undefined symbol "sh_set_hero_d mgmult" // C:\Program Files (x86)\Steam\SteamApps\zakiaz\dedicated server\czero\addons\a mxmodx\scripting\compiletut.sma(33) : warning 204: symbol is assigned a value th at is never used: "pcvarmult" // // 1 Error. // Could not locate output file C:\Program Files (x86)\Steam\SteamApps\zakiaz\de dicated server\czero\addons\amxmodx\scripting\compiled\compiletut.amx (compile f ailed). // // Compilation Time: 0,41 sec // ----------------------------------------  Press enter to exit ...

Last edited by Shippo; 07-22-2013 at 04:09.
Shippo is offline
Old 07-22-2013, 05:14
Shippo
This message has been deleted by Shippo.
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 06:31.


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