AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Zombie Plague Mod (https://forums.alliedmods.net/forumdisplay.php?f=126)
-   -   Help / Support [Need Help] Set Player Model by ZV_MAIN flag plugin (https://forums.alliedmods.net/showthread.php?t=309308)

jigore 07-20-2018 17:43

[Need Help] Set Player Model by ZV_MAIN flag plugin
 
I am new to PAWN, so my :crab: arms made this plugin.
The plugin had no problems with compiling, but was not working at all
P.S Plugin is made for Zombie Plague 4.3

Code:

#include <amxmodx>
#include <cstrike>
#include <hamsandwich>
#include <zmvip>

#define PLUGIN "[ZP] VIP Model"
#define VERSION "0.1"
#define AUTHOR "gore"


new VIP_MODEL[] = "models/player/Transcendent_Michaela/Transcendent_Michaela.mdl"

public plugin_init() {

        register_plugin(PLUGIN, VERSION, AUTHOR)
   
        RegisterHam(Ham_Spawn, "player", "SetModel", 1)

}

public plugin_precache() {
       
        precache_model(VIP_MODEL)

}

public SetModel(const id) {

        if(zv_get_user_flags(id) & ZV_MAIN && is_user_connected(id)) {

                cs_set_user_model(id, "Transcendent_Michaela")
                client_print(id, print_chat, "\yYou've just got VIP Player model")
                return PLUGIN_HANDLED
        }
        else
        {
        client_print(id, print_chat, "\rSorry, but you don't have VIP flags")
        }
        return PLUGIN_HANDLED
}

I need help making it work. pls.

edon1337 07-21-2018 06:31

Re: [Need Help] Set Player Model by ZV_MAIN flag plugin
 
PHP Code:

#include < amxmodx >
#include < hamsandwich >
#include < zombieplague >
#include < zmvip >

new g_szModelName[ ] = "Transcendent_Michaela";

public 
plugin_init( )
{
    
register_plugin"[ZP] VIP Model""1.0""DoNii" );
    
RegisterHamHam_Spawn"player""@HamSpawn_Post");
}

public 
plugin_precache( )
{
    new 
szBuffer64 ];
    
formatexszBuffercharsmaxszBuffer ), "models/player/%s/%s.mdl"g_szModelNameg_szModelName );
    
    
precache_modelszBuffer );
}

public @
HamSpawn_Postid )
{
    if( 
is_user_aliveid ) && ( zv_get_user_flagsid ) & ZV_MAIN ) )
    {
        
zp_override_user_modelidg_szModelName );
        
client_printidprint_chat"You just got the cool VIP Model." );
    }
    return 
HAM_IGNORED;




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

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