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
 

Kaskader - zdjęcie

Kaskader

Rejestracja: 22.11.2009
Aktualnie: Nieaktywny
Poza forum Ostatnio: 02.04.2012 21:28
-----

Moje tematy

Ograniczenie tablic dla graczy?

18.03.2012 16:34

Witam!

Używam w swoim pluginie 13 zmiennych (globalnych):

new iKillZombie[32], iKillHuman[32];
new iInfections[32], iInfected[32];
new iAntidoted[32];
new iDeath[32];
new iLastZombie[32], iLastHuman[32];
new iNemesis[32], iAssassin[32];
new iSurvivor[32], iSniper[32];
new iFirstZombie[32];


Chciałbym teraz dodać jeszcze kilka, ale dodanie nawe jednej, powoduje problemy, ponieważ, nie aktualizuje wartości 14 zmiennej, która wygląda tak:
new iLZInfect[32];


Jeżeli ustawiam ją tak:
new iLZInfect;

i używam jej w tych samych miejscach, co tą z [32], to przyjmuje poprawe wartości, ale to nie przejdzie, ponieważ potrzebuję wartości odzielnych dla każdego gracza.

Da się coś z tym zrobić?

[ROZWIĄZANE] Brak połączenia z bazą danych

18.03.2012 00:31

Witam!

Piszę sobie rank pod zombi, ale mam problem z połączeniem się z bazą danych. Tak przynajmniej mi się wydaje, bo po wejści na serwer powinna wykonać się funkcja dodająca gracza do bazy danych, ale się tak nie dzieje. Plugin pisany na podstawie tutka z waszego forum.

Kod:

#include <amxmodx>
#include <sqlx>
#include <zombieplague>
#include <zp50_core>
#include <zp50_gamemodes>
#define LIBRARY_NEMESIS "zp50_class_nemesis"
#include <zp50_class_nemesis>
#define LIBRARY_SURVIVOR "zp50_class_survivor"
#include <zp50_class_survivor>
#define LIBRARY_SNIPER "zp50_class_sniper"
#include <zp50_class_sniper>
#define LIBRARY_ASSASSIN "zp50_class_assassin"
#include <zp50_class_assassin>
new Handle:Connect;
new iKillZombie[33], iKillHuman[33];
new iInfections[33], iInfected[33];
new iAntidoted[33];
new iDeath[33];
new iLastZombie[33], iLastHuman[33];
new iNemesis[33], iAssassin[33];
new iSurvivor[33], iSniper[33];
new iFirstZombie[33];
public plugin_init() {
register_plugin("[ZP] Rank", "1.0", "Szapko");

register_event("DeathMsg", "DeathEvent", "a");

Connect = SQL_MakeDbTuple("IP", " ", "PASS", " ");
}
public plugin_natives() {
set_module_filter("module_filter");
set_native_filter("native_filter");
}
public module_filter(const module[]) {
if (equal(module, LIBRARY_NEMESIS) || equal(module, LIBRARY_SURVIVOR) || equal(module, LIBRARY_SNIPER) || equal(module, LIBRARY_ASSASSIN))
return PLUGIN_HANDLED;

return PLUGIN_CONTINUE;
}
public native_filter(const name[], index, trap) {
if (!trap)
return PLUGIN_HANDLED;

return PLUGIN_CONTINUE;
}
check_data(id) {
new DataID[1];
new qCommand[512], PlayerID[32];

DataID[0] = id;

get_user_name(id, PlayerID, charsmax(PlayerID));

format(qCommand, sizeof qCommand-1, "SELECT * FROM zp_rank WHERE 'zp_nick'=%s", PlayerID);
SQL_ThreadQuery(Connect, "handler_check", qCommand, DataID, 1);
}
public save_rank(id) {
new DataID[1];
new qCommand[512], PlayerID[32];

DataID[0] = id;

get_user_name(id, PlayerID, charsmax(PlayerID));
format(qCommand, sizeof qCommand-1, "INSERT INTO zp_rank VALUES ('', %s, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i);", PlayerID, iKillZombie[id], iKillHuman[id], iDeath[id], iInfections[id], iInfected[id], iAntidoted[id], iLastZombie[id], iLastHuman[id], iFirstZombie[id], iNemesis[id], iAssassin[id] ,iSurvivor[id] ,iSniper[id]);

SQL_ThreadQuery(Connect, "handler_save", qCommand, DataID, 1);
return PLUGIN_CONTINUE;
}
remove_all(id) {
iKillZombie[id] = 0;
iKillHuman[id] = 0;
iDeath[id] = 0;
iInfections[id] = 0;
iInfected[id] = 0;
iAntidoted[id] = 0;
iLastZombie[id] = 0;
iLastHuman[id] = 0;
iFirstZombie[id] = 0;
iNemesis[id] = 0;
iAssassin[id] = 0;
iSurvivor[id] = 0;
iSniper[id] = 0;
}
public client_disconnect(id) {
check_data(id);
remove_all(id);
}
public client_putinserver(id) {
remove_all(id);
check_data(id);
}
public plugin_end() {
//SQL_FreeHandle(Connect);
}
public handler_save(FailState, Handle:Query, Errorcode, Error[], Data[], DataSize) {
//new id = Data[0];

if (Errorcode) {
log_amx("[RANK] Blad w zapytaniu: %s [save_rank]", Error);
}
if (FailState == TQUERY_CONNECT_FAILED) {
log_amx("[RANK] Nie mozna podlaczyc sie do bazy danych");
return PLUGIN_CONTINUE;
} else if(FailState == TQUERY_QUERY_FAILED) {
log_amx("[RANK] Zapytanie anulowane [save_rank]");
return PLUGIN_CONTINUE;
}

return PLUGIN_CONTINUE;
}
public handler_check(FailState, Handle:Query, Errorcode, Error[], Data[], DataSize) {
new id = Data[0];

if (Errorcode) {
log_amx("[RANK] Blad w zapytaniu: %s [check_data]", Error);
}
if (FailState == TQUERY_CONNECT_FAILED) {
log_amx("[RANK] Nie mozna podlaczyc sie do bazy danych");
return PLUGIN_CONTINUE;
} else if(FailState == TQUERY_QUERY_FAILED) {
log_amx("[RANK] Zapytanie anulowane [check_data]");
return PLUGIN_CONTINUE;
}

if (!SQL_MoreResults(Query)) {
save_rank(id);
} else {
iKillZombie[id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "zp_kill_zombie"));
iKillHuman[id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "zp_kill_human"));
iDeath[id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "zp_death"));
iInfections[id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "zp_infections"));
iInfected[id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "zp_infected"));
iAntidoted[id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "zp_antidoted"));
iLastZombie[id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "zp_last_zombie"));
iLastHuman[id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "zp_last_human"));
iFirstZombie[id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "zp_first_zombie"));
iNemesis[id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "zp_nemesis"));
iAssassin[id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "zp_assassin"));
iSurvivor[id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "zp_survivor"));
iSniper[id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "zp_sniper"));
}

return PLUGIN_CONTINUE;
}


Jest to tylko część kodu odpowiadająca za zapisywanie i wczytywanie. Oczywiście dane do serwera wypełniam tak jak trzeba, bo mam na serwerze już amxbans, który działa i korzystam z tej samej bazy danych.

Szukam kilku pluginów do Zombie Plague

08.02.2012 16:10

Witam. Mam problem, gdyż nie mogę znaleźć kilku pluginów jak ktoś może takie posiada to z góry dzięki za pomoc.

1. Po wpisaniu w czacie /slm można sprzedać mine za 6 AP.
2. Na koniec rundy sprzedaje twoje wszystkie miny, nawet te postawione.
3. Wyświetlający się tryb gry w prawym górnym rogu, tylko taki który działa pod zombie plague advance czyli z trybami assasin, armagedon i snajper.
4. Po wpisaniu /ap wyświetla ile masz ap.
5. I widziałem kiedyś na serwerze, że oprócz AP był także bonusy i zastanawiam się czy to było zrobione indywidualnie czy można taki plugin znaleźć.
6. I Bomba Anti dla ludzi, czyli coś jak bomba zarażająca tylko, że na odwrót.

Pierwsze dwa jakby co znalazłem, jakby ktoś mógł to niech zapoda resztę :)

ZP Jak dodać nowe tryby do wyświetlanych trybów

06.02.2012 05:12

Witam, nigdzie nie znalazłem odpowiedzi dlatego zakładam ten temat. Otóż wgrałem sobie zombie plague advance i tam doszły mi nowe tryby gry ale mam także plugin wyświetlający aktualnie grany tryb gry. I chciałbym dowiedzieć się jak dodac te nowe tryby do tego pluginu, oto kod:


/*================================================================================
[[ZP] Addon: Display the Current Mode
Copyright © 2009 by meTaLiCroSS, Vińa del Mar, Chile

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

In addition, as a special exception, the author gives permission to
link the code of this program with the Half-Life Game Engine ("HL
Engine") and Modified Game Libraries ("MODs") developed by Valve,
L.L.C ("Valve"). You must obey the GNU General Public License in all
respects for all of the code used other than the HL Engine and MODs
from Valve. If you modify this file, you may extend this exception
to your version of the file, but you are not obligated to do so. If
you do not wish to do so, delete this exception statement from your
version.

** Credits:

- Exolent[jNr]: Big plugin optimization
=================================================================================*/
#include <amxmodx>
#include <zombieplague>
/*================================================================================
[Customizations]
=================================================================================*/
// Hudmessage tag
new const hud_tag[] = "Current Mode: "
// Name for each Hudmessage Mode
new const mode_names[][] =
{
"Zaczekaj na rozpoczecie...", // No mode Started
"Infekcja", // Normal Infection, single round
"Nemek", // Nemesis Mode (zombie boss)
"Survek", // Survivor Mode (human boss)
"Swarm", // Swarm round (no infections)
"Multi-Infekcja", // Multiple Infection (like single round, but, more than 1 zombie)
"Plaga", // Plague round (nemesis & zombies vs. survivors & humans)
"Inny tryb" // An unofficial mode (edited/created/modified by user)
}
// RGB Colors for each Hudmessage Mode
// See here some RGB Colors: http://web.njit.edu/...in/rgb.txt.html
new const rgb_hud_colors[sizeof(mode_names)][3] =
{
// R G B
{255, 255, 255}, // No mode Started
{0, 255, 0}, // Normal Infection, single round
{255, 0, 0}, // Nemesis Mode (zombie boss)
{0, 0, 255}, // Survivor Mode (human boss)
{255, 255, 0}, // Swarm round (no infections)
{0, 255, 0}, // Multiple Infection (like single round, but, more than 1 zombie)
{255, 0, 0}, // Plague round (nemesis & zombies vs. survivors & humans)
{255, 255, 255} // An unofficial mode (edited/created/modified by user)
}
// X Hudmessage Position ( --- )
const Float:HUD_MODE_X = 0.65
// Y Hudmessage Position ( ||| )
const Float:HUD_MODE_Y = 0.2
// Time at which the Hudmessage is displayed. (when user is puted into the Server)
const Float:START_TIME = 3.0
/*================================================================================
Customization ends here! Yes, that's it. Editing anything beyond
here is not officially supported. Proceed at your own risk...
=================================================================================*/
// Variables
new g_SyncHud, g_Mode
// Cvar pointers
new cvar_enable, cvar_central
public plugin_init()
{
// Plugin Info
register_plugin("[ZP] Addon: Display the Current Mode", "0.1.6", "meTaLiCroSS")

// Round Start Event
register_event("HLTV", "event_RoundStart", "a", "1=0", "2=0")

// Enable Cvar
cvar_enable = register_cvar("zp_display_mode", "1")

// Server Cvar
register_cvar("zp_addon_dtcm", "v0.1.6 by meTaLiCroSS", FCVAR_SERVER|FCVAR_SPONLY)

// Variables
g_SyncHud = CreateHudSyncObj()

// Getting "zp_on" cvar
if(cvar_exists("zp_on"))
cvar_central = get_cvar_pointer("zp_on")

// If Zombie Plague is not running (bugfix)
if(!get_pcvar_num(cvar_central))
pause("a")
}
public client_putinserver(id)
{
// Setting Hud
set_task(START_TIME, "mode_hud", id, _, _, "b")
}
public event_RoundStart()
{
// Update var (no mode started / in delay)
g_Mode = 0
}
public mode_hud(id)
{
// If the Cvar isn't enabled
if(!get_pcvar_num(cvar_enable))
return;

// Hud Options
set_hudmessage(rgb_hud_colors[g_Mode][0], rgb_hud_colors[g_Mode][1], rgb_hud_colors[g_Mode][2], HUD_MODE_X, HUD_MODE_Y, 0, 6.0, 12.0)

// Now the hud appears
ShowSyncHudMsg(id, g_SyncHud, "%s%s", (g_Mode == 0 ? "" : hud_tag), mode_names[g_Mode])
}
public zp_round_started(mode, id)
{
// Update var with Mode num
g_Mode = mode

// An unofficial mode
if(!(1 <= mode < (sizeof(mode_names) - 1)))
g_Mode = sizeof(mode_names) - 1
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1034\\ f0\\ fs16 \n\\ par }
*/



Proszę o odpowiedź, gdyż sprawa pilna. Z góry dzięki.