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

Model By Flag for Zombie Escape Mod (problem) !


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
oTm4n3
Member
Join Date: Jul 2021
Old 07-28-2021 , 15:53   Model By Flag for Zombie Escape Mod (problem) !
Reply With Quote #1


Hello , I'm trying or making a model for the member team, but I'm facing a problem, when I turn into a zombie, it remains the same model as a human.
[HTML]Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team

Warning: Tag mismatch on line 52
Warning: Tag mismatch on line 55
Warning: Tag mismatch on line 66
Warning: Tag mismatch on line 69
Warning: Tag mismatch on line 80
Warning: Tag mismatch on line 83
Warning: Tag mismatch on line 94
Warning: Tag mismatch on line 97
Warning: Tag mismatch on line 108
Warning: Tag mismatch on line 111
Warning: Tag mismatch on line 122
Warning: Tag mismatch on line 125
Warning: Tag mismatch on line 136
Warning: Tag mismatch on line 139
Header size: 368 bytes
Code size: 2876 bytes
Data size: 2084 bytes
Stack/heap size: 16384 bytes; estimated max. usage=781 cells (3124 bytes)
Total requirements: 21712 bytes

14 Warnings.
Done.
PHP Code:

Script sma 
:
[
HTML]// Xavier's Server † Auto-Admin Skin Models Plugin.
// Designed & Developed by, Aditya Ambre [a.k.a. Vladimir Dz].
// Created on 27 Aug 2020.
// Copyrights © 2020 ¦ All Rights Reserved.

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <zombieplague>

public plugin_init() {
    
    
register_plugin("XVSkins †""5.0""oTm4n3")
    
    
register_event("ResetHUD""resetModel""b")
    
    return 
PLUGIN_CONTINUE
}

public 
plugin_precache() {
    
    
// Server-Fondator [Flags - "abcdefghjklmnoprsitu"] .
    
precache_model("models/player/fondator_ct/fondator_ct.mdl")

    
// Owner [Flags - "abcdefghijklmnopqrsux"] .
    
precache_model("models/player/owner_ct/owner_ct.mdl")

    
// Co-Owner [Flags - "abcdefijmnopqrsuv"] .
    
precache_model("models/player/co-owner_ct/co-owner_ct.mdl")
    
    
// Administrator [Flags - "abcdefijmnopqy"] .
    
precache_model("models/player/head-admin_ct/head-admin_ct.mdl")
    
    
// Admin-Helper [Flags - "bcejmno"] .
    
precache_model("models/player/helper-admin_ct/helper-admin_ct.mdl")

    
// Slots [Flags - "bejimw"] .
    
precache_model("models/player/slot_ct/slot_ct.mdl")
    
    
// VIPS [Flags - "b"] .
    
precache_model("models/player/vip_ct/vip_ct.mdl")
    
    return 
PLUGIN_CONTINUE
    
}

public 
resetModel(idlevelcid
{
    
// Server-Fondator 
    
if( has_flagid"t" )) {
        new 
CsTeams:userTeam cs_get_user_team(id)
        if (
userTeam == ZP_TEAM_HUMAN) {
            
cs_set_user_model(id"fondator_ct")
        }
        else if(
userTeam == ZP_TEAM_ZOMBIE) {
            
cs_set_user_model(id"zombie_source")
        }
        else {
            
cs_reset_user_model(id)
        }
    }

    
// Owner
    
else if( has_flagid"x" )) {
        new 
CsTeams:userTeam cs_get_user_team(id)
        if (
userTeam == ZP_TEAM_HUMAN) {
            
cs_set_user_model(id"owner_ct")
        }
        else if(
userTeam == ZP_TEAM_ZOMBIE) {
            
cs_set_user_model(id"zombie_source")
        }
        else {
            
cs_reset_user_model(id)
        }
    }

    
// Co-Owner
    
else if( has_flagid"v" )) {
        new 
CsTeams:userTeam cs_get_user_team(id)
        if (
userTeam == ZP_TEAM_HUMAN) {
            
cs_set_user_model(id"co-owner_ct")
        }
        else if(
userTeam == ZP_TEAM_ZOMBIE) {
            
cs_set_user_model(id"zombie_source")
        }
        else {
            
cs_reset_user_model(id)
        }
    }
    
    
// Administrator 
    
else if( has_flagid"y" )) {
        new 
CsTeams:userTeam cs_get_user_team(id)
        if (
userTeam == ZP_TEAM_HUMAN) {
            
cs_set_user_model(id"head-admin_ct")
        }
        else if(
userTeam == ZP_TEAM_ZOMBIE) {
            
cs_set_user_model(id"zombie_source")
        }
        else {
            
cs_reset_user_model(id)
        }
    }

    
// Admin-Helper 
    
else if( has_flagid"o" )) {
        new 
CsTeams:userTeam cs_get_user_team(id)
        if (
userTeam == ZP_TEAM_HUMAN) {
            
cs_set_user_model(id"helper-admin_ct")
        }
        else if(
userTeam == ZP_TEAM_ZOMBIE) {
            
cs_set_user_model(id"zombie_source")
        }
        else {
            
cs_reset_user_model(id)
        }
    }
    
    
// Slots 
    
else if( has_flagid"w" )) {
        new 
CsTeams:userTeam cs_get_user_team(id)
        if (
userTeam == ZP_TEAM_HUMAN) {
            
cs_set_user_model(id"slot_ct")
        }
        else if(
userTeam == ZP_TEAM_ZOMBIE) {
            
cs_set_user_model(id"zombie_source")
        }
        else {
            
cs_reset_user_model(id)
        }
    }

    
// VIPS 
    
else if( has_flagid"b" )) {
        new 
CsTeams:userTeam cs_get_user_team(id)
        if (
userTeam == ZP_TEAM_HUMAN) {
            
cs_set_user_model(id"vip_ct")
        }
        else if(
userTeam == ZP_TEAM_ZOMBIE) {
            
cs_set_user_model(id"zp_get_user_zombie")
        }
        else {
            
cs_reset_user_model(id)
        }
    }

    return 
PLUGIN_CONTINUE


Last edited by oTm4n3; 07-28-2021 at 22:49.
oTm4n3 is offline
lexzor
Veteran Member
Join Date: Nov 2020
Old 07-28-2021 , 20:09   Re: Model By Flag for Zombie Escape Mod (problem) !
Reply With Quote #2

First of all, you don't have to use return value in every function because the compiler add return 0 at the end of it.
Personal, i use it after i use return PLUGIN_HANDLED and you are using an old compiler. I recommend you version 1.9

This is how your plugin should look to don't be so hardcoded [NOT TESTED]
PHP Code:
#include <amxmodx>
#include <zombieplague>
#include <cstrike>
#include <hamsandwich>

new const g_szHuman[][] = //using this method is more easy to precache models and you can use loops to check if user has a specific flag
{
    
"fondator_ct",
    
"owner_ct",
    
"co-owner_ct",
    
"head-admin_ct" //and so on
}

new const 
g_szZombie[][] = 
{
    
"zombie_source",
    
"another_skin",
    
"another_skin2",
    
"another_skin3"
}

new const 
g_szAcces[][] =
{
    
"abcdefghjklmnoprsitu"//fondator
    
"abcdefghijklmnopqrsux"//owner
    
"abcdefijmnopqrsuv"//co-owner
    
"abcdefijmnopqy" //head-admin
}

public 
plugin_init() {
    
    
register_plugin("XVSkins †""5.0""oTm4n3")

    
register_logevent("round_start"2"1=Round_Start"// you have to reset players models 
    
    
return PLUGIN_CONTINUE
}

public 
plugin_precache() {
    
    
//create 2 strings
    
new szHuman[64];
    new 
szZombie[64];

    for(new 
0sizeof(g_szHuman); i++) // if you don't know what loops are -> https://wiki.alliedmods.net/Pawn_tutorial#For_Loops
    
{
        
formatex(szHumancharsmax(szHuman), "models/player/%s/%s.mdl"g_szHuman[i]); // format the string with model location to precache it
        
precache_model(szHuman); // use the string to precache the model

        
formatex(szZombiecharsmax(szZombie), "models/player/%s/%s.mdl"g_szZombie[i]); // doing same thing as above for zombies model
        
precache_model(szZombie);
    }
}

public 
round_start(id)
{
    if(
is_user_alive(id))
        
cs_reset_user_model(id);
}

public 
zp_user_infected_post(id// this is a predefinited function from zombieplague library
{
    if(!
is_user_alive(id)) // you must check if the player is alive first of all (every time in situations like this)
        
return PLUGIN_HANDLED;

    for(new 
0sizeof(g_szAcces); i++ )
    {
        if(
get_user_flags(id) & read_flags(g_szAcces[i])) // check if the player has the flag
        
{
            switch(
zp_get_user_zombie(id)) // i didn t find anything about this native, but let's say it will return 1 if player is zombie and 0 if human
            
{
                case 
1cs_set_user_model(idg_szZombie[i]); // set zombie model if he's zombie
                
case 0cs_set_user_model(idg_szHuman[i]); // set human model if he's human
                
default: cs_reset_user_model(id); 
            }
        }
        else 
        {
            
cs_reset_user_model(id); // reset user model if he s not an admin (this can overlap with other plugin that are doing same thing)
        
}
    }

    return 
PLUGIN_CONTINUE;

I recommend you to use this api to set players model: https://forums.alliedmods.net/showthread.php?t=161255

Also, if you model have a T model (model_nameT.mdl) you can do something like this: https://forums.alliedmods.net/showpo...78&postcount=6



i hope i helped you

Last edited by lexzor; 07-28-2021 at 20:19.
lexzor is offline
Old 07-28-2021, 21:35
oTm4n3
This message has been deleted by oTm4n3.
oTm4n3
Member
Join Date: Jul 2021
Old 07-28-2021 , 21:36   Re: Model By Flag for Zombie Escape Mod (problem) !
Reply With Quote #3

Quote:
Originally Posted by lexzor View Post
First of all, you don't have to use return value in every function because the compiler add return 0 at the end of it.
Personal, i use it after i use return PLUGIN_HANDLED and you are using an old compiler. I recommend you version 1.9

This is how your plugin should look to don't be so hardcoded [NOT TESTED]
PHP Code:
#include <amxmodx>
#include <zombieplague>
#include <cstrike>
#include <hamsandwich>

new const g_szHuman[][] = //using this method is more easy to precache models and you can use loops to check if user has a specific flag
{
    
"fondator_ct",
    
"owner_ct",
    
"co-owner_ct",
    
"head-admin_ct" //and so on
}

new const 
g_szZombie[][] = 
{
    
"zombie_source",
    
"another_skin",
    
"another_skin2",
    
"another_skin3"
}

new const 
g_szAcces[][] =
{
    
"abcdefghjklmnoprsitu"//fondator
    
"abcdefghijklmnopqrsux"//owner
    
"abcdefijmnopqrsuv"//co-owner
    
"abcdefijmnopqy" //head-admin
}

public 
plugin_init() {
    
    
register_plugin("XVSkins †""5.0""oTm4n3")

    
register_logevent("round_start"2"1=Round_Start"// you have to reset players models 
    
    
return PLUGIN_CONTINUE
}

public 
plugin_precache() {
    
    
//create 2 strings
    
new szHuman[64];
    new 
szZombie[64];

    for(new 
0sizeof(g_szHuman); i++) // if you don't know what loops are -> https://wiki.alliedmods.net/Pawn_tutorial#For_Loops
    
{
        
formatex(szHumancharsmax(szHuman), "models/player/%s/%s.mdl"g_szHuman[i]); // format the string with model location to precache it
        
precache_model(szHuman); // use the string to precache the model

        
formatex(szZombiecharsmax(szZombie), "models/player/%s/%s.mdl"g_szZombie[i]); // doing same thing as above for zombies model
        
precache_model(szZombie);
    }
}

public 
round_start(id)
{
    if(
is_user_alive(id))
        
cs_reset_user_model(id);
}

public 
zp_user_infected_post(id// this is a predefinited function from zombieplague library
{
    if(!
is_user_alive(id)) // you must check if the player is alive first of all (every time in situations like this)
        
return PLUGIN_HANDLED;

    for(new 
0sizeof(g_szAcces); i++ )
    {
        if(
get_user_flags(id) & read_flags(g_szAcces[i])) // check if the player has the flag
        
{
            switch(
zp_get_user_zombie(id)) // i didn t find anything about this native, but let's say it will return 1 if player is zombie and 0 if human
            
{
                case 
1cs_set_user_model(idg_szZombie[i]); // set zombie model if he's zombie
                
case 0cs_set_user_model(idg_szHuman[i]); // set human model if he's human
                
default: cs_reset_user_model(id); 
            }
        }
        else 
        {
            
cs_reset_user_model(id); // reset user model if he s not an admin (this can overlap with other plugin that are doing same thing)
        
}
    }

    return 
PLUGIN_CONTINUE;

I recommend you to use this api to set players model: https://forums.alliedmods.net/showthread.php?t=161255

Also, if you model have a T model (model_nameT.mdl) you can do something like this: https://forums.alliedmods.net/showpo...78&postcount=6



i hope i helped you
Thank you very much for your help, after trying the script with some modifications (flag) did not work for me the skin are not loaded , I just want to get something Work to change the model of (human only) Without loop (evrey flag with single skine) to the following flags:
PHP Code:
Fondator
"nick" "password" "abcdefghjklmnoprsiut" "a"

OWNER
"nick" "password" "abcdefghijklmnopqrsux" "a"

Co-Owner
"nick" "password" "abcdefijmnopqrsuv" "a"

Administrator
"nick" "password" "abcdefijmnopqy" "a"

Admin-Helper
"nick" "password" "bcejmno" "a"

Slots
"nick" "password" "bejimw" "a"

;VIPS
nick
" "password" "b" "a
PHP Code:
#include <amxmodx>
#include <zombieplague>
#include <cstrike>
#include <hamsandwich>

new const g_szHuman[][] = //using this method is more easy to precache models and you can use loops to check if user has a specific flag
{
    
"fondator_ct",
    
"owner_ct",
    
"co-owner_ct",
    
"head-admin_ct" //and so on
}

new const 
g_szZombie[][] = 
{
    
"zombie_source",
    
"zombie_source",
    
"zombie_source",
    
"zombie_source"
}

new const 
g_szAcces[][] =
{
    
"t"//fondator
    
"x"//owner
    
"v"//co-owner
    
"y" //head-admin

}

public 
plugin_init() {
    
    
register_plugin("XVSkins †""5.0""oTm4n3")

    
register_logevent("round_start"2"1=Round_Start"// you have to reset players models 
    
    
return PLUGIN_CONTINUE
}

public 
plugin_precache() {
    
    
//create 2 strings
    
new szHuman[64];
    new 
szZombie[64];

    for(new 
0sizeof(g_szHuman); i++) // if you don't know what loops are -> https://wiki.alliedmods.net/Pawn_tutorial#For_Loops
    
{
        
formatex(szHumancharsmax(szHuman), "models/player/%s/%s.mdl"g_szHuman[i]); // format the string with model location to precache it
        
precache_model(szHuman); // use the string to precache the model

        
formatex(szZombiecharsmax(szZombie), "models/player/%s/%s.mdl"g_szZombie[i]); // doing same thing as above for zombies model
        
precache_model(szZombie);
    }
}

public 
round_start(id)
{
    if(
is_user_alive(id))
        
cs_reset_user_model(id);
}

public 
zp_user_infected_post(id// this is a predefinited function from zombieplague library
{
    if(!
is_user_alive(id)) // you must check if the player is alive first of all (every time in situations like this)
        
return PLUGIN_HANDLED;

    for(new 
0sizeof(g_szAcces); i++ )
    {
        if(
get_user_flags(id) & read_flags(g_szAcces[i])) // check if the player has the flag
        
{
            switch(
zp_get_user_zombie(id)) // i didn t find anything about this native, but let's say it will return 1 if player is zombie and 0 if human
            
{
                case 
1cs_set_user_model(idg_szZombie[i]); // set zombie model if he's zombie
                
case 0cs_set_user_model(idg_szHuman[i]); // set human model if he's human
                
default: cs_reset_user_model(id); 
            }
        }
        else 
        {
            
cs_reset_user_model(id); // reset user model if he s not an admin (this can overlap with other plugin that are doing same thing)
        
}
    }

    return 
PLUGIN_CONTINUE;


Last edited by oTm4n3; 07-28-2021 at 22:50.
oTm4n3 is offline
oTm4n3
Member
Join Date: Jul 2021
Old 07-28-2021 , 21:52   Re: Model By Flag for Zombie Escape Mod (problem) !
Reply With Quote #4

after enable debug
PHP Code:
Log:
L 07/29/2021 01:50:34String formatted incorrectly parameter 5 (total 4)

L 07/29/2021 01:50:34: [AMXXDisplaying debug trace (plugin "xvskins.amxx"version "unknown")

L 07/29/2021 01:50:34: [AMXXRun time error 25parameter error 

L 07
/29/2021 01:50:34: [AMXX]    [0xvskins.sma::plugin_precache (line 48

Last edited by oTm4n3; 07-28-2021 at 22:46.
oTm4n3 is offline
lexzor
Veteran Member
Join Date: Nov 2020
Old 07-28-2021 , 22:33   Re: Model By Flag for Zombie Escape Mod (problem) !
Reply With Quote #5

PHP Code:
#include <amxmodx>
#include <zombieplague>
#include <cstrike>
#include <hamsandwich>

new const g_szHuman[][] = //using this method is more easy to precache models and you can use loops to check if user has a specific flag
{
    
"fondator_ct",
    
"owner_ct",
    
"co-owner_ct",
    
"head-admin_ct" //and so on
}

new const 
g_szZombie[][] = 
{
    
"zombie_source",
    
"zombie_source",
    
"zombie_source",
    
"zombie_source"
}

new const 
g_szAcces[][] =
{
    
"t"//fondator
    
"x"//owner
    
"v"//co-owner
    
"y" //head-admin

}

public 
plugin_init() {
    
    
register_plugin("XVSkins †""5.0""oTm4n3")

    
register_logevent("round_start"2"1=Round_Start"// you have to reset players models 
    
    
return PLUGIN_CONTINUE
}

public 
plugin_precache() {
    
    
//create 2 strings
    
new szHuman[64];
    new 
szZombie[64];

    for(new 
0sizeof(g_szHuman); i++) // if you don't know what loops are -> https://wiki.alliedmods.net/Pawn_tutorial#For_Loops
    
{
        
formatex(szHumancharsmax(szHuman), "models/player/%s/%s.mdl"g_szHuman[i], g_szHuman[i]); // format the string with model location to precache it
        
precache_model(szHuman); // use the string to precache the model

        
formatex(szZombiecharsmax(szZombie), "models/player/%s/%s.mdl"g_szZombie[i], g_szZombie[i]); // doing same thing as above for zombies model
        
precache_model(szZombie);
    }
}

public 
round_start(id)
{
    if(
is_user_alive(id))
        
cs_reset_user_model(id);
}

public 
zp_user_infected_post(id// this is a predefinited function from zombieplague library
{
    if(!
is_user_alive(id)) // you must check if the player is alive first of all (every time in situations like this)
        
return PLUGIN_HANDLED;

    for(new 
0sizeof(g_szAcces); i++ )
    {
        if(
get_user_flags(id) & read_flags(g_szAcces[i])) // check if the player has the flag
        
{
            switch(
zp_get_user_zombie(id)) // i didn t find anything about this native, but let's say it will return 1 if player is zombie and 0 if human
            
{
                case 
1cs_set_user_model(idg_szZombie[i]); // set zombie model if he's zombie
                
case 0cs_set_user_model(idg_szHuman[i]); // set human model if he's human
                
default: cs_reset_user_model(id); 
            }
        }
        else 
        {
            
cs_reset_user_model(id); // reset user model if he s not an admin (this can overlap with other plugin that are doing same thing)
        
}
    }

    return 
PLUGIN_CONTINUE;

use [ php ] [ /php ] for code

docs for switch statement: https://wiki.alliedmods.net/Pawn_tut...tch_Statements

Last edited by lexzor; 07-28-2021 at 22:35.
lexzor is offline
oTm4n3
Member
Join Date: Jul 2021
Old 07-28-2021 , 22:41   Re: Model By Flag for Zombie Escape Mod (problem) !
Reply With Quote #6

Thanks , i will use php ] [ /php ] next time sire !

Last edited by oTm4n3; 07-28-2021 at 22:41.
oTm4n3 is offline
oTm4n3
Member
Join Date: Jul 2021
Old 07-29-2021 , 06:38   Re: Model By Flag for Zombie Escape Mod (problem) !
Reply With Quote #7

any one can help me ?
oTm4n3 is offline
lexzor
Veteran Member
Join Date: Nov 2020
Old 07-29-2021 , 11:29   Re: Model By Flag for Zombie Escape Mod (problem) !
Reply With Quote #8

With what? I posted the plugin you have just to compile it and add it to your server :-s or you can change it how you want

Last edited by lexzor; 07-29-2021 at 11:31.
lexzor is offline
oTm4n3
Member
Join Date: Jul 2021
Old 07-29-2021 , 17:49   Re: Model By Flag for Zombie Escape Mod (problem) !
Reply With Quote #9

Quote:
Originally Posted by lexzor View Post
With what? I posted the plugin you have just to compile it and add it to your server :-s or you can change it how you want
yeah but its not work
oTm4n3 is offline
1M1e
Member
Join Date: Mar 2020
Old 07-30-2021 , 04:34   Re: Model By Flag for Zombie Escape Mod (problem) !
Reply With Quote #10

if you want players model i have one and its working good but its zombie escape you just want to change the include and ze_user_humanized and ze_is_user_zombie

and ofc change the models flags and the models

flags ->
PHP Code:
new g_szAccess_player_vip_models[2] = "m"
new g_szAccess_admin_models[2] = "o"
new g_szAccess_jocker_models[2] = "n"
new g_szAccess_vip_models[2] = "s"
new g_szAccess_dorothy_models[2] = "p"
new g_szAccess_flora_models[2] = "q"
new g_szAccess_ChoiJiYoon_models[2] = "y"
new g_szAccess_deadpool_models[2] = "w"
new g_szAccess_assassincreed_models[2] = "v" 
models->
PHP Code:
new const szDorothyModel[][] = 
{
    
"Dorothy_Dark_Knight"
}

new const 
szAssassinCreedModel[][] = 
{
    
"AssassinCreed"
}

new const 
szDeadPoolModel[][] = 
{
    
"DeadPool"
}

new const 
szChoiJiYoonModel[][] = 
{
    
"Choi_Ji_Yoon"
}

new const 
szFloraModel[][] = 
{
    
"Flora_Paladin"
}

new const 
szJokerModel[][] = 
{
    
"Joker"
}

new const 
szAgentSmithModel[][] = 
{
    
"agent_smith"
}

new const 
szVipHumanModel[][] = 
{
    
"human_vip"
}

new const 
szVipZombieModel[][] = 
{
    
"zombie_vip"
}

new const 
v_szVipZombieKnifeModel[][] = 
{
    
"models/StonerServerWeaponsModels/v_knife_zombie_vip.mdl"

the plugin ->
PHP Code:
#include <zombie_escape>



// Defines
#define MODEL_MAX_LENGTH 64
#define PLAYERMODEL_MAX_LENGTH 32
#define ACCESS_MAX_LENGTH 32
new g_szAccess_player_vip_models[2] = "m"
new g_szAccess_admin_models[2] = "o"
new g_szAccess_jocker_models[2] = "n"
new g_szAccess_vip_models[2] = "s"
new g_szAccess_dorothy_models[2] = "p"
new g_szAccess_flora_models[2] = "q"
new g_szAccess_ChoiJiYoon_models[2] = "y"
new g_szAccess_deadpool_models[2] = "w"
new g_szAccess_assassincreed_models[2] = "v"


new const szDorothyModel[][] = 
{
    
"Dorothy_Dark_Knight"
}

new const 
szAssassinCreedModel[][] = 
{
    
"AssassinCreed"
}

new const 
szDeadPoolModel[][] = 
{
    
"DeadPool"
}

new const 
szChoiJiYoonModel[][] = 
{
    
"Choi_Ji_Yoon"
}

new const 
szFloraModel[][] = 
{
    
"Flora_Paladin"
}

new const 
szJokerModel[][] = 
{
    
"Joker"
}

new const 
szAgentSmithModel[][] = 
{
    
"agent_smith"
}

new const 
szVipHumanModel[][] = 
{
    
"human_vip"
}

new const 
szVipZombieModel[][] = 
{
    
"zombie_vip"
}

new const 
v_szVipZombieKnifeModel[][] = 
{
    
"models/StonerServerWeaponsModels/v_knife_zombie_vip.mdl"
}

// Dynamic Arrays: Models
new Array:g_szVipHumanModel, Array:g_szVipZombieModel, Array:g_v_szVipZombieKnifeModel, Array:g_szJokerModel, Array:g_szAgentSmithModel, Array:g_szDorothyModel, Array:g_szFloraModel,
Array:
g_szAssassinCreedModel, Array:g_szDeadPoolModel, Array:g_szChoiJiYoonModel

public plugin_init()
{
    
register_plugin("[ZE] Special Models"ZE_VERSIONAUTHORS)
}

public 
plugin_precache()
{
    
// Initialize Arrays
    
g_szDorothyModel ArrayCreate(PLAYERMODEL_MAX_LENGTH1)
    
g_szFloraModel ArrayCreate(PLAYERMODEL_MAX_LENGTH1)
    
g_szAgentSmithModel ArrayCreate(PLAYERMODEL_MAX_LENGTH1)
    
g_szJokerModel ArrayCreate(PLAYERMODEL_MAX_LENGTH1)
    
g_szVipHumanModel ArrayCreate(PLAYERMODEL_MAX_LENGTH1)
    
g_szVipZombieModel ArrayCreate(PLAYERMODEL_MAX_LENGTH1)
    
g_v_szVipZombieKnifeModel ArrayCreate(MODEL_MAX_LENGTH1)
    
g_szAssassinCreedModel ArrayCreate(PLAYERMODEL_MAX_LENGTH1)
    
g_szDeadPoolModel ArrayCreate(PLAYERMODEL_MAX_LENGTH1)
    
g_szChoiJiYoonModel ArrayCreate(PLAYERMODEL_MAX_LENGTH1)
    
    
// Load our Default Values
    
new iIndex
    
    
if(ArraySize(g_szDorothyModel) == 0)
    {
        for(
iIndex 0iIndex sizeof szDorothyModeliIndex++)
            
ArrayPushString(g_szDorothyModelszDorothyModel[iIndex])
        

    }
    
    if(
ArraySize(g_szAssassinCreedModel) == 0)
    {
        for(
iIndex 0iIndex sizeof szAssassinCreedModeliIndex++)
            
ArrayPushString(g_szAssassinCreedModelszAssassinCreedModel[iIndex])
        

    }
    
    if(
ArraySize(g_szDeadPoolModel) == 0)
    {
        for(
iIndex 0iIndex sizeof szDeadPoolModeliIndex++)
            
ArrayPushString(g_szDeadPoolModelszDeadPoolModel[iIndex])
        

    }
    
    if(
ArraySize(g_szChoiJiYoonModel) == 0)
    {
        for(
iIndex 0iIndex sizeof szChoiJiYoonModeliIndex++)
            
ArrayPushString(g_szChoiJiYoonModelszChoiJiYoonModel[iIndex])
        

    }
    
    if(
ArraySize(g_szFloraModel) == 0)
    {
        for(
iIndex 0iIndex sizeof szFloraModeliIndex++)
            
ArrayPushString(g_szFloraModelszFloraModel[iIndex])

    }
    
    if(
ArraySize(g_szAgentSmithModel) == 0)
    {
        for(
iIndex 0iIndex sizeof szAgentSmithModeliIndex++)
            
ArrayPushString(g_szAgentSmithModelszAgentSmithModel[iIndex])
        

    }    

    if(
ArraySize(g_szJokerModel) == 0)
    {
        for(
iIndex 0iIndex sizeof szJokerModeliIndex++)
            
ArrayPushString(g_szJokerModelszJokerModel[iIndex])
        

    }            
    
    if(
ArraySize(g_szVipHumanModel) == 0)
    {
        for(
iIndex 0iIndex sizeof szVipHumanModeliIndex++)
            
ArrayPushString(g_szVipHumanModelszVipHumanModel[iIndex])
        

    }
    
    if(
ArraySize(g_szVipZombieModel) == 0)
    {
        for(
iIndex 0iIndex sizeof szVipZombieModeliIndex++)
            
ArrayPushString(g_szVipZombieModelszVipZombieModel[iIndex])
        

    }
    
    if(
ArraySize(g_v_szVipZombieKnifeModel) == 0)
    {
        for(
iIndex 0iIndex sizeof v_szVipZombieKnifeModeliIndex++)
            
ArrayPushString(g_v_szVipZombieKnifeModelv_szVipZombieKnifeModel[iIndex])
        

    }
    
    

    
// Precache
    
new szPlayerModel[PLAYERMODEL_MAX_LENGTH], szModel[MODEL_MAX_LENGTH], szModelPath[128]
    
    for (
iIndex 0iIndex ArraySize(g_szDorothyModel); iIndex++)
    {
        
ArrayGetString(g_szDorothyModeliIndexszPlayerModelcharsmax(szPlayerModel))
        
formatex(szModelPathcharsmax(szModelPath), "models/player/%s/%s.mdl"szPlayerModelszPlayerModel)
        
precache_model(szModelPath)
    }
    
    for (
iIndex 0iIndex ArraySize(g_szAssassinCreedModel); iIndex++)
    {
        
ArrayGetString(g_szAssassinCreedModeliIndexszPlayerModelcharsmax(szPlayerModel))
        
formatex(szModelPathcharsmax(szModelPath), "models/player/%s/%s.mdl"szPlayerModelszPlayerModel)
        
precache_model(szModelPath)
    }
    
    for (
iIndex 0iIndex ArraySize(g_szDeadPoolModel); iIndex++)
    {
        
ArrayGetString(g_szDeadPoolModeliIndexszPlayerModelcharsmax(szPlayerModel))
        
formatex(szModelPathcharsmax(szModelPath), "models/player/%s/%s.mdl"szPlayerModelszPlayerModel)
        
precache_model(szModelPath)
    }
    
    for (
iIndex 0iIndex ArraySize(g_szChoiJiYoonModel); iIndex++)
    {
        
ArrayGetString(g_szChoiJiYoonModeliIndexszPlayerModelcharsmax(szPlayerModel))
        
formatex(szModelPathcharsmax(szModelPath), "models/player/%s/%s.mdl"szPlayerModelszPlayerModel)
        
precache_model(szModelPath)
    }
    
    for (
iIndex 0iIndex ArraySize(g_szFloraModel); iIndex++)
    {
        
ArrayGetString(g_szFloraModeliIndexszPlayerModelcharsmax(szPlayerModel))
        
formatex(szModelPathcharsmax(szModelPath), "models/player/%s/%s.mdl"szPlayerModelszPlayerModel)
        
precache_model(szModelPath)
    }

    for (
iIndex 0iIndex ArraySize(g_szAgentSmithModel); iIndex++)
    {
        
ArrayGetString(g_szAgentSmithModeliIndexszPlayerModelcharsmax(szPlayerModel))
        
formatex(szModelPathcharsmax(szModelPath), "models/player/%s/%s.mdl"szPlayerModelszPlayerModel)
        
precache_model(szModelPath)
    }    
    
    for (
iIndex 0iIndex ArraySize(g_szJokerModel); iIndex++)
    {
        
ArrayGetString(g_szJokerModeliIndexszPlayerModelcharsmax(szPlayerModel))
        
formatex(szModelPathcharsmax(szModelPath), "models/player/%s/%s.mdl"szPlayerModelszPlayerModel)
        
precache_model(szModelPath)
    }
    
    for (
iIndex 0iIndex ArraySize(g_szVipHumanModel); iIndex++)
    {
        
ArrayGetString(g_szVipHumanModeliIndexszPlayerModelcharsmax(szPlayerModel))
        
formatex(szModelPathcharsmax(szModelPath), "models/player/%s/%s.mdl"szPlayerModelszPlayerModel)
        
precache_model(szModelPath)
    }
    
    for (
iIndex 0iIndex ArraySize(g_szVipZombieModel); iIndex++)
    {
        
ArrayGetString(g_szVipZombieModeliIndexszPlayerModelcharsmax(szPlayerModel))
        
formatex(szModelPathcharsmax(szModelPath), "models/player/%s/%s.mdl"szPlayerModelszPlayerModel)
        
precache_model(szModelPath)
    }
    
    for (
iIndex 0iIndex ArraySize(g_v_szVipZombieKnifeModel); iIndex++)
    {
        
ArrayGetString(g_v_szVipZombieKnifeModeliIndexszModelcharsmax(szModel))
        
precache_model(szModel)
    }
}

public 
ze_user_humanized(id)
{
    if(
ze_is_user_zombie(id) || !is_user_alive(id))
        return
        
    new 
szPlayerModel[PLAYERMODEL_MAX_LENGTH]



    if (
get_user_flags(id) & (read_flags(g_szAccess_dorothy_models)))
    {
        
ArrayGetString(g_szDorothyModelrandom_num(0ArraySize(g_szDorothyModel) - 1), szPlayerModelcharsmax(szPlayerModel))
        
rg_set_user_model(idszPlayerModel)
    }
    
    else if (
get_user_flags(id) & (read_flags(g_szAccess_flora_models)))
    {
        
ArrayGetString(g_szFloraModelrandom_num(0ArraySize(g_szFloraModel) - 1), szPlayerModelcharsmax(szPlayerModel))
        
rg_set_user_model(idszPlayerModel)
    }
    
    else if (
get_user_flags(id) & (read_flags(g_szAccess_assassincreed_models)))
    {
        
ArrayGetString(g_szAssassinCreedModelrandom_num(0ArraySize(g_szAssassinCreedModel) - 1), szPlayerModelcharsmax(szPlayerModel))
        
rg_set_user_model(idszPlayerModel)
    }
    
    else if (
get_user_flags(id) & (read_flags(g_szAccess_deadpool_models)))
    {
        
ArrayGetString(g_szDeadPoolModelrandom_num(0ArraySize(g_szDeadPoolModel) - 1), szPlayerModelcharsmax(szPlayerModel))
        
rg_set_user_model(idszPlayerModel)
    }
    
    else if (
get_user_flags(id) & (read_flags(g_szAccess_ChoiJiYoon_models)))
    {
        
ArrayGetString(g_szChoiJiYoonModelrandom_num(0ArraySize(g_szChoiJiYoonModel) - 1), szPlayerModelcharsmax(szPlayerModel))
        
rg_set_user_model(idszPlayerModel)
    }
    
    else if (
get_user_flags(id) & (read_flags(g_szAccess_admin_models)))
    {
        
ArrayGetString(g_szAgentSmithModelrandom_num(0ArraySize(g_szAgentSmithModel) - 1), szPlayerModelcharsmax(szPlayerModel))
        
rg_set_user_model(idszPlayerModel)
    }    
    
    else if (
get_user_flags(id) & (read_flags(g_szAccess_jocker_models)))
    {
        
ArrayGetString(g_szJokerModelrandom_num(0ArraySize(g_szJokerModel) - 1), szPlayerModelcharsmax(szPlayerModel))
        
rg_set_user_model(idszPlayerModel)
    }
    
    
    else if (
get_user_flags(id) & (read_flags(g_szAccess_player_vip_models)))
    {
        
ArrayGetString(g_szVipHumanModelrandom_num(0ArraySize(g_szVipHumanModel) - 1), szPlayerModelcharsmax(szPlayerModel))
        
rg_set_user_model(idszPlayerModel)
        
    }
}

public 
ze_user_infected(iVictimiInfector)
{
    if(!
is_user_alive(iVictim))
        return
        
    
// Set Zombie Models
    
new szPlayerModel[PLAYERMODEL_MAX_LENGTH], szModel[MODEL_MAX_LENGTH]

    if (
get_user_flags(iVictim) & (read_flags(g_szAccess_vip_models)))
    {
        
// Set Zombie Vip Model
        
ArrayGetString(g_szVipZombieModelrandom_num(0ArraySize(g_szVipZombieModel) - 1), szPlayerModelcharsmax(szPlayerModel))
        
rg_set_user_model(iVictimszPlayerModel)
        
        
// Set Vip Zombie Knife Model
        
ArrayGetString(g_v_szVipZombieKnifeModelrandom_num(0ArraySize(g_v_szVipZombieKnifeModel) - 1), szModelcharsmax(szModel))
        
cs_set_player_view_model(iVictimCSW_KNIFEszModel)
        
cs_set_player_weap_model(iVictimCSW_KNIFE""// Leave Blank so knife not appear with zombies
    
}


Last edited by 1M1e; 07-30-2021 at 04:40.
1M1e 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 19:31.


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