AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   monster_satchel model (pev_model) (https://forums.alliedmods.net/showthread.php?t=345507)

Phant 01-21-2024 19:16

monster_satchel model (pev_model)
 
1 Attachment(s)
What's wrong here? Model string is NULL.
(I would like to replace the model of monster_satchel next)
Code:
#include <amxmodx> #include <amxmisc> #include <fakemeta> #include <hamsandwich> #include <engine> #define PLUGIN "Satchels" #define VERSION "1.0" #define AUTHOR "Phant" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     RegisterHam(Ham_Spawn, "monster_satchel", "fw_SatchelSpawnPre", 0) } public fw_SatchelSpawnPre(ent) {     if(pev_valid(ent))       {         new s_Model[32]         pev(ent, pev_model, s_Model, 31)         client_print(0, print_chat, "SATHCEL MODEL: %s", s_Model)     } }

DJEarthQuake 01-22-2024 15:10

Re: monster_satchel model (pev_model)
 
Have you tried search lately? Anggara_nothing's work is a decent place to start.

Natsheh 01-23-2024 00:25

Re: monster_satchel model (pev_model)
 
Entity Spawn is called too early, you better use FM_SetModel post hook

DJEarthQuake 01-23-2024 11:00

Re: monster_satchel model (pev_model)
 
POST. I tested and it works..
Code:
#include <amxmodx> #include <amxmisc> #include <fakemeta> #include <hamsandwich> #include <engine> #define PLUGIN "Satchels" #define VERSION "1.0" #define AUTHOR "Phant" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     RegisterHam(Ham_Spawn, "monster_satchel", "fw_SatchelSpawnPost", 1) } public fw_SatchelSpawnPost(ent) {     if(pev_valid(ent))       {         new s_Model[32]         pev(ent, pev_model, s_Model, 31)         client_print(0, print_chat, "SATHCEL MODEL: %s", s_Model)     } }


PHP Code:

void CSatchelCharge :: Spawnvoid )
{
    
Precache( );
    
// motor
    
pev->movetype MOVETYPE_BOUNCE;
    
pev->solid SOLID_BBOX;

    
SET_MODEL(ENT(pev), "models/w_satchel.mdl");
    
//UTIL_SetSize(pev, Vector( -16, -16, -4), Vector(16, 16, 32));    // Old box -- size of headcrab monsters/players get blocked by this
    
UTIL_SetSize(pevVector( -4, -4, -4), Vector(444));    // Uses point-sized, and can be stepped over
    
UTIL_SetOriginpevpev->origin );

    
SetTouch( &CSatchelCharge::SatchelSlide );
    
SetUse( &CSatchelCharge::DetonateUse );
    
SetThink( &CSatchelCharge::SatchelThink );
    
pev->nextthink gpGlobals->time 0.1;

    
pev->gravity 0.5;
    
pev->friction 0.8;

    
pev->dmg gSkillData.plrDmgSatchel;
    
// ResetSequenceInfo( );
    
pev->sequence 1;




All times are GMT -4. The time now is 00:32.

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