#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.
|
Guest Message by DevFuse
Jak dodac do pluginu aby dawalo bron po restarcie
Temat rozp.
NewBorn
, 18.08.2011 13:36
12 odpowiedzi w tym temacie
#1
Napisano 18.08.2011 13:36
Witam mam pytanie jak dodać do tego kodu (jest to kod aby 15 sek po zmienieniu mapy restartowalo runde) zeby po tych 3 restartach dawalo m4 + ammo + all granaty?? Lecą + za pomoc
#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
Sprawdzam
Dodano 18 sierpień 2011 - 13:49:
Nie działa ;/
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
A to?
#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
Dobra zobacze jak wróce macie po +
#7
Napisano 18.08.2011 14:19
@DAMIANq - jesli juz dajesz taki warunek to moze jeszcze dodasz include?
#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
w tym co daliście id = 0
a funkcja give_item musi mieć id
sprawdź ten kod
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") } }
#9
Napisano 18.08.2011 14:24
Wasze kody nie będą działać .
EDIT: Damn, uprzedził mnie
#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
Ok wszyscy co pomogli macie po + Juz sprawdzam kogo działa
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.
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
sprawdź
#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; }
#12
Napisano 18.08.2011 20:10
Teraz działa dzięki
#13
Napisano 19.08.2011 19:03
Wiadomość wygenerowana automatycznie
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
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: 0
0 użytkowników, 0 gości, 0 anonimowych