#include <amxmisc>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "DarkGL"
#define restartRound() server_cmd("sv_restartround 1")
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
set_task(15.0,"vRestart")
set_task(16.0,"vRestart")
set_task(17.0,"vRestart")
}
public vRestart(){
restartRound()
}
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.
|
Jak dodac do pluginu aby dawalo bron po restarcie
#1
Napisano 18.08.2011 13:36
#2
Napisano 18.08.2011 13:42
#include <amxmisc>
#include <fun>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "DarkGL"
#define restartRound() server_cmd("sv_restartround 1")
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
set_task(15.0,"vRestart")
set_task(16.0,"vRestart")
set_task(17.0,"vRestart")
set_task(18.0,"daj")
}
public vRestart(){
restartRound()
}
public daj() {
give_item(0, "weapon_m4a1")
give_item(0, "ammo_556nato")
give_item(0, "ammo_556nato")
give_item(0, "ammo_556nato")
give_item(0, "ammo_556nato")
give_item(0, "weapon_hegrenade")
give_item(0, "weapon_flashbang")
give_item(0, "weapon_flashbang")
give_item(0, "weapon_smokegrenade")
}
sprawdz
#3
Napisano 18.08.2011 13:46
Dodano 18 sierpień 2011 - 13:49:
Nie działa ;/
#4
Napisano 18.08.2011 14:04
#include <amxmisc>
#include <fun>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "DarkGL"
#define restartRound() server_cmd("sv_restartround 1")
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
set_task(15.0,"vRestart")
set_task(16.0,"vRestart")
set_task(17.0,"vRestart")
set_task(18.0,"daj")
}
public vRestart(){
restartRound()
}
public daj(id) {
give_item(id, "weapon_m4a1")
give_item(id, "ammo_556nato")
give_item(id, "ammo_556nato")
give_item(id, "ammo_556nato")
give_item(id, "ammo_556nato")
give_item(id, "weapon_hegrenade")
give_item(id, "weapon_flashbang")
give_item(id, "weapon_flashbang")
give_item(id, "weapon_smokegrenade")
}
w takim razie tak zadziala
#5
Napisano 18.08.2011 14:05
#include <amxmisc>
#include <fun>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "DarkGL"
#define restartRound() server_cmd("sv_restartround 1")
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
set_task(15.0,"vRestart")
set_task(16.0,"vRestart")
set_task(17.0,"vRestart")
set_task(18.0,"daj")
}
public vRestart(){
restartRound()
}
public daj(id) {
if(is_user_alive(id)){
give_item(id, "weapon_m4a1")
give_item(id, "ammo_556nato")
give_item(id, "ammo_556nato")
give_item(id, "ammo_556nato")
give_item(id, "ammo_556nato")
give_item(id, "weapon_hegrenade")
give_item(id, "weapon_flashbang")
give_item(id, "weapon_flashbang")
give_item(id, "weapon_smokegrenade")
}
}
Użytkownik DAMIANq edytował ten post 18.08.2011 14:06
#6
Napisano 18.08.2011 14:08
#7
Napisano 18.08.2011 14:19
#include <amxmisc>
#include <amxmodx>
#include <fun>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "DarkGL"
#define restartRound() server_cmd("sv_restartround 1")
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
set_task(15.0,"vRestart")
set_task(16.0,"vRestart")
set_task(17.0,"vRestart")
set_task(18.0,"daj")
}
public vRestart(){
restartRound()
}
public daj(id) {
if(is_user_alive(id)){
give_item(id, "weapon_m4a1")
give_item(id, "ammo_556nato")
give_item(id, "ammo_556nato")
give_item(id, "ammo_556nato")
give_item(id, "ammo_556nato")
give_item(id, "weapon_hegrenade")
give_item(id, "weapon_flashbang")
give_item(id, "weapon_flashbang")
give_item(id, "weapon_smokegrenade")
}
}
#8
Napisano 18.08.2011 14:23
a funkcja give_item musi mieć id
static cell AMX_NATIVE_CALL give_item(AMX *amx, cell *params) // native give_item(index, const item[]); = 2 params
{
/* Gives item to player, name of item can start
* with weapon_, ammo_ and item_. This event
* is announced with proper message to all players. */
// params[1] = index
// params[2] = item...
// Check index.
CHECK_PLAYER(params[1]);
// Get player pointer.
edict_t *pPlayer = MF_GetPlayerEdict(params[1]);
// Create item entity pointer
edict_t *pItemEntity;
// Make an "intstring" out of 2nd parameter
int length;
const char *szItem = MF_GetAmxString(amx, params[2], 1, &length);
//check for valid item
if (strncmp(szItem, "weapon_", 7) &&
strncmp(szItem, "ammo_", 5) &&
strncmp(szItem, "item_", 5) &&
strncmp(szItem, "tf_weapon_", 10)
) {
return 0;
}
//string_t item = MAKE_STRING(szItem);
string_t item = ALLOC_STRING(szItem); // Using MAKE_STRING makes "item" contents get lost when we leave this scope! ALLOC_STRING seems to allocate properly...
// Create the entity, returns to pointer
pItemEntity = CREATE_NAMED_ENTITY(item);
if (FNullEnt(pItemEntity)) {
MF_LogError(amx, AMX_ERR_NATIVE, "Item \"%s\" failed to create", szItem);
return 0;
}
//VARS(pItemEntity)->origin = VARS(pPlayer)->origin; // nice to do VARS(ent)->origin instead of ent->v.origin? :-I
//I'm not sure, normally I use macros too =P
pItemEntity->v.origin = pPlayer->v.origin;
pItemEntity->v.spawnflags |= SF_NORESPAWN; //SF_NORESPAWN;
MDLL_Spawn(pItemEntity);
int save = pItemEntity->v.solid;
MDLL_Touch(pItemEntity, ENT(pPlayer));
//The problem with the original give_item was the
// item was not removed. I had tried this but it
// did not work. OLO's implementation is better.
/*
int iEnt = ENTINDEX(pItemEntity->v.owner);
if (iEnt > 32 || iEnt <1 ) {
MDLL_Think(pItemEntity);
}*/
if (pItemEntity->v.solid == save) {
REMOVE_ENTITY(pItemEntity);
//the function did not fail - we're just deleting the item
return -1;
}
return ENTINDEX(pItemEntity);
}
sprawdź ten kod
#include <amxmodx>
#include <fun>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "DarkGL"
#define restartRound() server_cmd("sv_restartround 1")
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
set_task(15.0,"vRestart")
set_task(16.0,"vRestart")
set_task(17.0,"vRestart")
set_task(20.0,"daj")
}
public vRestart(){
restartRound()
}
public daj(){
for(new id = 1;id<33;id++){
if(!is_user_alive(id)) continue;
give_item(id, "weapon_m4a1")
give_item(id, "ammo_556nato")
give_item(id, "ammo_556nato")
give_item(id, "ammo_556nato")
give_item(id, "ammo_556nato")
give_item(id, "weapon_hegrenade")
give_item(id, "weapon_flashbang")
give_item(id, "weapon_flashbang")
give_item(id, "weapon_smokegrenade")
}
}
💸 SellYourSkins.com - Łatwo sprzedaj swoje skiny do CS:GO
💸⇄🃏 Automatyczny Bot Levelowania Steam - LVLUPSteam.com
🛒Coinsy CSGOPolygon Za SMS, PSC, Przelew - CoinSell.pro
Twój Sklep CS2 - CSGOPAKA
Coinsy do CSGOPolygon, CSGO500, CSGOEmpire - CSGOLombard.com
💸 Graj w CS2 / CS 1.6 i zarabiaj - BoostProject.pro
CS2 Gambling Sites and Free Betting Codes - DreamCodes.gg
Otwieraj skrzynki i wygrywaj najlepsze skiny CS2 na SkinsProject.gg
🤑 Accept CS2 skins for online payments and donations - SkinsMoney
Płatności SMS Premium Rate oraz Direct Biling - SimPay.pl
Szukasz noclegu? Kwatery, noclegi, tanie noclegi, wakacje oferty, wczasy nad jeziorem - RuszajWPolske.pl
StreamPay.pl - Legalna platforma do dotacji dla streamerów i twórców
#9
Napisano 18.08.2011 14:24
#include <amxmodx>
#include <amxmisc>
#include <fun>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "DarkGL"
#define restartRound() server_cmd("sv_restartround 1")
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
set_task(15.0,"vRestart")
set_task(16.0,"vRestart")
set_task(17.0,"vRestart")
set_task(18.0,"daj")
}
public vRestart(){
restartRound()
}
public daj()
{
for(new id=1; id<33; id++)
{
if(is_user_alive(id))
{
give_item(id, "weapon_m4a1")
give_item(id, "ammo_556nato")
give_item(id, "ammo_556nato")
give_item(id, "ammo_556nato")
give_item(id, "ammo_556nato")
give_item(id, "weapon_hegrenade")
give_item(id, "weapon_flashbang")
give_item(id, "weapon_flashbang")
give_item(id, "weapon_smokegrenade")
}
}
}
EDIT: Damn, uprzedził mnie
Użytkownik Goliath edytował ten post 18.08.2011 14:26
#10
Napisano 18.08.2011 18:01
Dodano 18 sierpień 2011 - 18:41:
Hmmm tak się składa, że albo coś źle robie albo on nadal nie działa. Dlaczego?
Dodano 18 sierpień 2011 - 18:46:
Juz wiem o co chodzi. Bron i granaty dostaje po 2 restarcie a wiec ona mi sie kasuje za 3 restartem.
#11
Napisano 18.08.2011 19:41
#include <amxmodx>
#include <hamsandwich>
#include <fun>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "DarkGL"
#define restartRound() server_cmd("sv_restartround 1")
new HamHook:pHook;
new iIle = 0;
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
set_task(15.0,"vRestart")
set_task(16.0,"vRestart")
set_task(17.0,"vRestart")
}
public vRestart(){
iIle++;
restartRound()
if(iIle == 3){
pHook = RegisterHam(Ham_Spawn,"player","fwSpawned",1)
set_task(4.0,"disableHook")
}
}
public disableHook(){
DisableHamForward(pHook)
}
public fwSpawned(id){
if(!is_user_alive(id))
return HAM_IGNORED;
give_item(id, "weapon_m4a1")
give_item(id, "ammo_556nato")
give_item(id, "ammo_556nato")
give_item(id, "ammo_556nato")
give_item(id, "ammo_556nato")
give_item(id, "weapon_hegrenade")
give_item(id, "weapon_flashbang")
give_item(id, "weapon_flashbang")
give_item(id, "weapon_smokegrenade")
return HAM_IGNORED;
}
💸 SellYourSkins.com - Łatwo sprzedaj swoje skiny do CS:GO
💸⇄🃏 Automatyczny Bot Levelowania Steam - LVLUPSteam.com
🛒Coinsy CSGOPolygon Za SMS, PSC, Przelew - CoinSell.pro
Twój Sklep CS2 - CSGOPAKA
Coinsy do CSGOPolygon, CSGO500, CSGOEmpire - CSGOLombard.com
💸 Graj w CS2 / CS 1.6 i zarabiaj - BoostProject.pro
CS2 Gambling Sites and Free Betting Codes - DreamCodes.gg
Otwieraj skrzynki i wygrywaj najlepsze skiny CS2 na SkinsProject.gg
🤑 Accept CS2 skins for online payments and donations - SkinsMoney
Płatności SMS Premium Rate oraz Direct Biling - SimPay.pl
Szukasz noclegu? Kwatery, noclegi, tanie noclegi, wakacje oferty, wczasy nad jeziorem - RuszajWPolske.pl
StreamPay.pl - Legalna platforma do dotacji dla streamerów i twórców
#12
Napisano 18.08.2011 20:10
#13
Napisano 19.08.2011 19:03
Ten temat został zamknięty przez moderatora.
Powód: Rozwiązane
Jeśli się z tym nie zgadzasz,
raportuj ten post, a moderator lub administrator rozpatrzy go ponownie.Z pozdrowieniami,
Zespół AMXX.PL
Użytkownicy przeglądający ten temat: 1
0 użytkowników, 1 gości, 0 anonimowych


Dodatki SourceMod



Temat jest zamknięty









