Raised This Month: $32 Target: $400
 8% 

Solved Need help with plugin that should set a player model


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
jigore
Junior Member
Join Date: Jul 2018
Old 07-20-2018 , 17:09   Need help with plugin that should set a player model
Reply With Quote #1

I am new to PAWN, so my 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.

Last edited by jigore; 07-21-2018 at 06:52. Reason: accidently wrote smth in code
jigore is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 07-20-2018 , 17:36   Re: Need help with plugin that should set a player model
Reply With Quote #2

Post in Zombie Plague section instead.
edon1337 is offline
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 07-21-2018 , 06:20   Re: Need help with plugin that should set a player model
Reply With Quote #3

Don't use is_user_connected(id), use is_user_alive(id) instead
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM
Ghosted is offline
jigore
Junior Member
Join Date: Jul 2018
Old 07-21-2018 , 06:52   Re: Need help with plugin that should set a player model
Reply With Quote #4

well, I used different plugin I remade, so this is solved
First code for overriding model with admin model
Code:
#include <amxmodx>
#include <hamsandwich>
#include <zombieplague>

#define PLUGIN_NAME "plugin"
#define PLUGIN_VERSION "1"
#define PLUGIN_AUTHOR "author"

#define ADMIN_BAN	(1<<3)
new const g_model_for_admin[][] = { "vip_cat" }

public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)

RegisterHam(Ham_Spawn, "player", "fw_PlayerSpawn_Post", true)
}

public plugin_precache()
{
for(new index = 0; index < sizeof g_model_for_admin; index++)
{
static patch[128]
formatex(patch, sizeof patch, "models/player/vip_cat/vip_cat.mdl", g_model_for_admin[index], g_model_for_admin[index])
precache_model(patch)
}
}

public fw_PlayerSpawn_Post(iPlayer)
{
if(is_user_alive(iPlayer) && !zp_get_user_zombie(iPlayer) && !zp_get_user_survivor(iPlayer) && (get_user_flags(iPlayer) & ADMIN_BAN))
{
zp_override_user_model(iPlayer, g_model_for_admin[random(sizeof g_model_for_admin)])
}
}

public zp_user_humanized_post(iPlayer, iSurv)
{
if(!iSurv && (get_user_flags(iPlayer) & ADMIN_BAN))
{
zp_override_user_model(iPlayer, g_model_for_admin[random(sizeof g_model_for_admin)])
}
}
This one is overriding admin model that is set in zombieplague.ini, so adm&vip would be the same models, so you need both to different models for VIP and ADMIN
Code:
#include <amxmodx>
#include <hamsandwich>
#include <zombieplague>

#define PLUGIN_NAME "[ZP] Set Model VIP"
#define PLUGIN_VERSION "0.1"
#define PLUGIN_AUTHOR "pach2580"

#define ADMIN_RESERVATION	(1<<1)
new const g_model_for_vip[][] = { "vip_cat" }

public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)

RegisterHam(Ham_Spawn, "player", "fw_PlayerSpawn_Post", true)
}

public plugin_precache()
{
for(new index = 0; index < sizeof g_model_for_vip; index++)
{
static patch[128]
formatex(patch, sizeof patch, "models/player/vip_cat/vip_cat.mdl", g_model_for_vip[index], g_model_for_vip[index])
precache_model(patch)
}
}

public fw_PlayerSpawn_Post(iPlayer)
{
if(is_user_alive(iPlayer) && !zp_get_user_zombie(iPlayer) && !zp_get_user_survivor(iPlayer) && (get_user_flags(iPlayer) & ADMIN_RESERVATION))
{
zp_override_user_model(iPlayer, g_model_for_vip[random(sizeof g_model_for_vip)])
}
}

public zp_user_humanized_post(iPlayer, iSurv)
{
if(!iSurv && (get_user_flags(iPlayer) & ADMIN_RESERVATION))
{
zp_override_user_model(iPlayer, g_model_for_vip[random(sizeof g_model_for_vip)])
}
}
Leaving codes here if some1 like me will face the same problem like I did.
__________________
pawn plugin maker.
actually new
jigore 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 14:31.


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