Skocz do zawartości

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

knopers666 - zdjęcie

knopers666

Rejestracja: 18.01.2013
Aktualnie: Nieaktywny
Poza forum Ostatnio: 10.07.2013 20:57
-----

Moje tematy

ConVar

05.03.2013 20:08

Ostatnio robię plugin i mam mały problem otóż chce, żeby on wysłał do konsoli takie coś: "thc_rpg_credits <nick> 10".Tylko, że nie wiem jakiej funkcji użyć :/
Oto plugin"
#pragma semicolon 1
#include <sourcemod>
public Plugin:myinfo =
{
name = "Premia RPG",
	author = "knopers",
	description = "Plugin dla Johnego",
	version = "1.0",
	url = "heavycraft.pl",
}
public OnPluginStart()
{
PrintToServer("[KNOPERS]Plugin gotowy do pracy");
HookEvent("player_death", PlayerDeath);
}
public Action:PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
new attackerId = GetEventInt(event, "attacker");
new attacker = GetClientOfUserId(attackerId);
new frag = GetClientFrags(attacker);
new thc_rpg_credits = FindConVar("thc_rpg_credits");
new premia1 = 10;
if (frag != 0)
{
		SendConVarValue(attacker, thc_rpg_credits, "thc_rpg_credits attacker 1");
  PrintToChat(attacker, "Dostales cos tam wololow");
	}
else
{
  PrintToChat(attacker, "[KNOPERS]Cos nie tak :(");
	}
}

Ps.Czy można zrobić coś w tym stylu ?
if (xxxx)
{
}
else if (yyyy)
{
}
else
{
}

Hookowanie śmierci

26.02.2013 22:16

Witam chciałbym tak użyć hooku "player_death", żeby wywołał funkcje dopiero jak attacker zabije osoby.Np. Gracz zabije 3 osoby dostaje premie kredytów w czymś tak.

Nie widać tracerów

11.02.2013 15:41

Na serwerze jest plugin, który odpowiada za kolorowe paski gdy się strzela z broni, lecz się one nie pokazują.W konsoli gracza wyświetla się takie coś:
Material effects/splash3 has bad reference count -23 when being bound
Material effects/splash3 has bad reference count -23 when being bound
Material effects/splash3 has bad reference count -23 when being bound
Material effects/splash3 has bad reference count -23 when being bound
Material effects/splash3 has bad reference count -24 when being bound
Material effects/splash3 has bad reference count -24 when being bound


[ROZWIĄZANE] czemu nie blokuje granatów ?

24.01.2013 15:40

Witam, chce, żeby komenda !ammo nie działa na granaty,ale wyskakuje błąd:
C:\srcds\css\cstrike\addons\sourcemod\scripting>spcomp ammo.sp
SourcePawn Compiler 1.5.0-dev+3742
Copyright (c) 1997-2006, ITB CompuPhase, (C)2004-2008 AlliedModders, LLC
ammo.sp(32) : warning 213: tag mismatch
Header size:		   3868 bytes
Code size:		    17176 bytes
Data size:			 2220 bytes
Stack/heap size:	  16384 bytes; Total requirements:   39648 bytes
1 Warning.
A to kod pluginu:
/* Plugin Template generated by Pawn Studio */
#include <sourcemod>
#include <cstrike>
#include <sdktools>
#include <smlib>
#include <colors>
#include <css_weapons>
#define PLUGIN_VERSION "v1.0"
#define CS_TEAM_NONE	    0   /**< No team yet. */
#define CS_TEAM_SPECTATOR   1  /**< Spectators. */
#define CS_TEAM_T	   2 /**< Terrorists. */
#define CS_TEAM_CT	  3 /**< Counter-Terrorists. */  
public Plugin:myinfo =
{
    name = "ZmAmmo",
    author = "Knopers",
    description = "Plugin dla snickersa",
    version = "PLUGIN_VERSION",
    url = "http://heavycraft.pl/"
}
public OnPluginStart()
{
    CreateConVar("zm_ammo", PLUGIN_VERSION, "version", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
    PrintToServer("[Ammo]Plugin jest gotowy do pracy !");
    RegConsoleCmd("sm_ammo", sm_ammo);
}
public Action:sm_ammo(client, args)
{
    new weapon = Client_GetActiveWeapon(client);
    if ( (IsClientInGame(client)) && (IsPlayerAlive(client) && GetClientTeam(client) == 3) && (Client_GetActiveWeapon(client) != WEAPON_SMOKEGRENADE) )
    {
  new primaryAmmo = 999
  new secondaryAmmo = 999
  Client_SetWeaponPlayerAmmoEx(client, weapon, primaryAmmo, secondaryAmmo);
  CPrintToChat(client, "{red}[KIT] {default}Amunicja dodana.");
    }else{
  CPrintToChat(client, "{red}[KIT] {default}Nie dla zombie amunicja :)");
}
}

Ograniczone użycie komend

20.01.2013 15:36

Mam takie pytanie czy dało by rade ograniczyć komendy, że można użyć tylko np 3 razy na rundę.
Ps.Czemu nie mogę "hookować" round_start ?
/* Plugin Template generated by Pawn Studio */
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <colors>
#define PLUGIN_VERSION "v1.0"
public Plugin:myinfo =
{
name = "ZM Kit",
author = "Knopers",
description = "Plugin dla snickersa",
version = "PLUGIN_VERSION",
url = ""
};
public OnPluginStart()
{
CreateConVar("sm_zmkit", PLUGIN_VERSION, "version", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
HookEvent("player_spawn", Event_PlayerSpawn);
PrintToServer("[Knopers]Plugin wlanczony");
HookEvent("round_start", Event_RoundStart);
RegConsoleCmd("sm_m4a1", sm_m4a1);
RegConsoleCmd("sm_elite", sm_elite);
RegConsoleCmd("sm_deagle", sm_deagle);
RegConsoleCmd("sm_ak47", sm_ak47);
RegConsoleCmd("sm_m249", sm_m249);
RegConsoleCmd("sm_m3", sm_m3);
RegConsoleCmd("sm_p90", sm_p90);
RegConsoleCmd("sm_ump45", sm_ump45);
}
public Action:Event_PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if ( (IsClientInGame(client)) && (IsPlayerAlive(client) && GetClientTeam(client) > 1) )
{
  GivePlayerItem(client, "weapon_hegrenade");
  GivePlayerItem(client, "weapon_smokegrenade");
}
}
public Action:Event_RoundStart(Handle:event, any:userid, args)
{
for(new client=1; client<=MaxClients; client++)
{
  if(!IsClientInGame(client) || IsFakeClient(client) || !IsPlayerAlive(client))
   continue;
  if(GetClientTeam(client) > 1)
  {
   CPrintToChat(client, "{red}[KIT] {default}Granaty dodane do ekwipunku");
  }
}
}
public Action:sm_p90(client, args)
{
if ( (IsClientInGame(client)) && (IsPlayerAlive(client) && GetClientTeam(client) > 1) )
{
  GivePlayerItem(client, "weapon_p90");
    }

}
public Action:sm_ump45(client, args)
{
if ( (IsClientInGame(client)) && (IsPlayerAlive(client) && GetClientTeam(client) > 1) )
{
  GivePlayerItem(client, "weapon_ump45");
    }

}
public Action:sm_m249(client, args)
{
if ( (IsClientInGame(client)) && (IsPlayerAlive(client) && GetClientTeam(client) > 1) )
{
  GivePlayerItem(client, "weapon_m249");
    }

}
public Action:sm_ak47(client, args)
{
if ( (IsClientInGame(client)) && (IsPlayerAlive(client) && GetClientTeam(client) > 1) )
{
  GivePlayerItem(client, "weapon_ak47");
    }

}
public Action:sm_deagle(client, args)
{
if ( (IsClientInGame(client)) && (IsPlayerAlive(client) && GetClientTeam(client) > 1) )
{
  GivePlayerItem(client, "weapon_deagle");
    }

}
public Action:sm_elite(client, args)
{
if ( (IsClientInGame(client)) && (IsPlayerAlive(client) && GetClientTeam(client) > 1) )
{
  GivePlayerItem(client, "weapon_elite");
    }

}
public Action:sm_m4a1(client, args)
{
if ( (IsClientInGame(client)) && (IsPlayerAlive(client) && GetClientTeam(client) > 1) )
{
  GivePlayerItem(client, "weapon_m4a1");
    }

}
public Action:sm_m3(client, args)
{
if ( (IsClientInGame(client)) && (IsPlayerAlive(client) && GetClientTeam(client) > 1) )
{
  GivePlayerItem(client, "weapon_m3");
    }

}