This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Deathrun vip plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
luci2k
Junior Member
Join Date: Jan 2020
Old 01-21-2020 , 13:19   Deathrun vip plugin
Reply With Quote #1

i use to have a plugin on my server back in 2014 or something for vip players but i am to rusty to do it right now and thats why i am here.

i need a plugin that give V.i.P players :
150 hp
150 Armor
knife model : https://gamebanana.com/gamefiles/10738
player model : https://gamebanana.com/skins/123445
/respawn up to two times every round (after they use /respawn two times, a message shows in chat "You can use /respawn again next round" or something like that
V.I.P in Tab and when the vip player types in chat [V.I.P] in front of the player names ex "
[V.I.P] luci2k : hello
Ps: i want V.I.P players to type with yellow in chat .
Ps2: this plugin can help with the models and fuctions of the vip knife, when you join the server it change your knife to a butcher knife with gravity for deathrun,i want vip players to have the skins when they join.
Link: https://forums.alliedmods.net/showthread.php?t=320960

Last edited by luci2k; 01-21-2020 at 13:24.
luci2k is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 01-21-2020 , 17:12   Re: Deathrun vip plugin
Reply With Quote #2

Okay so a few points:

1) What flags do your VIP's have?
2) Why u want to display yellow text in chat when yellow is the default color for chat messages? I'll just be using client_print() then to be honest.
3) What functions should the vip knife have? Should these functions also work even though the player is not currently wearing his knife?

What my plugin does that u just shared, is giving gravity when the player wears the knife, as soon as he changes his weapon to a gun, his gravity will be reset to normal.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
luci2k
Junior Member
Join Date: Jan 2020
Old 01-21-2020 , 18:03   Re: Deathrun vip plugin
Reply With Quote #3

Quote:
Originally Posted by Napoleon_be View Post
Okay so a few points:

1) What flags do your VIP's have?
2) Why u want to display yellow text in chat when yellow is the default color for chat messages? I'll just be using client_print() then to be honest.
3) What functions should the vip knife have? Should these functions also work even though the player is not currently wearing his knife?

What my plugin does that u just shared, is giving gravity when the player wears the knife, as soon as he changes his weapon to a gun, his gravity will be reset to normal.
1. B H
2. good point , make it green, also the name of the player should be green in chat. Something like this : [V.I.P] luci2k : hello
3.The vip knife i want just to be the knife plugin that you already made for me but with that fade model. Same speed and gravity as that one but diferent model.
luci2k is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 01-21-2020 , 18:22   Re: Deathrun vip plugin
Reply With Quote #4

Do you already have a folder with the model in it? If so, please let me know so that i can use that path in the code.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
luci2k
Junior Member
Join Date: Jan 2020
Old 01-21-2020 , 18:36   Re: Deathrun vip plugin
Reply With Quote #5

Quote:
Originally Posted by Napoleon_be View Post
Do you already have a folder with the model in it? If so, please let me know so that i can use that path in the code.
no. i don't have a folder.

Last edited by luci2k; 01-21-2020 at 18:37.
luci2k is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 01-21-2020 , 19:08   Re: Deathrun vip plugin
Reply With Quote #6

Okay, so this is what i could've create. I have copied the VIP chat from a plugin i created before since it works perfect.

One thing u need to do urself is change these lines. on line 22 and 23 to your likings. I haven't downloaded and tested the models. Also you need the colorchat include, which i attached in this post.

PHP Code:
"models/deathrunvip/v_model.mdl",
"models/deathrunvip/p_model.mdl" 
here's the rest of the code.

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <engine>
#include <fun>
#include <colorchat>

#define PLUGIN "Deathrun VIP"
#define VERSION "1.0"
#define AUTHOR "NapoleoN#"

bool:is_valid_msg(const arg[]) {
    if( 
arg[0] == '@' || !strlen(arg)) { 
        return 
false;
    }
    return 
true;
}

new const 
szModels[][] =
{
    
"models/deathrunvip/v_model.mdl",
    
"models/deathrunvip/p_model.mdl"
};

new const 
szTeams[][] =
{
    
"Unassigned",
    
"Terrorist",
    
"Counter-Terrorist",
    
"Spectator"
}

new 
szSayText;

new 
gAccess = (<< ADMIN_RESERVATION) | (<< ADMIN_CFG);

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
register_clcmd("say""CmdSay");
    
register_clcmd("say_team""CmdSayTeam");
    
    
szSayText get_user_msgid("SayText");
    
    
register_message(szSayText"MsgDuplicate");
    
    
register_event("CurWeapon""WeaponChange""be""1=1");
}

public 
MsgDuplicate(id
{
    return 
PLUGIN_HANDLED
}

public 
plugin_precache()
{
    for(new 
isizeof(szModels); i++) 
    {
        
precache_model(szModels[i])
    }
}

public 
WeaponChange(id)
{    
    if(
get_user_weapon(id) == CSW_KNIFE && gAccess & (<< get_user_flags(id)))
    {
        
entity_set_string(idEV_SZ_viewmodelszModels[0]);
        
entity_set_string(idEV_SZ_weaponmodelszModels[1]);
            
        
set_user_gravity(id0.5);
    }
    else 
    {
        
set_user_gravity(id);
    }
}

public 
CmdSay(id)
{
    new 
szArg[192], szName[32];
    
    
read_args(szArgcharsmax(szArg));
    
get_user_name(idszNamecharsmax(szName));
    
    
remove_quotes(szArg);
    
    new 
iAlive is_user_alive(id);
    
    if(
is_valid_msg(szArg)) 
    {
        (
iAlive format(szArgcharsmax(szArg), "[VIP] %s: %s"szNameszArg) : format(szArgcharsmax(szArg), "[VIP] *DEAD* %s: %s"szNameszArg));
    }
    
    
ColorChat(0GREEN"%s"szArg);
    
    return 
PLUGIN_CONTINUE;
}

public 
CmdSayTeam(id)
{
    new 
szArg[192], szName[32];
    
    
read_args(szArgcharsmax(szArg));
    
get_user_name(idszNamecharsmax(szName));
    new 
szTeam get_user_team(id);
    
    
remove_quotes(szArg);
    
    new 
iAlive is_user_alive(id);
    
    if(
is_valid_msg(szArg)) 
    {
        (
iAlive format(szArgcharsmax(szArg), "(%s) [VIP] %s: %s"szTeams[szTeam], szNameszArg) : format(szArgcharsmax(szArg), "(%s) [VIP] *DEAD* %s: %s"szTeams[szTeam], szNameszArg));
    }
    
    
ColorChat(0GREEN"%s"szArg);
    
    return 
PLUGIN_CONTINUE;

Let me know if it works like you requested or not.
Attached Files
File Type: inc colorchat.inc (2.9 KB, 62 views)
__________________

Last edited by Napoleon_be; 01-21-2020 at 19:26. Reason: Forgot to take out commenting lines
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
luci2k
Junior Member
Join Date: Jan 2020
Old 01-21-2020 , 21:02   Re: Deathrun vip plugin
Reply With Quote #7

This compile just right but i only get the chat [v.i.p] in front of my nickname and thats it
the gravity its 800 (normal)
i dont get 150hp / armour
/respawn wont work
player models are not visible
luci2k is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 01-22-2020 , 06:24   Re: Deathrun vip plugin
Reply With Quote #8

Yea my bad, i wasn't myself yesterday, i'll take a look at it and post the updated code.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 01-22-2020 , 07:25   Re: Deathrun vip plugin
Reply With Quote #9

Okay everything should work now. The only thing u gotta do is change the model paths like i said before.

Also on line 103 u see cs_set_user_model(id, "vip"); Change "vip" to your model name. Be aware though, model folder and model name should be named the same.

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <engine>
#include <fun>
#include <colorchat>
#include <hamsandwich>
#include <cstrike>

#define PLUGIN "Deathrun VIP"
#define VERSION "1.0"
#define AUTHOR "NapoleoN#"

bool:is_valid_msg(const arg[]) 
{
    if(
arg[0] == '@' || !strlen(arg)) 
    { 
        return 
false;
    }
    return 
true;
}

new const 
szModels[][] =
{
    
"models/knife-mod/v_butcher.mdl",
    
"models/knife-mod/p_butcher.mdl",
    
"models/player/vip/vip.mdl"
};

new const 
szTeams[][] =
{
    
"Unassigned",
    
"Terrorist",
    
"Counter-Terrorist",
    
"Spectator"
};

new 
szSayText;
new 
iFlags;

new 
iRespawned[33];

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
register_clcmd("say""CmdSay");
    
register_clcmd("say_team""CmdSayTeam");
    
    
register_clcmd("say /respawn""CmdRespawn");
    
    
RegisterHam(Ham_Spawn"player""PostPlayerSpawn"1);
    
    
szSayText get_user_msgid("SayText");
    
register_message(szSayText"MsgDuplicate");
    
    
register_event("CurWeapon""WeaponChange""be""1=1");
    
register_logevent("RoundEnd"2"1=Round_End");
}

public 
MsgDuplicate(id
{
    return 
PLUGIN_HANDLED;
}

public 
plugin_precache()
{
    for(new 
isizeof(szModels); i++) 
    {
        
precache_model(szModels[i]);
    }
}

public 
WeaponChange(id)
{    
    if(
get_user_weapon(id) == CSW_KNIFE)
    {
        
iFlags get_user_flags(id);
        if(
iFlags ADMIN_RESERVATION && iFlags ADMIN_CFG)
        {
            
entity_set_string(idEV_SZ_viewmodelszModels[0]);
            
entity_set_string(idEV_SZ_weaponmodelszModels[1]);
            
            
set_user_gravity(id0.5);
        }
    }
    else 
    {
        
set_user_gravity(id);
    }
}

public 
PostPlayerSpawn(id)
{
    if(
is_user_alive(id))
    {
        
iFlags get_user_flags(id);
        if(
iFlags ADMIN_RESERVATION && iFlags ADMIN_CFG)
        {
            
set_user_health(id150);
            
set_user_armor(id150);
            
            
cs_set_user_model(id"vip");
        }
    }
}

public 
RoundEnd()
{
    new 
iPlayers[32], iNum;
    
get_players(iPlayersiNum);
    
    for(new 
iiNumi++)
    {
        
iFlags get_user_flags(iPlayers[i]);
        if(
iFlags ADMIN_RESERVATION && iFlags ADMIN_CFG)
        {
            
iRespawned[iPlayers[i]] = 0;
        }
    }
}

public 
CmdRespawn(id)
{
    if(!
is_user_alive(id))
    {
        
iFlags get_user_flags(id);
        if(
iFlags ADMIN_RESERVATION && iFlags ADMIN_CFG)
        {
            if(
iRespawned[id] < 2)
            {
                
iRespawned[id]++;
                
ExecuteHamB(Ham_CS_RoundRespawnid);
            }
            
            else
            {
                
ColorChat(idGREEN"You have already used /respawn %i times"iRespawned[id]);
            }
        }
    }
}

public 
CmdSay(id)
{
    new 
szArg[192], szName[32], szTemp[250];
    
    
read_args(szArgcharsmax(szArg));
    
get_user_name(idszNamecharsmax(szName));
    
    
remove_quotes(szArg);
    
    new 
iAlive is_user_alive(id);
    
    if(
is_valid_msg(szArg)) 
    {
        (
iAlive format(szTempcharsmax(szTemp), "[VIP] %s: %s"szNameszArg) : format(szTempcharsmax(szTemp), "[VIP] *DEAD* %s: %s"szNameszArg));
    }
    
    
ColorChat(0GREEN"%s"szTemp);
    
    return 
PLUGIN_CONTINUE;
}

public 
CmdSayTeam(id)
{
    new 
szArg[192], szName[32], szTemp[250];
    
    
read_args(szArgcharsmax(szArg));
    
get_user_name(idszNamecharsmax(szName));
    new 
szTeam get_user_team(id);
    
    
remove_quotes(szArg);
    
    new 
iAlive is_user_alive(id);
    
    if(
is_valid_msg(szArg)) 
    {
        (
iAlive format(szTempcharsmax(szTemp), "(%s) [VIP] %s: %s"szTeams[szTeam], szNameszArg) : format(szTempcharsmax(szTemp), "(%s) [VIP] *DEAD* %s: %s"szTeams[szTeam], szNameszArg));
    }
    
    
ColorChat(0GREEN"%s"szTemp);
    
    return 
PLUGIN_CONTINUE;

__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-22-2020 , 07:33   Re: Deathrun vip plugin
Reply With Quote #10

The precache line needs to be modified as well, so there are 3 "vip" that need changing.
Consider using this function to handle player models precaching without requiring the actual path to the model:

Code:
precache_player_model(szModel[]) {     static szFile[128]     formatex(szFile, charsmax(szFile), "models/player/%s/%s.mdl", szModel, szModel)     precache_model(szFile)     replace(szFile, charsmax(szFile), ".mdl", "T.mdl")     if(file_exists(szFile))     {         precache_model(szFile)     } }
__________________

Last edited by OciXCrom; 01-22-2020 at 07:33.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
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 00:23.


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