Raised This Month: $51 Target: $400
 12% 

Argument type mismatch


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Exploited
Veteran Member
Join Date: Jul 2010
Location: Sweden
Old 02-17-2011 , 03:10   Argument type mismatch
Reply With Quote #1

Hello,

Well, I haven't really scripted anything recently and as such I might have made some beginnermistakes (though I am still a beginner so I guess it's understandable).

What I am trying to do, is to add teamglow to this hero with a playermodel, but I keep getting argument type mismatch when I compile.

Sorry for having such a messy code, I originally just had an AWP hero called Captain AWP which was based on the template that I had for weaponheroes which was called Spas12 and then I decided to add a playermodel and healing so I ripped from Wolverine.... bleh.

Here are the errors:

Code:
// F:\Misc\scripting\sh_scream.sma(57) : error 035: argument type mismatch
(argument 4)
// F:\Misc\scripting\sh_scream.sma(82) : error 035: argument type mismatch
(argument 4)
//
Here it is. The errors are on both lines where I use set_task, so obviously I fail at setting tasks. They are in sh_hero_init and sh_client_spawn.

PHP Code:
//Spas 12

#include <superheromod>

// offsets
const m_pPlayer 41
const XTRA_OFS_WEAPON 4

// GLOBAL VARIABLES
new gHeroID
new bool:gHasSpas[SH_MAXSLOTS+1]
new 
gPcvarHealPoints
new const gScreamPlayer[] = "models/player/scream/scream.mdl"
new const gModelAwp[] = "models/shmod/captainawp_v_awp.mdl"
new const gModelAwp2[] = "models/shmod/captainawp_p_awp.mdl"
//----------------------------------------------------------------------------------------------
public plugin_init()
{
    
//Plugin info
    
register_plugin("SUPERHERO Scream""2.1""Exploited")

    
// DO NOT EDIT THIS FILE TO CHANGE THE CVARS, USE THE SHCONFIG.CFG
    
new pcvarLevel register_cvar("scream_level""18")
    new 
pcvarM3Speed register_cvar("scream_speed""1000")
    new 
pcvarM3Mult register_cvar("scream_awpmult""2.0")
    
gPcvarHealPoints register_cvar("scream_healpoints""10")

    
//FIRE THE EVENT TO CREATE THIS SUPERHERO
    
gHeroID sh_create_hero("Scream"pcvarLevel)
    
sh_set_hero_info(gHeroID"Scream""Get a free AWP with increased damage and speed, also get a player model")
    
sh_set_hero_speed(gHeroIDpcvarM3Speed, {CSW_AWP})
    
sh_set_hero_dmgmult(gHeroIDpcvarM3MultCSW_AWP)

    
// REGISTER EVENTS THIS HERO WILL RESPOND TO!
    
register_event("CurWeapon""weapon_change""be""2=18")
    
RegisterHam(Ham_Item_Deploy"weapon_awp""Ham_awp_Deploy_Post"1)
}
//----------------------------------------------------------------------------------------------
public plugin_precache()
{
    
precache_model(gModelAwp)
    
precache_model(gModelAwp2)
    
precache_model(gScreamPlayer)
}
//----------------------------------------------------------------------------------------------
public sh_hero_init(idheroIDmode)
{
    if ( 
gHeroID != heroID ) return

    switch(
mode)
    {
        case 
SH_HERO_ADD:
        {
            
gHasSpas[id] = true
            spas_weapons
(id)
            
hero_morph(id)
            
set_task(1.0"wolv_loop"_id1"b")
            if ( 
get_user_weapon(id) == CSW_AWP )
            {
                
switchmodel(id)
            }
        }

        case 
SH_HERO_DROP:
        {
            
gHasSpas[id] = false
            hero_unmorph
(id)
            if ( 
is_user_alive(id) )
            {
                
sh_drop_weapon(idCSW_AWPtrue)
            }
        }
    }
}
//----------------------------------------------------------------------------------------------
public sh_client_spawn(id)
{
    if ( 
gHasSpas[id] )
    {
        
spas_weapons(id)
        
hero_morph(id)
        
set_task(1.0"wolv_loop"_id_"b")
    }
}
//----------------------------------------------------------------------------------------------
spas_weapons(id)
{
    if ( 
sh_is_active() && is_user_alive(id) && gHasSpas[id] )
    {
        
sh_give_weapon(idCSW_AWP)
    }
}
//----------------------------------------------------------------------------------------------
public weapon_change(id)
{
    if ( !
sh_is_active() || !gHasSpas[id] ) return

    
// Never Run Out of Ammo!
    //clip = read_data(3)
    
if (read_data(3) == 0)
    {
        
sh_reload_ammo(id1)
    }
}
//----------------------------------------------------------------------------------------------
public Ham_awp_Deploy_Post(const weapon_ent)
{
    static 
owner
    owner 
get_pdata_cbase(weapon_entm_pPlayerXTRA_OFS_WEAPON)

    
switchmodel(owner)
}
//----------------------------------------------------------------------------------------------
switchmodel(id)
{
    if ( !
sh_is_active() || !is_user_alive(id) || !gHasSpas[id] ) return

    
set_pev(idpev_viewmodel2gModelAwp)
    
set_pev(idpev_weaponmodel2gModelAwp2)
}
//----------------------------------------------------------------------------------------------
public wolv_loop(id)
{
    if ( !
sh_is_active() ) return

    static 
players[SH_MAXSLOTS], playerCountplayeri
    get_players
(playersplayerCount"ah")
    
    if ( 
gHasSpas[id] && is_user_alive(id) )
    {
        switch(
cs_get_user_team(id))
        {
            case 
CS_TEAM_TshGlow(id10000)
            case 
CS_TEAM_CTshGlow(id00100)
        }
    }

    for ( 
0playerCounti++ ) {
        
player players[i]

        if ( 
gHasSpas[player] ) {
            
sh_add_hp(playerget_pcvar_num(gPcvarHealPoints))
            
        }
    }
}
//----------------------------------------------------------------------------------------------
hero_morph(id)
{
    
cs_set_user_model(id"scream")
}
//----------------------------------------------------------------------------------------------
hero_unmorph(id)
{
    
cs_reset_user_model(id)
}  
//---------------------------------------------------------------------------------------------- 


Thanks,
Exploited
__________________
Jelle (1): I LOVE YOU
Jelle (1): Yeah. omg you are so awesome!
--------------
Jelle (1): You know when a poo is about to exit but it is too big?
Jelle (1): God my ass still hurts
Exploited is offline
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 02-17-2011 , 06:31   Re: Argument type mismatch
Reply With Quote #2

Task index is the third argument.
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
Exploited
Veteran Member
Join Date: Jul 2010
Location: Sweden
Old 02-18-2011 , 13:08   Re: Argument type mismatch
Reply With Quote #3

Thank you, will try that asap
__________________
Jelle (1): I LOVE YOU
Jelle (1): Yeah. omg you are so awesome!
--------------
Jelle (1): You know when a poo is about to exit but it is too big?
Jelle (1): God my ass still hurts
Exploited 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 05:29.


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