←  Pluginy

AMXX.pl: Support AMX Mod X i SourceMod

»

Edycja Pluginu
Dodatki do Vipa

  • +
  • -
Miralee's Photo Miralee 21.02.2016

Witam, czy mógłby ktoś dodać mi do vipa wyglądy dla Ct z gry Team Fortress, informacje o vipie pod komendą !vip. Możliwe poprawki: Obecna wersja:

#include <sourcemod>
#include <sdktools>
#include <cstrike>
#include <sdkhooks>
#include <scp>
public Plugin:myinfo =
{
name = "VIP Generator",
author = "mastah7991",
description = "Automatycznie wygenerowany VIP",
version = "1.0",
url = "www.MyGo.pl"
}
public OnPluginStart()
{
HookEvent("player_spawn", Event_PlayerSpawn);
HookEvent("player_death", Event_PlayerDeath);
}
public OnClientPutInServer(client)
{
if(IsValidPlayer(client)&&GetUserFlagBits(client)&(1<<ADMFLAG_RESERVATION))
	{
		CS_SetClientClanTag(client, "[VIP]");
	}
}

public Action:Event_PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
	int client = GetClientOfUserId(GetEventInt(event, "attacker"));
	if(IsValidPlayer(client)&&GetUserFlagBits(client)&(1<<ADMFLAG_RESERVATION))
	{
		SetEntProp(client, Prop_Send, "m_iAccount", GetEntProp(client, Prop_Send, "m_iAccount")+10);
	}
}
public Action:Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
	int client = GetClientOfUserId(GetEventInt(event, "attacker"));
	bool headshot = GetEventBool(event, "headshot");

	if(IsValidPlayer(client)&&GetUserFlagBits(client)&(1<<ADMFLAG_RESERVATION))
	{
		SetEntityHealth(client, GetEntProp(client, Prop_Send, "m_iHealth")+15);

		if(headshot)
		SetEntityHealth(client, GetEntProp(client, Prop_Send, "m_iHealth")+30);

		if(GetEntProp(client, Prop_Send, "m_iHealth")>5000)
		SetEntityHealth(client, 5000);

		SetEntProp(client, Prop_Send, "m_iAccount",  GetEntProp(client, Prop_Send, "m_iAccount")+20);
	}
}


public Action:OnChatMessage(&author, Handle:recipients, String:name[], String:message[]) 
{
	if(IsValidPlayer(author)&&GetUserFlagBits(author)&(1<<ADMFLAG_RESERVATION))
	{
		Format(name, MAXLENGTH_NAME, "%s", name);
		new MaxMessageLength = MAXLENGTH_MESSAGE - strlen(name) - 5; 
		Format(name, MaxMessageLength, " [VIP]%s",name); 
		return Plugin_Changed;
	}
	return Plugin_Continue;
}

stock bool IsValidPlayer(client)
{
	if(client >= 1 && client <= MaxClients && IsClientConnected(client) && !IsFakeClient(client) && IsClientInGame(client) )
	return true;

	return false;
}
Quote

  • +
  • -
Miralee's Photo Miralee 21.02.2016

Tak, to sourcemod.

Quote

  • +
  • -
Bartolinciu's Photo Bartolinciu 27.02.2016

Przykro mi, ale na sourcemodzie się nie znam
Quote