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

Modifying plugins select models zombie plague


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mihai94
Junior Member
Join Date: Feb 2018
Old 02-27-2018 , 11:42   Modifying plugins select models zombie plague
Reply With Quote #1

Hello I have on the server this menu menu models appears a menu where I can choose which skin I want only that I want to change in the following way.
1. when you choose the skin you want from there to be permanent he only takes 1 round the next round gives you skin with default and if you can permanently change it, only if you want that player to select another skin only then to modify it and slices to be permanent.
2. have access to this menu only players who hold vip [gold members] in the menu to be set from the flag and be the ADMIN_LEVEL_H [flags t]

plugins:

PHP Code:
#include <amxmodx> 
#include <zombie_plague_special> 
#include <fakemeta> 
#include <fun> 
#include <zmvip> 
#include <colorchat> 

new g_ent_playermodel[33]; 
new 
g_ent_weaponmodel[33]; 
new 
g_currentweapon[33]; 
new 
g_pcvar_active

new 
MenuKeys = (<< 0) + (<< 1) + (<< 2) + (<< 3) + (<< 4) + (<< 5) + (<< 6) + (<< 7) + (<< + (<< 9
new 
BuyMenuBodyText[256

public 
plugin_init() 

register_plugin("[ZP] Select Models""1.2""Anggara_nothing"
g_pcvar_active register_cvar("zp_sem_enable""1"
register_message(get_user_msgid("CurWeapon"), "message_cur_weapon"
SetupSelectMenu() 
register_clcmd("say /models""ClCmdSelectModel"
register_menucmd(register_menuid("\rSelecteaz a-ti Modelul Dorit:"), MenuKeys"SelectIt"


public 
plugin_precache() 

// Change your models here. 
engfunc(EngFunc_PrecacheModel"models/player/VIPBarbatJoker/VIPBarbatJoker.mdl"
engfunc(EngFunc_PrecacheModel"models/player/VIPBarbatSmithAgent/VIPBarbatSmithAgent.mdl"
engfunc(EngFunc_PrecacheModel"models/player/VIPFemeleBarbara/VIPFemeleBarbara.mdl"
engfunc(EngFunc_PrecacheModel"models/player/VIPFemeleInger/VIPFemeleInger.mdl"
engfunc(EngFunc_PrecacheModel"models/player/VIPBarbatDoctorFox/VIPBarbatDoctorFox.mdl"
engfunc(EngFunc_PrecacheModel"models/player/VIPBarbatVendetta/VIPBarbatVendetta.mdl"
engfunc(EngFunc_PrecacheModel"models/player/VIPFemeleSonya/VIPFemeleSonya.mdl"
engfunc(EngFunc_PrecacheModel"models/player/VIPFemeleJennifer/VIPFemeleJennifer.mdl"


// Current Weapon info 
public message_cur_weapon(msg_idmsg_destmsg_entity

// Player not alive or not an active weapon 
if (!is_user_alive(msg_entity) || get_msg_arg_int(1) != 1
return; 

// Get weapon id 
static weapon 
weapon 
get_msg_arg_int(2

// Store weapon id for reference 
g_currentweapon[msg_entity] = weapon 

// Replace weapon models with custom ones 
fm_set_weaponmodel_ent(msg_entity


// User Infected forward 
public zp_user_infected_post(idinfector

// remove the glow. 
set_user_rendering(idkRenderFxNone0,0,0,kRenderNormal255

// Remove Custom Model Entities 
fm_remove_model_ents(id


public 
ClCmdSelectModel(id

if(
zp_get_user_zombie(id) || zp_get_user_nemesis(id) || zp_get_user_survivor(id)) 

ColorChat(0GREY"^4[ZP Models] ^3Aceste Skinuri Sunt Doar Pentru Oameni."

set_hudmessage(2001550, -1.00.5006.08.00.30.53
show_hudmessage(id"Aceste Skinuri Sunt Doar Pentru Oameni."
return 
PLUGIN_HANDLED

else if(!
get_pcvar_num(g_pcvar_active)) 

set_hudmessage(2001550, -1.00.5006.08.00.30.53
show_hudmessage(id"Aceasta Abiliate A Fost Dezactivata."
return 
PLUGIN_HANDLED

else if(!
is_user_alive(id)) 

ColorChat(0GREY"^4[ZP Models] ^3Trebuie Sa Fii In Viata Pentru A Putea Utiliza Acest Meniu."

set_hudmessage(2001550, -1.00.5006.08.00.30.53
show_hudmessage(id"Trebuie Sa Fii In Viata Pentru A Putea Utiliza Acest Meniu."
return 
PLUGIN_HANDLED

else 

SetupSelectMenu() 
show_menu(idMenuKeysBuyMenuBodyText

return 
PLUGIN_CONTINUE


public 
SelectIt(idkey

switch (
key

case 
0

fm_remove_model_ents(id
if (!
pev_valid(g_ent_playermodel[id])) 

g_ent_playermodel[id] = engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target")); 
if (!
pev_valid(g_ent_playermodel[id])) return ; 

set_user_rendering(idkRenderFxNone255255255kRenderTransTexture1
set_pev(g_ent_playermodel[id], pev_classname"player_model"
set_pev(g_ent_playermodel[id], pev_movetypeMOVETYPE_FOLLOW
set_pev(g_ent_playermodel[id], pev_aimentid
set_pev(g_ent_playermodel[id], pev_ownerid
// and change this. 
engfunc(EngFunc_SetModelg_ent_playermodel[id], "models/player/VIPBarbatJoker/VIPBarbatJoker.mdl"
fm_set_weaponmodel_ent(id


case 
1

fm_remove_model_ents(id
if (!
pev_valid(g_ent_playermodel[id])) 

g_ent_playermodel[id] = engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target")); 
if (!
pev_valid(g_ent_playermodel[id])) return ; 

set_user_rendering(idkRenderFxNone255255255kRenderTransTexture1
set_pev(g_ent_playermodel[id], pev_classname"player_model"
set_pev(g_ent_playermodel[id], pev_movetypeMOVETYPE_FOLLOW
set_pev(g_ent_playermodel[id], pev_aimentid
set_pev(g_ent_playermodel[id], pev_ownerid
// and change this. 
engfunc(EngFunc_SetModelg_ent_playermodel[id], "models/player/VIPBarbatSmithAgent/VIPBarbatSmithAgent.mdl"
fm_set_weaponmodel_ent(id


case 
2

fm_remove_model_ents(id
if (!
pev_valid(g_ent_playermodel[id])) 

g_ent_playermodel[id] = engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target")); 
if (!
pev_valid(g_ent_playermodel[id])) return ; 

set_user_rendering(idkRenderFxNone255255255kRenderTransTexture1
set_pev(g_ent_playermodel[id], pev_classname"player_model"
set_pev(g_ent_playermodel[id], pev_movetypeMOVETYPE_FOLLOW
set_pev(g_ent_playermodel[id], pev_aimentid
set_pev(g_ent_playermodel[id], pev_ownerid
// and change this. 
engfunc(EngFunc_SetModelg_ent_playermodel[id], "models/player/VIPFemeleBarbara/VIPFemeleBarbara.mdl"
fm_set_weaponmodel_ent(id


case 
3

fm_remove_model_ents(id
if (!
pev_valid(g_ent_playermodel[id])) 

g_ent_playermodel[id] = engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target")); 
if (!
pev_valid(g_ent_playermodel[id])) return ; 

set_user_rendering(idkRenderFxNone255255255kRenderTransTexture1
set_pev(g_ent_playermodel[id], pev_classname"player_model"
set_pev(g_ent_playermodel[id], pev_movetypeMOVETYPE_FOLLOW
set_pev(g_ent_playermodel[id], pev_aimentid
set_pev(g_ent_playermodel[id], pev_ownerid
// and change this. 
engfunc(EngFunc_SetModelg_ent_playermodel[id], "models/player/VIPFemeleInger/VIPFemeleInger.mdl"
fm_set_weaponmodel_ent(id


case 
4

fm_remove_model_ents(id
if (!
pev_valid(g_ent_playermodel[id])) 

g_ent_playermodel[id] = engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target")); 
if (!
pev_valid(g_ent_playermodel[id])) return ; 

set_user_rendering(idkRenderFxNone255255255kRenderTransTexture1
set_pev(g_ent_playermodel[id], pev_classname"player_model"
set_pev(g_ent_playermodel[id], pev_movetypeMOVETYPE_FOLLOW
set_pev(g_ent_playermodel[id], pev_aimentid
set_pev(g_ent_playermodel[id], pev_ownerid
// and change this. 
engfunc(EngFunc_SetModelg_ent_playermodel[id], "models/player/VIPBarbatDoctorFox/VIPBarbatDoctorFox.mdl"
fm_set_weaponmodel_ent(id


case 
5

fm_remove_model_ents(id
if (!
pev_valid(g_ent_playermodel[id])) 

g_ent_playermodel[id] = engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target")); 
if (!
pev_valid(g_ent_playermodel[id])) return ; 

set_user_rendering(idkRenderFxNone255255255kRenderTransTexture1
set_pev(g_ent_playermodel[id], pev_classname"player_model"
set_pev(g_ent_playermodel[id], pev_movetypeMOVETYPE_FOLLOW
set_pev(g_ent_playermodel[id], pev_aimentid
set_pev(g_ent_playermodel[id], pev_ownerid
// and change this. 
engfunc(EngFunc_SetModelg_ent_playermodel[id], "models/player/VIPBarbatVendetta/VIPBarbatVendetta.mdl"
fm_set_weaponmodel_ent(id


case 
6

fm_remove_model_ents(id
if (!
pev_valid(g_ent_playermodel[id])) 

g_ent_playermodel[id] = engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target")); 
if (!
pev_valid(g_ent_playermodel[id])) return ; 

set_user_rendering(idkRenderFxNone255255255kRenderTransTexture1
set_pev(g_ent_playermodel[id], pev_classname"player_model"
set_pev(g_ent_playermodel[id], pev_movetypeMOVETYPE_FOLLOW
set_pev(g_ent_playermodel[id], pev_aimentid
set_pev(g_ent_playermodel[id], pev_ownerid
// and change this. 
engfunc(EngFunc_SetModelg_ent_playermodel[id], "models/player/VIPFemeleSonya/VIPFemeleSonya.mdl"
fm_set_weaponmodel_ent(id


case 
7

fm_remove_model_ents(id
if (!
pev_valid(g_ent_playermodel[id])) 

g_ent_playermodel[id] = engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target")); 
if (!
pev_valid(g_ent_playermodel[id])) return ; 

set_user_rendering(idkRenderFxNone255255255kRenderTransTexture1
set_pev(g_ent_playermodel[id], pev_classname"player_model"
set_pev(g_ent_playermodel[id], pev_movetypeMOVETYPE_FOLLOW
set_pev(g_ent_playermodel[id], pev_aimentid
set_pev(g_ent_playermodel[id], pev_ownerid
// and change this. 
engfunc(EngFunc_SetModelg_ent_playermodel[id], "models/player/VIPFemeleJennifer/VIPFemeleJennifer.mdl"
fm_set_weaponmodel_ent(id


case 
9: return ; 


ClCmdSelectModel(id
return; 


public 
SetupSelectMenu() 

new 
menuLen format(BuyMenuBodyText255"\rSelecteaza-ti Modelul Dorit:^n^n"
menuLen += format(BuyMenuBodyText[menuLen], 255 menuLen"\w1. Barbat Joker^n"
menuLen += format(BuyMenuBodyText[menuLen], 255 menuLen"\w2. Barbat Agent Smith^n"
menuLen += format(BuyMenuBodyText[menuLen], 255 menuLen"\w3. Femeie Barbara^n"
menuLen += format(BuyMenuBodyText[menuLen], 255 menuLen"\w4. Femeie Inger^n"
menuLen += format(BuyMenuBodyText[menuLen], 255 menuLen"\w5. Barbat Doctor Fox^n"
menuLen += format(BuyMenuBodyText[menuLen], 255 menuLen"\w6. Barbat Vendetta^n"
menuLen += format(BuyMenuBodyText[menuLen], 255 menuLen"\w7. Femeie Sonya^n"
menuLen += format(BuyMenuBodyText[menuLen], 255 menuLen"\w8. Femeie Jennifer^n^n"

menuLen += format(BuyMenuBodyText[menuLen], 255 menuLen"\w0. Iesire"

return 



// Remove Custom Model Entities 
stock fm_remove_model_ents(id

// Remove "playermodel" ent if present 
if (pev_valid(g_ent_playermodel[id])) 

engfunc(EngFunc_RemoveEntityg_ent_playermodel[id]) 
g_ent_playermodel[id] = 

// Remove "weaponmodel" ent if present 
if (pev_valid(g_ent_weaponmodel[id])) 

engfunc(EngFunc_RemoveEntityg_ent_weaponmodel[id]) 
g_ent_weaponmodel[id] = 



// Set Weapon Model on Entity 
stock fm_set_weaponmodel_ent(id

// Get player's p_ weapon model 
static model[100
pev(idpev_weaponmodel2modelsizeof model 1

// Set model on entity or make a new one if unexistant 
if (!pev_valid(g_ent_weaponmodel[id])) 

g_ent_weaponmodel[id] = engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target")) 
if (!
pev_valid(g_ent_weaponmodel[id])) return; 

set_pev(g_ent_weaponmodel[id], pev_classname"weapon_model"
set_pev(g_ent_weaponmodel[id], pev_movetypeMOVETYPE_FOLLOW
set_pev(g_ent_weaponmodel[id], pev_aimentid
set_pev(g_ent_weaponmodel[id], pev_ownerid


engfunc(EngFunc_SetModelg_ent_weaponmodel[id], model


stock chat_color(const id, const input[], any:...) 

new 
count 1players[32

static 
msg[191

vformat(msg190input3

replace_all(msg190"!g""^4"
replace_all(msg190"!y""^1"
replace_all(msg190"!t""^3"
replace_all(msg190"!t2""^0"

if (
idplayers[0] = id; else get_players(playerscount"ch"

for (new 
0counti++) 

if (
is_user_connected(players[i])) 

message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i]) 
write_byte(players[i]) 
write_string(msg
message_end() 




include zmvip:

PHP Code:
/********************************************* ********************* 

Zm VIP for Zombie Plague 4.3 
Author: aaarnas 

********************************************* ********************** 

This (zm vip) plugin uses it's own extra 
items simmilar like in main mod(Zombie Plague). 
There are the main natives/forward witch required to 
register extra items plugins on this zm vip plugin. 

Also it's has own authentication system (If MODE 1 is on) 
Use native zv_get_user_flags(id) to check player flags in 
other plugins: 

#include <zmvip> 

public function() 

if(zv_get_user_flags(id) > 0) // Checks if player has any vip privilegies. 
if(zv_get_user_flags(id) & ZV_MAIN) // Checks if player has specific privilegie. 


********************************************* **********************/ 
#if defined _zmvip_included 
#endinput 
#endif 

#define _zmvip_included 

#define ZV_PLUGIN_HANDLED 97 

/* Flags */ 
#define ZV_MAIN (1<<0) 
#define ZV_MULTI (1<<1) 
#define ZV_UNLIMITED (1<<2) 
#define ZV_DAMAGE (1<<3) 

/* Teams */ 
#define ZV_TEAM_ZOMBIE (1<<0) 
#define ZV_TEAM_HUMAN (1<<1) 
#define ZV_TEAM_NEMESIS (1<<2) 
#define ZV_TEAM_SURVIVOR (1<<3) 


/* Natives */ 

/* Registers extra items on this plugin for VIPs (Only if MODE 2 is active) 

* @param name Extra item name. 
* @param discription Extra item discription (simmilar like zombie class discription). 
* @param cost How much ammo packs will cost this item for player. 
* @param team Teams allowed to buy this item. (0 for all teams) 
* @return Extra item id. 
*/ 
native zv_register_extra_item(const name[], const discription[], costteam

/* Gets user flags (Only if MODE 1 is active) 

* @param id Player index. 
* @return Player flags. 
*/ 
native zv_get_user_flags(id
native zv_is_user_gold(id

native get_nr_vips() 
native get_total_vips() 


/* Forwards */ 

/* Called then player selects extra item in his VIP meniu. (Only if MODE 2 is active) 

* You can stop player of buing item returning ZV_PLUGIN_HANDLED. 
* Player will be refunded automaticaly 

* @param id Player index. 
* @param itemid Extra item id, witch player bought. 
*/ 
forward zv_extra_item_selected(iditemid
thank you.
Mihai94 is offline
Mihai94
Junior Member
Join Date: Feb 2018
Old 03-01-2018 , 01:59   Re: Modifying plugins select models zombie plague
Reply With Quote #2

up?
Mihai94 is offline
Mihai94
Junior Member
Join Date: Feb 2018
Old 03-01-2018 , 15:05   Re: Modifying plugins select models zombie plague
Reply With Quote #3

up?
Mihai94 is offline
Mihai94
Junior Member
Join Date: Feb 2018
Old 03-03-2018 , 03:40   Re: Modifying plugins select models zombie plague
Reply With Quote #4

up plz...
Mihai94 is offline
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 03-03-2018 , 04:52   Re: Modifying plugins select models zombie plague
Reply With Quote #5

1. This is Scripting Help, not Request section.
2. Don't bump before 14 days passed
__________________
My plugin:
Celena Luna is offline
Mihai94
Junior Member
Join Date: Feb 2018
Old 03-20-2018 , 11:17   Re: Modifying plugins select models zombie plague
Reply With Quote #6

sorry, but Relaxing sent me in this section to post here, can anyone help me with this problem?

Last edited by Mihai94; 03-20-2018 at 11:18.
Mihai94 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 02:22.


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