Raised This Month: $9 Target: $400
 2% 

Solved [REQ] Skin System only CT (CS 1.6)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Naeciof
Junior Member
Join Date: Oct 2016
Location: Brazil
Old 05-05-2020 , 04:03   [REQ] Skin System only CT (CS 1.6)
Reply With Quote #1

Can anyone edit this plugin that allows only the team CT?
The guy who wrote the plugin has been inactive since 2018.

Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <cstrike>

#define SAVETIME_MIN 0.5
#define SAVETIME_MAX 3.0
#define LOADTIME 2.5

#define MAXWEAPONS 30
#define SKINSPERWEAPONS 10
#define POINTSLEN 6

#define PORT 1

#pragma semicolon 1

new const PLUGIN[] = "Skin System";
new const VERSION[] = "2.33";
new const AUTHOR[] = "DeRoiD";

new KillPoints[31][33], Skin[31][SKINSPERWEAPONS],
vSkinMdl[31][SKINSPERWEAPONS][64], pSkinMdl[31][SKINSPERWEAPONS][64],
SkinName[31][SKINSPERWEAPONS][32], Already[31], Cvar_Save, pSave[3][32][33];
new PointsFile[64], SkinsFile[64];

new const WeaponNames[][] =
{
	"", "P228", "", "Scout", "He Grenade", "XM1014", "", "MAC10", "AUG",
	"", "Elite", "FiveSeven", "UMP45", "SG550", "Galil", "FAMAS",
	"USP", "Glock18", "AWP", "MP5", "M249", "M3", "M4A1", "TMP", "G3SG1",
	"", "Deagle", "SG552", "AK47", "Knife", "P90"
};
new const WeaponEntNames[][] =
{
	"weapon_p228", "weapon_scout", "weapon_hegrenade", "weapon_xm1014", "weapon_mac10",
	"weapon_aug", "weapon_elite", "weapon_fiveseven", "weapon_ump45", "weapon_sg550",
	"weapon_galil", "weapon_famas", "weapon_usp", "weapon_glock18", "weapon_awp",
	"weapon_mp5navy", "weapon_m249", "weapon_m3", "weapon_m4a1", "weapon_tmp",
	"weapon_g3sg1", "weapon_deagle", "weapon_sg552", "weapon_ak47", "weapon_knife", "weapon_p90"
};

public plugin_init()
{	
	register_plugin(PLUGIN, VERSION, AUTHOR);
	register_cvar(PLUGIN, AUTHOR, FCVAR_SERVER);
	
	Cvar_Save = register_cvar("skin_s_savemod", "2");
	
	register_clcmd("say", "Say");
	register_clcmd("say_team", "Say");
	
	for(new Num; Num < sizeof WeaponEntNames; Num++)
	{
		RegisterHam(Ham_Item_Deploy, WeaponEntNames[Num], "WeaponModel", 1);
	}
	
	register_forward(FM_ClientUserInfoChanged, "NameChange");
	register_dictionary("skinsystem.txt");
	
	LoadSkins();
}
public plugin_precache() {
	static ConfigsDir[64]; 
	get_localinfo("amxx_configsdir", ConfigsDir, 63);
	formatex(PointsFile, 63, "%s/skinsystem/save.ini", ConfigsDir);
	formatex(SkinsFile, 63, "%s/skinsystem/skins.cfg", ConfigsDir);
	
	new Len, Line[256], Data[3][48], FileLine;
	FileLine = file_size(SkinsFile, 1);
	for(new Num = 0; Num < FileLine; Num++)
	{
		read_file(SkinsFile, Num, Line, 255, Len);
		parse(Line, Data[0], 31, Data[1], 47, Data[2], 47);
		
		if(Line[0] == ';' || strlen(Line) < 5)
			continue;

		remove_quotes(Data[1]);
		remove_quotes(Data[2]);
		
		if(containi(Data[1], ".mdl") != -1)
		{
			precache_model(Data[1]);
		}
					
		if(containi(Data[2], ".mdl") != -1)
		{
			precache_model(Data[2]);
		}
	}
}
public NameChange(Player) 
{
	if(!is_user_connected(Player) || get_pcvar_num(Cvar_Save) != 0)
		return FMRES_IGNORED;

	new OldName[32], NewName[32], Name[32];
	get_user_name(Player, Name, 31);
	pev(Player, pev_netname, OldName, charsmax(OldName));
	if(OldName[0])
	{
		get_user_info(Player, "name", NewName, charsmax(NewName));
		if(!equal(OldName, NewName))
		{
			remove_task(Player);
			
			LoadPlayer(Player);
			LoadPoints(Player);
		}
	}
	return FMRES_IGNORED;
}
public WeaponModel(Weapon) {
	new Player = get_pdata_cbase(Weapon, 41, 4);
	new WeaponID = cs_get_weapon_id(Weapon);
	
	if(Player > 32 || Player < 1
	|| WeaponID < 1 || WeaponID > 30)
	{
		return HAM_SUPERCEDE;
	}
	
	for(new Num = 1; Num < MAXWEAPONS; Num++)
	{
		if(Num == WeaponID)
		{
			for(new x; x < Already[WeaponID]; x++)
			{
				if(KillPoints[WeaponID][Player] >= Skin[WeaponID][x])
				{
					if(containi(vSkinMdl[WeaponID][x], ".mdl") != -1)
					{
						set_pev(Player, pev_viewmodel2, vSkinMdl[WeaponID][x]);
					}
					if(containi(pSkinMdl[WeaponID][x], ".mdl") != -1)
					{
						set_pev(Player, pev_weaponmodel2, pSkinMdl[WeaponID][x]);
					}
				}
			}
		}
	}
	return HAM_IGNORED;
}
public LoadSkins() {
	new File;
	File = fopen(SkinsFile, "rt");
	
	if(File)
	{
		new Line[256], Type[32], Data[5][64];
		while(!feof(File))
		{
			fgets(File, Line, 255);
			
			if(Line[0] == ';' || strlen(Line) < 5)
				continue;
				
			parse(Line, Type, 31);
			
			for(new Num = 1; Num < MAXWEAPONS+1; Num++)
			{
				if(Already[Num] >= SKINSPERWEAPONS)
					continue;
				
				if(equali(Type, WeaponNames[Num]))
				{
					parse(Line, Data[0], 63, Data[1], 63, Data[2], 63, Data[3], 63, Data[4], 63);
					copy(vSkinMdl[Num][Already[Num]], 63, Data[1]);
					copy(pSkinMdl[Num][Already[Num]], 63, Data[2]);
					copy(SkinName[Num][Already[Num]], 31, Data[4]);
					Skin[Num][Already[Num]] = str_to_num(Data[3]);
					Already[Num]++;
				}
			}
		}
		fclose(File);
	}
}
public client_death(Killer, Victim, Weapon)
{
	if(Killer == Victim
	|| Killer > 32 || Killer < 1
	|| Weapon == 25 || Weapon == 9
	|| Weapon < 1 || Weapon > 30)
	{
		return PLUGIN_HANDLED;
	}
	
	set_task(random_float(SAVETIME_MIN, SAVETIME_MAX), "SavePoints", Killer);
	KillPoints[Weapon][Killer]++;
	
	return PLUGIN_CONTINUE;
}
public ShowSkins(Player, i)
{
	new MotdTitle[64];
	formatex(MotdTitle, 63, "%L", LANG_SERVER, "MOTD1");
	
	new Motd[1024], Line[256];
	formatex(Line, 255, "<body bgcolor=^"black^">^n<font color=^"red^">^n");
	add(Motd, 1023, Line, 255);
	formatex(Line, 255, "<p align=^"center^">%s %s by: %s</p></font>^n<font color=^"greenyellow^">^n", PLUGIN, VERSION, AUTHOR);
	add(Motd, 1023, Line, 255);
	formatex(Line, 255, "<p align=^"center^">%L:</p></font>^n", LANG_SERVER, "SKINS", WeaponNames[i]);
	add(Motd, 1023, Line, 255);
	formatex(Line, 255, "<h5>^n<font color=^"white^">^n");
	add(Motd, 1023, Line, 255);
	
	for(new Num; Num < MAXWEAPONS; Num++)
	{
		if(Num != i)
		continue;
		formatex(Line, 255, "<p>");
		add(Motd, 1023, Line, 255);
		for(new x; x < SKINSPERWEAPONS; x++)
		{
			if(strlen(SkinName[Num][x]) < 2)
				continue;
			
			formatex(Line, 255, "<br>%s: (%L)", SkinName[Num][x], LANG_SERVER, "KILLS", Skin[Num][x]);
			add(Motd, 1023, Line, 255);
		}
		formatex(Line, 255, "</p>");
		add(Motd, 1023, Line, 255);
	}
	
	formatex(Line, 255, "^n</h5>^n</font>^n</body>");
	add(Motd, 1023, Line, 255);
	show_motd(Player, Motd, MotdTitle);
}
public ShowPoints(Player, Target)
{
	new Name[32], MotdTitle[64];
	get_user_name(Target, Name, 31);
	
	formatex(MotdTitle, 63, "%L", LANG_SERVER, "PKILLS", Name);
	
	new Motd[1024], Line[256];
	formatex(Line, 255, "<body bgcolor=^"black^">^n<font color=^"red^">^n");
	add(Motd, 1023, Line, 255);
	formatex(Line, 255, "<p align=^"center^">%s %s by: %s</p></font>^n<font color=^"white^">^n", PLUGIN, VERSION, AUTHOR);
	add(Motd, 1023, Line, 255);
	formatex(Line, 255, "<p align=^"center^">%L:</p></font>^n", LANG_SERVER, "PKILLS", Name);
	add(Motd, 1023, Line, 255);
	formatex(Line, 255, "<font color=^"cyan^">^n");
	add(Motd, 1023, Line, 255);
	formatex(Line, 255, "<h5>^n");
	add(Motd, 1023, Line, 255);
 
	if(Target > 0)
	{
		formatex(Line, 255, "<p align=^"center^">");
		add(Motd, 1023, Line, 255);
		new Len;
		for(new Num = 1; Num < MAXWEAPONS+1; Num++)
		{
			if(Num == 2 || Num == 6 || Num == 9 || Num == 25)
			{
				continue;
			}
			
			Len++;
			
			if(Len < POINTSLEN)
			{
				formatex(Line, 255, " %s: %d |", WeaponNames[Num], KillPoints[Num][Target]);
				add(Motd, 1023, Line, 255);
			}
			else
			{
				Len = 0;
				formatex(Line, 255, " %s: %d</p>^n<p align=^"center^">", WeaponNames[Num], KillPoints[Num][Target]);
				add(Motd, 1023, Line, 255);
			}
		}
		formatex(Line, 255, "</p>");
		add(Motd, 1023, Line, 255);
	}
	
	formatex(Line, 255, "^n</h5>^n</font>^n</body>");
	add(Motd, 1023, Line, 255);
	show_motd(Player, Motd, MotdTitle);
}
public Say(Player)
{
	new Message[32];
	read_args(Message, 31);
	remove_quotes(Message);
	
	if(equali(Message, "/mykills"))
	{
		ShowPoints(Player, Player);
	}
	else if(containi(Message, "/skins") != -1)
	{
		for(new Num; Num < MAXWEAPONS+1; Num++)
		{
			if(containi(Message, WeaponNames[Num]) != -1)
			{
				ShowSkins(Player, Num);
				return PLUGIN_HANDLED;
			}
		}
	}
	else
	{
		new TargetName[32], Name[32], Command[32];
		parse(Message, Command, 31, TargetName, 31);
		if(equali(Command, "/kill"))
		{
			for(new Target; Target < 32; Target++)
			{
				if(Target == Player || !is_user_connected(Target))
				{
					continue;
				}
				
				get_user_name(Target, Name, 31);
				
				if((containi(Name, TargetName) != -1))
				{
					if(equali(Name, TargetName))
					ShowPoints(Player, Target);
					else if(strlen(TargetName) > 3)
					ShowPoints(Player, Target);
					return PLUGIN_HANDLED;
				}
			}
		}
	}
	return PLUGIN_CONTINUE;
}
public client_putinserver(Player)
{
	remove_task(Player);
	set_task(LOADTIME, "LoadPoints", Player);
}
public client_connect(Player)
{
	LoadPlayer(Player);
}
public LoadPoints(Player)
{
	if(!is_user_connected(Player))
	{
		return PLUGIN_HANDLED;
	}
	
	new File;
	File = fopen(PointsFile, "rt");
	
	if(File)
	{
		new Line[256];
		new LineName[32], Data[31][8];
		
		while(!feof(File))
		{
			fgets(File, Line, 255);
			
			if(Line[0] == ';' || strlen(Line) < 2)
				continue;
				
			parse(Line, LineName, 31);
			
			if(equal(LineName, pSave[get_pcvar_num(Cvar_Save)][Player]))
			{
				parse(Line, Data[0], 7, Data[1], 7, Data[2], 7, Data[3], 7, Data[4], 7, Data[5], 7,
				Data[6], 7, Data[7], 7, Data[8], 7, Data[9], 7, Data[10], 7, Data[11], 7, Data[12], 7,
				Data[13], 7, Data[14], 7, Data[15], 7, Data[16], 7, Data[17], 7, Data[18], 7, Data[19], 7,
				Data[20], 7, Data[21], 7, Data[22], 7, Data[23], 7, Data[24], 7, Data[25], 7, Data[26], 7,
				Data[27], 7, Data[28], 7, Data[29], 7, Data[30], 7);
				
				for(new Num = 1; Num < MAXWEAPONS+1; Num++)
				{
					KillPoints[Num][Player] = str_to_num(Data[Num]);
				}
				return PLUGIN_HANDLED;
			}
		}
		fclose(File);
	}
	return PLUGIN_CONTINUE;
}
public SavePoints(Player)
{
	if(!is_user_connected(Player))
	{
		return PLUGIN_HANDLED;
	}
	
	new File;
	File = fopen(PointsFile, "rt");
	
	if(File)
	{
		new Line[192], LineNum;
		
		new LineName[32], bool:Found;
		
		while(!feof(File))
		{
			fgets(File, Line, 191);
			
			if(Line[0] == ';' || strlen(Line) < 2)
				continue;
				
			parse(Line, LineName, 31);
			
			if(equal(LineName, pSave[get_pcvar_num(Cvar_Save)][Player]) && !Found)
			{
				new SaveLine[256], PlayerPoints[256], String[8];
				
				for(new Num = 1; Num < MAXWEAPONS+1; Num++)
				{
					format(String, 7, "^"%i^" ", KillPoints[Num][Player]);
					add(PlayerPoints, 255, String);
				}
				
				formatex(SaveLine, 255, "^"%s^" %s", pSave[get_pcvar_num(Cvar_Save)][Player], PlayerPoints);
				write_file(PointsFile, SaveLine, LineNum);
				Found = true;
				return PLUGIN_HANDLED;
			}
			
			LineNum++;
		}
		
		if(!Found)
		{
			new SaveLine[256], PlayerPoints[256], String[8];
				
			for(new Num; Num < MAXWEAPONS; Num++)
			{
				format(String, 7, "^"%i^" ", KillPoints[Num][Player]);
				add(PlayerPoints, 255, String);
			}
			
			formatex(SaveLine, 255, "^"%s^" %s", pSave[get_pcvar_num(Cvar_Save)][Player], PlayerPoints);
			write_file(PointsFile, SaveLine);
			return PLUGIN_HANDLED;
		}
		fclose(File);
	}
	return PLUGIN_CONTINUE;
}
stock LoadPlayer(Player)
{
	new Num;
	for(Num = 1; Num < MAXWEAPONS+1; Num++)
	{
		KillPoints[Num][Player] = 0;
	}
	
	for(Num = 0; Num < 2; Num++)
	{
		pSave[0][Player] = "";
	}
	get_user_name(Player, pSave[0][Player], 31);
	get_user_ip(Player, pSave[1][Player], 31, PORT);
	get_user_authid(Player, pSave[2][Player], 31);
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1038\\ f0\\ fs16 \n\\ par }
*/

Last edited by Naeciof; 05-05-2020 at 15:26. Reason: orthographic error
Naeciof is offline
AceVentura
Member
Join Date: Mar 2020
Location: Ontario, Canada
Old 05-05-2020 , 09:17   Re: [REQ] Skin System only CT (CS 1.6)
Reply With Quote #2

This will do. Reply for any probs.
PHP Code:

if ( cs_get_user_teamPlayer ) == CS_TEAM_T )
{
     return 
PLUGIN_HANDLED;

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

#define SAVETIME_MIN 0.5
#define SAVETIME_MAX 3.0
#define LOADTIME 2.5

#define MAXWEAPONS 30
#define SKINSPERWEAPONS 10
#define POINTSLEN 6

#define PORT 1

#pragma semicolon 1

new const PLUGIN[] = "Skin System";
new const 
VERSION[] = "2.33";
new const 
AUTHOR[] = "DeRoiD";

new 
KillPoints[31][33], Skin[31][SKINSPERWEAPONS],
vSkinMdl[31][SKINSPERWEAPONS][64], pSkinMdl[31][SKINSPERWEAPONS][64],
SkinName[31][SKINSPERWEAPONS][32], Already[31], Cvar_SavepSave[3][32][33];
new 
PointsFile[64], SkinsFile[64];

new const 
WeaponNames[][] =
{
    
"""P228""""Scout""He Grenade""XM1014""""MAC10""AUG",
    
"""Elite""FiveSeven""UMP45""SG550""Galil""FAMAS",
    
"USP""Glock18""AWP""MP5""M249""M3""M4A1""TMP""G3SG1",
    
"""Deagle""SG552""AK47""Knife""P90"
};
new const 
WeaponEntNames[][] =
{
    
"weapon_p228""weapon_scout""weapon_hegrenade""weapon_xm1014""weapon_mac10",
    
"weapon_aug""weapon_elite""weapon_fiveseven""weapon_ump45""weapon_sg550",
    
"weapon_galil""weapon_famas""weapon_usp""weapon_glock18""weapon_awp",
    
"weapon_mp5navy""weapon_m249""weapon_m3""weapon_m4a1""weapon_tmp",
    
"weapon_g3sg1""weapon_deagle""weapon_sg552""weapon_ak47""weapon_knife""weapon_p90"
};

public 
plugin_init()
{    
    
register_plugin(PLUGINVERSIONAUTHOR);
    
register_cvar(PLUGINAUTHORFCVAR_SERVER);
    
    
Cvar_Save register_cvar("skin_s_savemod""2");
    
    
register_clcmd("say""Say");
    
register_clcmd("say_team""Say");
    
    for(new 
NumNum sizeof WeaponEntNamesNum++)
    {
        
RegisterHam(Ham_Item_DeployWeaponEntNames[Num], "WeaponModel"1);
    }
    
    
register_forward(FM_ClientUserInfoChanged"NameChange");
    
register_dictionary("skinsystem.txt");
    
    
LoadSkins();
}
public 
plugin_precache() {
    static 
ConfigsDir[64]; 
    
get_localinfo("amxx_configsdir"ConfigsDir63);
    
formatex(PointsFile63"%s/skinsystem/save.ini"ConfigsDir);
    
formatex(SkinsFile63"%s/skinsystem/skins.cfg"ConfigsDir);
    
    new 
LenLine[256], Data[3][48], FileLine;
    
FileLine file_size(SkinsFile1);
    for(new 
Num 0Num FileLineNum++)
    {
        
read_file(SkinsFileNumLine255Len);
        
parse(LineData[0], 31Data[1], 47Data[2], 47);
        
        if(
Line[0] == ';' || strlen(Line) < 5)
            continue;

        
remove_quotes(Data[1]);
        
remove_quotes(Data[2]);
        
        if(
containi(Data[1], ".mdl") != -1)
        {
            
precache_model(Data[1]);
        }
                    
        if(
containi(Data[2], ".mdl") != -1)
        {
            
precache_model(Data[2]);
        }
    }
}
public 
NameChange(Player
{
    if(!
is_user_connected(Player) || get_pcvar_num(Cvar_Save) != 0)
        return 
FMRES_IGNORED;

    new 
OldName[32], NewName[32], Name[32];
    
get_user_name(PlayerName31);
    
pev(Playerpev_netnameOldNamecharsmax(OldName));
    if(
OldName[0])
    {
        
get_user_info(Player"name"NewNamecharsmax(NewName));
        if(!
equal(OldNameNewName))
        {
            
remove_task(Player);
            
            
LoadPlayer(Player);
            
LoadPoints(Player);
        }
    }
    return 
FMRES_IGNORED;
}
public 
WeaponModel(Weapon) {
    new 
Player get_pdata_cbase(Weapon414);
    new 
WeaponID cs_get_weapon_id(Weapon);
    
    if(
Player 32 || Player 1
    
|| WeaponID || WeaponID 30)
    {
        return 
HAM_SUPERCEDE;
    }
    
    for(new 
Num 1Num MAXWEAPONSNum++)
    {
        if(
Num == WeaponID)
        {
            for(new 
xAlready[WeaponID]; x++)
            {
                if(
KillPoints[WeaponID][Player] >= Skin[WeaponID][x])
                {
                    if(
containi(vSkinMdl[WeaponID][x], ".mdl") != -1)
                    {
                        
set_pev(Playerpev_viewmodel2vSkinMdl[WeaponID][x]);
                    }
                    if(
containi(pSkinMdl[WeaponID][x], ".mdl") != -1)
                    {
                        
set_pev(Playerpev_weaponmodel2pSkinMdl[WeaponID][x]);
                    }
                }
            }
        }
    }
    return 
HAM_IGNORED;
}
public 
LoadSkins() {
    new 
File;
    
File fopen(SkinsFile"rt");
    
    if(
File)
    {
        new 
Line[256], Type[32], Data[5][64];
        while(!
feof(File))
        {
            
fgets(FileLine255);
            
            if(
Line[0] == ';' || strlen(Line) < 5)
                continue;
                
            
parse(LineType31);
            
            for(new 
Num 1Num MAXWEAPONS+1Num++)
            {
                if(
Already[Num] >= SKINSPERWEAPONS)
                    continue;
                
                if(
equali(TypeWeaponNames[Num]))
                {
                    
parse(LineData[0], 63Data[1], 63Data[2], 63Data[3], 63Data[4], 63);
                    
copy(vSkinMdl[Num][Already[Num]], 63Data[1]);
                    
copy(pSkinMdl[Num][Already[Num]], 63Data[2]);
                    
copy(SkinName[Num][Already[Num]], 31Data[4]);
                    
Skin[Num][Already[Num]] = str_to_num(Data[3]);
                    
Already[Num]++;
                }
            }
        }
        
fclose(File);
    }
}
public 
client_death(KillerVictimWeapon)
{
    if(
Killer == Victim
    
|| Killer 32 || Killer 1
    
|| Weapon == 25 || Weapon == 9
    
|| Weapon || Weapon 30)
    {
        return 
PLUGIN_HANDLED;
    }
    
    
set_task(random_float(SAVETIME_MINSAVETIME_MAX), "SavePoints"Killer);
    
KillPoints[Weapon][Killer]++;
    
    return 
PLUGIN_CONTINUE;
}
public 
ShowSkins(Playeri)
{
    new 
MotdTitle[64];
    
formatex(MotdTitle63"%L"LANG_SERVER"MOTD1");
    
    new 
Motd[1024], Line[256];
    
formatex(Line255"<body bgcolor=^"black^">^n<font color=^"red^">^n");
    
add(Motd1023Line255);
    
formatex(Line255"<p align=^"center^">%s %s by: %s</p></font>^n<font color=^"greenyellow^">^n"PLUGINVERSIONAUTHOR);
    
add(Motd1023Line255);
    
formatex(Line255"<p align=^"center^">%L:</p></font>^n"LANG_SERVER"SKINS"WeaponNames[i]);
    
add(Motd1023Line255);
    
formatex(Line255"<h5>^n<font color=^"white^">^n");
    
add(Motd1023Line255);
    
    for(new 
NumNum MAXWEAPONSNum++)
    {
        if(
Num != i)
        continue;
        
formatex(Line255"<p>");
        
add(Motd1023Line255);
        for(new 
xSKINSPERWEAPONSx++)
        {
            if(
strlen(SkinName[Num][x]) < 2)
                continue;
            
            
formatex(Line255"<br>%s: (%L)"SkinName[Num][x], LANG_SERVER"KILLS"Skin[Num][x]);
            
add(Motd1023Line255);
        }
        
formatex(Line255"</p>");
        
add(Motd1023Line255);
    }
    
    
formatex(Line255"^n</h5>^n</font>^n</body>");
    
add(Motd1023Line255);
    
show_motd(PlayerMotdMotdTitle);
}
public 
ShowPoints(PlayerTarget)
{
    new 
Name[32], MotdTitle[64];
    
get_user_name(TargetName31);
    
    
formatex(MotdTitle63"%L"LANG_SERVER"PKILLS"Name);
    
    new 
Motd[1024], Line[256];
    
formatex(Line255"<body bgcolor=^"black^">^n<font color=^"red^">^n");
    
add(Motd1023Line255);
    
formatex(Line255"<p align=^"center^">%s %s by: %s</p></font>^n<font color=^"white^">^n"PLUGINVERSIONAUTHOR);
    
add(Motd1023Line255);
    
formatex(Line255"<p align=^"center^">%L:</p></font>^n"LANG_SERVER"PKILLS"Name);
    
add(Motd1023Line255);
    
formatex(Line255"<font color=^"cyan^">^n");
    
add(Motd1023Line255);
    
formatex(Line255"<h5>^n");
    
add(Motd1023Line255);
 
    if(
Target 0)
    {
        
formatex(Line255"<p align=^"center^">");
        
add(Motd1023Line255);
        new 
Len;
        for(new 
Num 1Num MAXWEAPONS+1Num++)
        {
            if(
Num == || Num == || Num == || Num == 25)
            {
                continue;
            }
            
            
Len++;
            
            if(
Len POINTSLEN)
            {
                
formatex(Line255" %s: %d |"WeaponNames[Num], KillPoints[Num][Target]);
                
add(Motd1023Line255);
            }
            else
            {
                
Len 0;
                
formatex(Line255" %s: %d</p>^n<p align=^"center^">"WeaponNames[Num], KillPoints[Num][Target]);
                
add(Motd1023Line255);
            }
        }
        
formatex(Line255"</p>");
        
add(Motd1023Line255);
    }
    
    
formatex(Line255"^n</h5>^n</font>^n</body>");
    
add(Motd1023Line255);
    
show_motd(PlayerMotdMotdTitle);
}
public 
Say(Player)
{
    if(
cs_get_user_teamPlayer ) == CS_TEAM_T)
    {
        return 
PLUGIN_HANDLED;
    }
    new 
Message[32];
    
read_args(Message31);
    
remove_quotes(Message);
    
    if(
equali(Message"/mykills"))
    {
        
ShowPoints(PlayerPlayer);
    }
    else if(
containi(Message"/skins") != -1)
    {
        for(new 
NumNum MAXWEAPONS+1Num++)
        {
            if(
containi(MessageWeaponNames[Num]) != -1)
            {
                
ShowSkins(PlayerNum);
                return 
PLUGIN_HANDLED;
            }
        }
    }
    else
    {
        new 
TargetName[32], Name[32], Command[32];
        
parse(MessageCommand31TargetName31);
        if(
equali(Command"/kill"))
        {
            for(new 
TargetTarget 32Target++)
            {
                if(
Target == Player || !is_user_connected(Target))
                {
                    continue;
                }
                
                
get_user_name(TargetName31);
                
                if((
containi(NameTargetName) != -1))
                {
                    if(
equali(NameTargetName))
                    
ShowPoints(PlayerTarget);
                    else if(
strlen(TargetName) > 3)
                    
ShowPoints(PlayerTarget);
                    return 
PLUGIN_HANDLED;
                }
            }
        }
    }
    return 
PLUGIN_CONTINUE;
}
public 
client_putinserver(Player)
{
    
remove_task(Player);
    
set_task(LOADTIME"LoadPoints"Player);
}
public 
client_connect(Player)
{
    
LoadPlayer(Player);
}
public 
LoadPoints(Player)
{
    if(!
is_user_connected(Player))
    {
        return 
PLUGIN_HANDLED;
    }
    
    new 
File;
    
File fopen(PointsFile"rt");
    
    if(
File)
    {
        new 
Line[256];
        new 
LineName[32], Data[31][8];
        
        while(!
feof(File))
        {
            
fgets(FileLine255);
            
            if(
Line[0] == ';' || strlen(Line) < 2)
                continue;
                
            
parse(LineLineName31);
            
            if(
equal(LineNamepSave[get_pcvar_num(Cvar_Save)][Player]))
            {
                
parse(LineData[0], 7Data[1], 7Data[2], 7Data[3], 7Data[4], 7Data[5], 7,
                
Data[6], 7Data[7], 7Data[8], 7Data[9], 7Data[10], 7Data[11], 7Data[12], 7,
                
Data[13], 7Data[14], 7Data[15], 7Data[16], 7Data[17], 7Data[18], 7Data[19], 7,
                
Data[20], 7Data[21], 7Data[22], 7Data[23], 7Data[24], 7Data[25], 7Data[26], 7,
                
Data[27], 7Data[28], 7Data[29], 7Data[30], 7);
                
                for(new 
Num 1Num MAXWEAPONS+1Num++)
                {
                    
KillPoints[Num][Player] = str_to_num(Data[Num]);
                }
                return 
PLUGIN_HANDLED;
            }
        }
        
fclose(File);
    }
    return 
PLUGIN_CONTINUE;
}
public 
SavePoints(Player)
{
    if(!
is_user_connected(Player))
    {
        return 
PLUGIN_HANDLED;
    }
    
    new 
File;
    
File fopen(PointsFile"rt");
    
    if(
File)
    {
        new 
Line[192], LineNum;
        
        new 
LineName[32], bool:Found;
        
        while(!
feof(File))
        {
            
fgets(FileLine191);
            
            if(
Line[0] == ';' || strlen(Line) < 2)
                continue;
                
            
parse(LineLineName31);
            
            if(
equal(LineNamepSave[get_pcvar_num(Cvar_Save)][Player]) && !Found)
            {
                new 
SaveLine[256], PlayerPoints[256], String[8];
                
                for(new 
Num 1Num MAXWEAPONS+1Num++)
                {
                    
format(String7"^"%i^" "KillPoints[Num][Player]);
                    
add(PlayerPoints255String);
                }
                
                
formatex(SaveLine255"^"%s^" %s"pSave[get_pcvar_num(Cvar_Save)][Player], PlayerPoints);
                
write_file(PointsFileSaveLineLineNum);
                
Found true;
                return 
PLUGIN_HANDLED;
            }
            
            
LineNum++;
        }
        
        if(!
Found)
        {
            new 
SaveLine[256], PlayerPoints[256], String[8];
                
            for(new 
NumNum MAXWEAPONSNum++)
            {
                
format(String7"^"%i^" "KillPoints[Num][Player]);
                
add(PlayerPoints255String);
            }
            
            
formatex(SaveLine255"^"%s^" %s"pSave[get_pcvar_num(Cvar_Save)][Player], PlayerPoints);
            
write_file(PointsFileSaveLine);
            return 
PLUGIN_HANDLED;
        }
        
fclose(File);
    }
    return 
PLUGIN_CONTINUE;
}
stock LoadPlayer(Player)
{
    new 
Num;
    for(
Num 1Num MAXWEAPONS+1Num++)
    {
        
KillPoints[Num][Player] = 0;
    }
    
    for(
Num 0Num 2Num++)
    {
        
pSave[0][Player] = "";
    }
    
get_user_name(PlayerpSave[0][Player], 31);
    
get_user_ip(PlayerpSave[1][Player], 31PORT);
    
get_user_authid(PlayerpSave[2][Player], 31);
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1038\\ f0\\ fs16 \n\\ par }
*/ 
__________________
So.. animals CAN sense evil!

Last edited by AceVentura; 05-05-2020 at 09:25.
AceVentura is offline
Naeciof
Junior Member
Join Date: Oct 2016
Location: Brazil
Old 05-05-2020 , 13:36   Re: [REQ] Skin System only CT (CS 1.6)
Reply With Quote #3

Quote:
Originally Posted by AceVentura View Post
This will do. Reply for any probs.
PHP Code:

if ( cs_get_user_teamPlayer ) == CS_TEAM_T )
{
     return 
PLUGIN_HANDLED;

Work for command: say
I used your code in the weapons models
and it also worked

PHP Code:

public WeaponModel(Weapon) {
    new 
Player get_pdata_cbase(Weapon414);
    new 
WeaponID cs_get_weapon_id(Weapon);

    if(
cs_get_user_teamPlayer ) == CS_TEAM_T)
    {
        return 
PLUGIN_HANDLED;
    } 
Thanks
Naeciof is offline
Robbin
Junior Member
Join Date: May 2020
Location: Aveiro, Portugal
Old 05-07-2020 , 03:11   Re: [REQ] Skin System only CT (CS 1.6)
Reply With Quote #4

I use this plugin on my server
https://forums.alliedmods.net/showthread.php?t=262077

But I see that it still needs to be updated.
- Also show w_models
Example: If my skin is on the ground and another player takes the skin, it does not appear to him unless he is in the same rank
- Menu to change old skin
Robbin is offline
Naeciof
Junior Member
Join Date: Oct 2016
Location: Brazil
Old 05-07-2020 , 12:54   Re: [REQ] Skin System (CS 1.6)
Reply With Quote #5

I thought about that too.
Similar to what happens in csgo
You can make a request about it maybe someone can help.
Appreciated
Naeciof is offline
Old 05-07-2020, 17:04
Naeciof
This message has been deleted by Naeciof. Reason: Erro edit
Reply


Thread Tools
Display Modes

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 05:59.


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