AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Whats wrong with this code T-800EditedJelle (https://forums.alliedmods.net/showthread.php?t=221366)

Shippo 07-21-2013 04:24

Whats wrong with this code T-800EditedJelle
 
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

Arkshine 07-21-2013 04:36

Re: Whats wrong with this code T-800EditedJelle
 
Use [code] or [pawn] BBCode to show code.

And you don't explain what is your problem.

Shippo 07-21-2013 04:43

Re: Whats wrong with this code T-800EditedJelle
 
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"

Shippo 07-21-2013 04:45

Re: Whats wrong with this code T-800EditedJelle
 
Quote:

Originally Posted by Shippo (Post 1995521)
/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"


Arkshine 07-21-2013 04:46

Re: Whats wrong with this code T-800EditedJelle
 
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.

Shippo 07-21-2013 04:47

Re: Whats wrong with this code T-800EditedJelle
 
I hope this works thx you can you give me the link

Shippo 07-21-2013 05:17

Re: Whats wrong with this code T-800EditedJelle
 
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 ...


Shippo 07-21-2013 11:05

Re: Whats wrong with this code T-800EditedJelle
 
Anyone know the error please help

Arkshine 07-21-2013 11:06

Re: Whats wrong with this code T-800EditedJelle
 
I've already answered you...

Shippo 07-22-2013 04:08

Re: Whats wrong with this code T-800EditedJelle
 
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 ...


All times are GMT -4. The time now is 06:31.

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