Problem z rankingiem i PokeModem
mkardas98
25.05.2012
Witam! Mam otóż 3 problemy.
1. Ranking po restarcie się kasuje. (pozostają tylko nicki bez punktów)
2. Nie zapisuja się lvl pokemonów po restarcie.
3. Jak zwiększyć exp za zabójstwo?
Proszę o szybką odpowiedź.
amxx.cfg
// AMX Mod X Configuration File
echo Executing AMX Mod X Configuration File
// Default access for all non admin players (see users.ini for access details)
//
// Default value: "z"
amx_default_access "z"
// Name of setinfo which should store a password on a client (you should change this)
// Note: Always prefix the field with an underscore (aka: "_")
// (Example: setinfo _pw "password")
//
// Default value: "_pw"
amx_password_field "_pw"
// Mode of logging to a server
// 0 - disable logging, players won't be checked (and access won't be set)
// 1 - normal mode which obey flags set in accounts
// 2 - kick all players not on list
//
// Default value: 1
amx_mode 1
// Show admins activity
// 0 - disabled
// 1 - show without admin name
// 2 - show with name
//
// Default value: 2
amx_show_activity 2
// Frequency in seconds and text of scrolling message
//
// Default value: "Welcome to %hostname% -- This server is using AMX Mod X" 600
amx_scrollmsg "Welcome to %hostname% -- This server is using AMX Mod X" 600
// Center typed colored messages (last parameter is a color in RRRGGGBBB format)
//
// Default values: "Welcome to %hostname%" "000255100"
// "This server is using AMX ModX\nVisit http://www.amxmodx.org" "000100255"
amx_imessage "Welcome to %hostname%" "000255100"
amx_imessage "This server is using AMX Mod X\nVisit http://www.amxmodx.org" "000100255"
// Frequency in seconds of colored messages
//
// Default value: 180
amx_freq_imessage 180
// Ban times for the main ban menu (amx_banmenu)
// Use 0 for permanent ban
// Default values: 0 5 10 15 30 45 60
amx_plmenu_bantimes 0 5 10 15 30 45 60
// Slap damage amounts for the main slap menu (amx_slapmenu)
// Slay is automaticall inserted as the first option
// Default values: 0 1 5
amx_plmenu_slapdmg 0 1 5
// Set in seconds how fast players can chat (chat-flood protection)
//
// Default value: 0.75
amx_flood_time 0.75
// Amount of slots to reserve.
//
// Default value: 0
amx_reservation 0
// If you set this to 1, you can hide slots on your server.
// If server "full" of public slots and slots hidden, you must manually connect with connect console command
//
// Default value: 0
amx_hideslots 0
// Displaying of time remaining
// a - display white text on bottom
// b - use voice
// c - don't add "remaining" (only in voice)
// d - don't add "hours/minutes/seconds" (only in voice)
// e - show/speak if current time is less than this set in parameter
//
// Default value: "ab 1200" "ab 600" "ab 300" "ab 180" "ab 60" "bcde 11"
amx_time_display "ab 1200" "ab 600" "ab 300" "ab 180" "ab 60" "bcde 11"
// Announce "say thetime" and "say timeleft" with voice, set to 0 to disable.
//
// Default value: 1
amx_time_voice 1
// Minimum delay in seconds between two voting sessions
//
// Default value: 10
amx_vote_delay 10
// How long voting session goes on
//
// Default value: 10
amx_vote_time 10
// Display who votes for what option, set to 0 to disable, 1 to enable.
//
// Default value: 1
amx_vote_answers 1
// Some ratios for voting success
// Default value: 0.40
amx_votekick_ratio 0.40
// Default value: 0.40
amx_voteban_ratio 0.40
// Default value: 0.40
amx_votemap_ratio 0.40
// Default value: 0.02
amx_vote_ratio 0.02
// Max. time to which map can be extended
//
// Default value: 90
amx_extendmap_max 90
// Step for each extending
//
// Default value: 15
amx_extendmap_step 15
// If you set this to 0, clients cannot chose their language, instead they use
// whatever language the server is configured to use.
//
// Default value: 1
amx_client_languages 1
// Plugin Debug mode
// 0 - No debugging (garbage line numbers)
// 1 - Plugins with "debug" option in plugins.ini are put into debug mode
// 2 - All plugins are put in debug mode
// Note - debug mode will affect JIT performance
//
// Default value: 1
amx_debug 1
// Plugin MultiLingual Debug
// To debug a language put its 2 letter code between quotes ("en", "de", etc)
// "" means disabled
//
// Default value: ""
amx_mldebug ""
//
// Beginning of Counter-Strike package specific configurations.
//
// Rank mode
// 0 - by nick
// 1 - by authid
// 2 - by ip
//
// Default value: 0
csstats_rank 0
// Max size of the stats file
//
// Default value: 3500
csstats_maxsize 3500
// Whether or not to rank bots with csstats - set to 1 to rank bots, 0 otherwise.
//
// Default value: 0
csstats_rankbots 0
// Duration of HUD-statistics
//
// Default value: 12.0
amx_statsx_duration 12.0
// HUD-statistics display limit relative round freeze end
// Negative time will clear the HUD-statstics before the round freeze time has ended
//
// Default value: -2.0
amx_statsx_freeze -2.0
amx_showc4timer 3 - Wyłączone | Tylko TT | Tylko CT | Wszyscy (Optymalnie: 3)
amx_showc4flash 0 - Sprite flashing (Optymalnie: 0)
amx_showc4sprite 1 - Choose from 2 sprites (Optymalnie: 1)
amx_showc4msg 0 - Shows a hud message about the timer (Optymalnie: 0)
poke_plantxp 500 // ile expa ma dawać za podłożenie bomby
poke_defusxp 500 // ile expa ma dawać za rozbrojenie bomby
poke_rescuxp 150 // ile expa ma dawać za uratowanie JEDNEGO hosta
poke_wygranarunda 300 (ustawia ile expa ma dostac wygrana runda , domyslnie 10)
poke_iloscosob 2 (ustawia ile osob musi byc na serwerze aby dodawalo expa za wygrana runda , domyslnie 3)
dmap_strict 0 - (Domyślnie 0) Jeżeli ustawimy na 1 jedynie mapy z mapcycle mogą być nominowane.
enforce_timelimit 0 - (Domyślnie 0) zmiana mapy tylko i wyłącznie po upływie czasu
timelimit czyli czasu mapy, kiedy jest ustawione na 1.
emptymap_allowed 0 - (Domyślnie 0) Aby włączyć / wyłączyć tę funkcję
amx_emptymap 0 - (Domyślnie "" albo 0 ) Chcesz aby serwer zmieniał na jakąkolwiek mape
amx_staytime 5 - (Domyślnie 0) po ilu sekundach można nominować następną mape
amx_idletime 0 - (Domyślnie 0) Ile godzin gracz nie możę zostać połączony z serwerm
nominations_allowed 0 - umożliwia godzenie się z nominacjami
weapon_delay - Na mapach fy_ itp umożliwia czekanie zanim wezmiesz broń
sv_colored_smoke 1
//0 - kolorowe dymy wyłączone
//1 - losowe wybieranie spośród 6-ściu kolorów
//2 - Według drużyny - dym będzie miał kolor drużyny która żuciła granat
1. Ranking po restarcie się kasuje. (pozostają tylko nicki bez punktów)
2. Nie zapisuja się lvl pokemonów po restarcie.
3. Jak zwiększyć exp za zabójstwo?
Proszę o szybką odpowiedź.
amxx.cfg
// AMX Mod X Configuration File
echo Executing AMX Mod X Configuration File
// Default access for all non admin players (see users.ini for access details)
//
// Default value: "z"
amx_default_access "z"
// Name of setinfo which should store a password on a client (you should change this)
// Note: Always prefix the field with an underscore (aka: "_")
// (Example: setinfo _pw "password")
//
// Default value: "_pw"
amx_password_field "_pw"
// Mode of logging to a server
// 0 - disable logging, players won't be checked (and access won't be set)
// 1 - normal mode which obey flags set in accounts
// 2 - kick all players not on list
//
// Default value: 1
amx_mode 1
// Show admins activity
// 0 - disabled
// 1 - show without admin name
// 2 - show with name
//
// Default value: 2
amx_show_activity 2
// Frequency in seconds and text of scrolling message
//
// Default value: "Welcome to %hostname% -- This server is using AMX Mod X" 600
amx_scrollmsg "Welcome to %hostname% -- This server is using AMX Mod X" 600
// Center typed colored messages (last parameter is a color in RRRGGGBBB format)
//
// Default values: "Welcome to %hostname%" "000255100"
// "This server is using AMX ModX\nVisit http://www.amxmodx.org" "000100255"
amx_imessage "Welcome to %hostname%" "000255100"
amx_imessage "This server is using AMX Mod X\nVisit http://www.amxmodx.org" "000100255"
// Frequency in seconds of colored messages
//
// Default value: 180
amx_freq_imessage 180
// Ban times for the main ban menu (amx_banmenu)
// Use 0 for permanent ban
// Default values: 0 5 10 15 30 45 60
amx_plmenu_bantimes 0 5 10 15 30 45 60
// Slap damage amounts for the main slap menu (amx_slapmenu)
// Slay is automaticall inserted as the first option
// Default values: 0 1 5
amx_plmenu_slapdmg 0 1 5
// Set in seconds how fast players can chat (chat-flood protection)
//
// Default value: 0.75
amx_flood_time 0.75
// Amount of slots to reserve.
//
// Default value: 0
amx_reservation 0
// If you set this to 1, you can hide slots on your server.
// If server "full" of public slots and slots hidden, you must manually connect with connect console command
//
// Default value: 0
amx_hideslots 0
// Displaying of time remaining
// a - display white text on bottom
// b - use voice
// c - don't add "remaining" (only in voice)
// d - don't add "hours/minutes/seconds" (only in voice)
// e - show/speak if current time is less than this set in parameter
//
// Default value: "ab 1200" "ab 600" "ab 300" "ab 180" "ab 60" "bcde 11"
amx_time_display "ab 1200" "ab 600" "ab 300" "ab 180" "ab 60" "bcde 11"
// Announce "say thetime" and "say timeleft" with voice, set to 0 to disable.
//
// Default value: 1
amx_time_voice 1
// Minimum delay in seconds between two voting sessions
//
// Default value: 10
amx_vote_delay 10
// How long voting session goes on
//
// Default value: 10
amx_vote_time 10
// Display who votes for what option, set to 0 to disable, 1 to enable.
//
// Default value: 1
amx_vote_answers 1
// Some ratios for voting success
// Default value: 0.40
amx_votekick_ratio 0.40
// Default value: 0.40
amx_voteban_ratio 0.40
// Default value: 0.40
amx_votemap_ratio 0.40
// Default value: 0.02
amx_vote_ratio 0.02
// Max. time to which map can be extended
//
// Default value: 90
amx_extendmap_max 90
// Step for each extending
//
// Default value: 15
amx_extendmap_step 15
// If you set this to 0, clients cannot chose their language, instead they use
// whatever language the server is configured to use.
//
// Default value: 1
amx_client_languages 1
// Plugin Debug mode
// 0 - No debugging (garbage line numbers)
// 1 - Plugins with "debug" option in plugins.ini are put into debug mode
// 2 - All plugins are put in debug mode
// Note - debug mode will affect JIT performance
//
// Default value: 1
amx_debug 1
// Plugin MultiLingual Debug
// To debug a language put its 2 letter code between quotes ("en", "de", etc)
// "" means disabled
//
// Default value: ""
amx_mldebug ""
//
// Beginning of Counter-Strike package specific configurations.
//
// Rank mode
// 0 - by nick
// 1 - by authid
// 2 - by ip
//
// Default value: 0
csstats_rank 0
// Max size of the stats file
//
// Default value: 3500
csstats_maxsize 3500
// Whether or not to rank bots with csstats - set to 1 to rank bots, 0 otherwise.
//
// Default value: 0
csstats_rankbots 0
// Duration of HUD-statistics
//
// Default value: 12.0
amx_statsx_duration 12.0
// HUD-statistics display limit relative round freeze end
// Negative time will clear the HUD-statstics before the round freeze time has ended
//
// Default value: -2.0
amx_statsx_freeze -2.0
amx_showc4timer 3 - Wyłączone | Tylko TT | Tylko CT | Wszyscy (Optymalnie: 3)
amx_showc4flash 0 - Sprite flashing (Optymalnie: 0)
amx_showc4sprite 1 - Choose from 2 sprites (Optymalnie: 1)
amx_showc4msg 0 - Shows a hud message about the timer (Optymalnie: 0)
poke_plantxp 500 // ile expa ma dawać za podłożenie bomby
poke_defusxp 500 // ile expa ma dawać za rozbrojenie bomby
poke_rescuxp 150 // ile expa ma dawać za uratowanie JEDNEGO hosta
poke_wygranarunda 300 (ustawia ile expa ma dostac wygrana runda , domyslnie 10)
poke_iloscosob 2 (ustawia ile osob musi byc na serwerze aby dodawalo expa za wygrana runda , domyslnie 3)
dmap_strict 0 - (Domyślnie 0) Jeżeli ustawimy na 1 jedynie mapy z mapcycle mogą być nominowane.
enforce_timelimit 0 - (Domyślnie 0) zmiana mapy tylko i wyłącznie po upływie czasu
timelimit czyli czasu mapy, kiedy jest ustawione na 1.
emptymap_allowed 0 - (Domyślnie 0) Aby włączyć / wyłączyć tę funkcję
amx_emptymap 0 - (Domyślnie "" albo 0 ) Chcesz aby serwer zmieniał na jakąkolwiek mape
amx_staytime 5 - (Domyślnie 0) po ilu sekundach można nominować następną mape
amx_idletime 0 - (Domyślnie 0) Ile godzin gracz nie możę zostać połączony z serwerm
nominations_allowed 0 - umożliwia godzenie się z nominacjami
weapon_delay - Na mapach fy_ itp umożliwia czekanie zanim wezmiesz broń
sv_colored_smoke 1
//0 - kolorowe dymy wyłączone
//1 - losowe wybieranie spośród 6-ściu kolorów
//2 - Według drużyny - dym będzie miał kolor drużyny która żuciła granat
Rob Zombie `
25.05.2012
1.
3. pokaż sma
csstats_maxsize 3500na
csstats_maxsize 999992. pokaż sma
3. pokaż sma
mkardas98
26.05.2012
////////////////////////////////////////////////
// ___ _ _ //
// / _ \___ | | _____ /\/\ ___ __| | //
// / /_)/ _ \| |/ / _ \/ \ / _ \ / _` | //
// / ___/ (_) | < __/ /\/\ \ (_) | (_| | //
// /_/ \___/|_|\_\___\/ \/\___/ \__,_| //
// //
////////////////////////////////////////////////
// //
// Welcome to The World of Pokemon. //
// //
////////////////////////////////////////////////
/*
//--ChangeLog--//
* v1.2.3 RC 2 - 0?/??/08
* - Fixed some problems with skills
* - Fixed some default skill/pokemon properties
* - New define TOUCH_SKILL_TEAM in custom.inl
* - Fixed "okemon" in PokeMart menu
* - Catch items with over 1000 chance will now catch pokemon with 'e' flag and pokemon above MAX_CATCH_LEVEL
* - Fixed problem with admin commands effecting @TEAMS
* - Fixed problem with first pokeitem being named "None"
* - Evolved pokemon can now be caught off the ground if they don't have the 'c' flag
* - New define in custom.inl SAVE_ID
* - More optimizations
* - Fixed problem with global skills not getting correct level
* - Renamed pokemon files to be more appropriate
* - New flag 'e' in pokemon.ini to disallow pokemon from being caught (removed define CATCH_SPECIAL from custom.inl)
* - Renamed MAX_CATCH_LEVEL to CATCH_MAX_LEVEL in custom.inl
* - New define CATCH_GHOST in custom.inl
* - Removed FASTSPEED and SLOWSPEED from custom.inl (they have been seperated)
* - More defines in skill_defines.inl
* - New define OAK_RESET_SKILLS in custom.inl
* - Made all skills independent of eachother (you don't need Rage for Counter to work, etc.)
* - Added pokemon images in pokedex and other motd windows
* - New define POKEDEX_IMAGES in custom.inl
* - Added partial MultiLingual Support
* - Fixed problem with pokerank being erased
* - Added checks to prevent crashing from over precaching
* - Changed MultiForwards
* - Removed unnecessary SQLX support
* - Fixed screenshake message
* -
* v1.2.3 RC - 05/27/08
* - Dropped skill forwards
* - Converted skill system to prepare for 1.3.0
* - Seperated skills into more files
* - Added maxarmor capabilities
* - Updated pokemod.inc
* - Converted some file natives to new file natives
* - Adjusted pokemon skills to damage based on skill type instead of pokemon type
* - Added functionality to change how skills are activated
* - Fixed potential bug when exiting Bill's PC
* - Every skill should be able to be global with new system
* - Added some more important debug messages
* - Changed the items.cfg file a little bit
* - Fixed small bug in pokemart that would show all categories
* - Renamed Bill's PC to Emp`s PC
* - Fixed bug where safari file would stay open
* - Can now change starting pokemon
* - Dropped support for other plugins with speed (got too complicated)
* - Added functions for skill damage for more universal use
* - Changed how delays after pokeskills work
* - Minor code improvements
* - Fixed being able to manually activate non-bind skills
* - Converted sprite system to match sounds and models
* - Added random player round saving
* - Fixed not being able to do command 'pokemod debug off'
* - Renamed config.inl to files.inl
* - Made find_free_spawn function more efficient
* - When doing 'pokemod' in console and the server is missing files, it will now list the files
* - Fixed define POKEBALL_SPECIAL
* - Redid pokedex
* - Made help menu smarter
* - Made pokedex smarter
* - Redid pokeitem help
* - Fixed problem where last pokemon's name would not be picked up
* - Changed NightShade to not go below MIN_INVIS
* - Finished all default pokemon
* - Fixed problem with round start being called at the wrong time with freezetime
* - Fixed problem when admins erased all experience
* - Burn will now catch all players on fire (not just teammates)
* - Added smarter item searching
* - Fixed problem with paralysis
* - Can no longer release or give away your active pokemon
* - Fixed bug where you would try to catch pokemon with items that can't catch
* - Fixed problem with many fake natives
* - Fixed problem with picking up the first registered item
* - Added flexibility to interact with EAM
* - Fixed Start Menu not working if you were assigned a pokemon
* - Redid menu code
* v1.2.2 - 02/01/08
* - Dropped hamsandwich module and added back fun module
* - Fixed and cleaned AoEdamage and Linedamage
* - Fixed speed issue that was occuring
* v1.2.1 - 01/26/08
* - Fixed fire status
* - Fixed harden skill
* - Fixed menus not working occasionally
* - Fixed mist and sky attack not displaying in correct position
* - Redid type system to prepare for 1.3.0
* - Added status effects for normal pokedamage function
* - Redid how status effects are calculated in pokedamage
* - Added type None
* - Added prefix TYPE_ to the type defines/enum
* - Redid admin commands
* - Fixed weird damages with AoE and Line damage
* - Dropped engine module, now uses fakemeta_util
* - Dropped fun module, now uses fakemeta and hamsandwich
* - Removed time include
* - Now requires Hamsandwich module
* - Fixed rock slide skill
* - Bots now release pokemon randomly
* - Fixed global skills being able to be done twice
* - Fixed dodrio
*
* v1.2.0 - 12/24/07
* - Seperated into smaller files
* - Added xp and lvls
* - Added more pokemon
* - And a lot more (for full list, check PokeMod forums)
* - Now requires AMXX 1.8 or greater
*
* v1.1.1 - 07/06/06
* - Fixed some things
* - Added some cvars
* - Cleaned code
* - Made a little bit ready for when lvls and xp are added
*
* v1.1.0 - 06/29/06
* - Redid menus
* - Added more pokemon (33 in total)
* - Cleaned code
* - Changed cvars to pcvars
* - Now requires AMXX 1.71 or greater
*
* v1.0.1 - Never Released
* - Fixed some stuff
* - Cleaned code
* - Added more cvars
*
* v1.0.0 - 01/15/06
* - Released to the public
*
//--Credits--//
* - RockThrow - modified sprites and sounds code from yang's Veronika hero
* - Teleport - used PassAimTest code from sharky / JTP10181 's Batgirl hero
* - Flamethrower - modified Cheap_Suit's flamethrower
* - KoST - for the get_distance_to_line stock
* - VEN - for his fm_is_ent_visible stock
* - PsyBeam - based on vittu's SSJ Gohan hero
* - SmokeScreen - made by Om3gA
*
* - Config files - based on superheromod's
* - XP Save key - based on superheromod's
* - Sounds - used some sounds from FFX mod
* - Models - used Prof. Oak model from old abandoned Pokemon Mod for Half-Life
* - original pokeball made by Emp`, fixed by Om3gA
* - bone model made by coca-cola
* - PokeLoop - used loop code from {HOJ} Batman/JTP10181 's Captain America hero
* - NPCs - used Twilight Suzuka's NPC guide
* - MYSQL Saving - Superhero Mod
* - SQLx Saving - Teame06
* - Dynamic Natives - help from Hawk552
* - Other - modified mole code from WC3FT mod
* - is_user_outside stock from timer16 by Twilight Suzuka
*
* - Anything not listed here was most likely done by Emp`
*
//--To Do--//
* - Personal colored huds
* - PP points
* - Read files rather than having defines
* - Personal Pokemon Names
* - Pokemon skill selection
* - Dynamic skill properties
* - Dynamic statuses
* - More fake natives
*/
///////////////////////////////////////////////////
// DO NOT CHANGE ANYTHING IN HERE! //
// Things for customizing your server //
// have been moved to the //
// _custom.inl and _skill_defines.inl //
///////////////////////////////////////////////////
#if defined _pokemod_plugin_included
#endinput
#endif
#define _pokemod_plugin_included
//Lets increase the memory
#pragma dynamic 32768
//Change the stupid escape character to the normal one
#pragma ctrlchar '\'
//Lets load some libraries
#include <amxmisc>
#include <fakemeta_util>
#include <fun>
#include <xs>
#if AMXX_VERSION_NUM < 180
#assert _____\
PokeMod requires AMXX 1.8 or higher and must be compiled locally!\
_____
#endif
//PokeMod includes
#tryinclude "pokemon/custom.inl" //gotta include these first because its used in the other files
#tryinclude "pokemon/defines.inl"
#if !defined _pokemod_custom_included || !defined _pokemod_defines_included
#assert _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \
_ _ _ _ _ _ _ _ _ _ _ PokeMod must be compiled locally! _ _ _ _ _ _ _ _ _ _ _ \
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
#endif
#if MOD==CS
#include <cstrike>
#endif
#if MOD==DOD
#include <dodfun>
#include <dodx>
#endif
#if MOD==NS
#include <ns>
#endif
#if SAVE==SAVE_MYSQL
#include <dbi>
#endif
#if SAVE==SAVE_NVAULT
#include <nvault>
#endif
#include "pokemon/skill_defines.inl"
#include "pokemon/globals.inl"
#include "pokemon/other.inl"
#include "pokemon/admin.inl"
#include "pokemon/bot.inl"
#include "pokemon/items.inl"
#include "pokemon/checks.inl"
#include "pokemon/eam.inl"
#include "pokemon/evolution.inl"
#include "pokemon/files.inl"
#include "pokemon/helps.inl"
#include "pokemon/menus.inl"
#include "pokemon/mod_specific.inl"
#include "pokemon/natives.inl"
#include "pokemon/oak.inl"
#include "pokemon/pokedamage.inl"
#include "pokemon/pokerank.inl"
#include "pokemon/publics.inl"
#include "pokemon/registers.inl"
#include "pokemon/skills.inl"
#include "pokemon/status.inl"
#include "pokemon/stocks.inl"
#include "pokemon/xp.inl"
/////////////////////
// Starts plugin //
/////////////////////
public plugin_init()
{
plugin_id = register_plugin(PLUGNAME, VERSION, AUTHOR);
//lets register the most important things first (incase pokemod was disabled)
set_pcvar_string( register_cvar("PokeMod_Version",VERSION,FCVAR_SERVER|FCVAR_SPONLY), VERSION );
register_concmd("pokemod","Console_Pokemod",ADMIN_ALL, "- information about PokeMod");
register_concmd("pm","Console_Pokemod");
//Client Say Commands
register_clcmd("say","HandleSay");
//if pokemod was disabled, we don't need to waste server resources
if( PM_disabled == PM_OFF )
return;
cvar_registry();
//Events
#if MOD==CS
register_event("Damage", "player_damage", "b", "2!0");
register_event("HLTV", "round_start", "a", "1=0", "2=0");
register_logevent("poke_round_end", 2, "1=Round_End");
register_logevent("poke_round_end", 2, "1&Restart_Round_");
register_event("StatusText", "pokemon_statustext", "b");
register_event("ResetHUD", "pokemon_spawn", "b");
register_event("Money", "pokemon_money", "b");
register_message(get_user_msgid("Health"), "message_Health");
#else
#if MOD==DOD
register_event("RoundState", "poke_round_end", "a", "1=3", "1=4");
#endif
#if MOD==NS
register_event("Damage", "player_damage", "b", "2!0");
#endif
register_event("ResetHUD", "team_ready", "b");
#endif
register_event("DeathMsg", "pokemon_death", "a");
register_event("CurWeapon", "WeaponChange", "be", "1=1");
register_forward(FM_Touch, "touches");
register_forward(FM_AddToFullPack, "forward_AddToFullPack", 1);
#if CHANGE_GAME_NAME==1
register_forward(FM_GetGameDescription,"GameDesc");
#endif
register_forward(FM_AlertMessage, "log_block");
//Loop every second
set_task(1.0, "pokemon_loop", 0, "", 0, "b");
debugMessage( 0,7,"Init", "Done registering events" );
//Client Console Commands
register_clcmd("+pokeskill","pokeskill_down", _, "- uses pokemon bind skill");
register_clcmd("-pokeskill","pokeskill_up");
new command[32];
for(new i=1; i <= MAX_SKILLS; i++){
formatex(command, 31, "+pokeskill%d", i);
register_clcmd(command,"pokeskill_down");
formatex(command, 31, "-pokeskill%d", i);
register_clcmd(command,"pokeskill_up");
}
register_clcmd("+pokeitem","pokeitem_down", _, "- brings up Item Menu");
register_clcmd("-pokeitem","pokeitem_up");
register_clcmd("pokeskill","updatecommands"); //this just tells them to rebind with a +
register_clcmd("pokemart","Console_Pokemart");
register_clcmd("fullupdate","fullupdate"); //this just blocks the fullupdate abuse
//All Console Commands
register_concmd("playerspokemon","Console_PlayersPokemon", _, "- shows everyones pokemon"); //views players pokemon
register_concmd("playerspokes","Console_PlayersPokemon"); //views players pokemon
register_concmd("playersitems","Console_PlayersItems", _, "- shows everyones items"); //views players items
register_concmd("pokedex","Console_Pokedex", _, "- shows pokemon information"); //views pokedex
register_concmd("pokeitem","Console_Pokeitem", _, "- shows pokeitem information"); //views pokeitem help
#if POKERANK_SYSTEM==1
//PokeRank Commands
register_concmd("pokerank","Console_PlayersRanks", _, "- shows players PokeRanks"); //views players ranks
#endif
pokeadmin_init();
debugMessage( 0,7,"Init", "Done registering commands" );
//Global Messages
gmsgScreenFade = get_user_msgid("ScreenFade");
gmsgScreenShake = get_user_msgid("ScreenShake");
gmsgDeathMsg = get_user_msgid("DeathMsg");
gmsgScoreInfo = get_user_msgid("ScoreInfo");
gmsgDamage = get_user_msgid("Damage");
//MultiForwards - thanks to vittu && teame06
PokePayForward = CreateMultiForward("poke_pay", ET_STOP, FP_CELL, FP_CELL); //stop on return value, id, amount
PlayerEventForward = CreateMultiForward("poke_player_event", ET_STOP, FP_CELL, FP_CELL); //stop on return value, id, props
ItemEventForward = CreateMultiForward("poke_item_event", ET_STOP, FP_CELL, FP_CELL, FP_CELL); //stop on return value, id, props, item
RegisterItemForward = CreateMultiForward("poke_register_item", ET_STOP); //stop on return value
debugMessage( 0,7,"Init", "Done making forwards" );
HUDSYNC = CreateHudSyncObj();
g_coloredMenus = colored_menus();
set_task(1.0, "StartPokeMod", 1);
set_task(SAVE_SPAM,"plugin_end",_,_,_,"d")
}
#if CHANGE_GAME_NAME==1
public GameDesc()
{
forward_return(FMV_STRING,GAME_NAME);
return FMRES_SUPERCEDE;
}
#endif
public StartPokeMod(initial)
{
debugMessage( 0,7,EMPTY, LANG, 0, "POKEMOD_START", initial );
// debugMessage( 0,7,"Starting PokeMod. Initial Start = %s", initial?"true":"false" );
if(initial){
#if ALLOW_WILD==1
set_task(180.0, "WildMessage", 0, "", 0, "b");
#endif
#if SAVE==SAVE_MYSQL || SAVE==SAVE_NVAULT
saving_init();
#endif
set_task(1.0, "poke_round_end");
set_task(2.0, "round_start");
}
LoadConfig();
set_task(1.0, "ReadXPs");
set_task(2.0, "SetSafariLevels");
set_task(2.5, "ReadSkills");
set_task(3.0, "ReadItems", 0);
set_task(3.5, "ReadPokemon", 0);
set_task(4.0, "ReadItems", 1);
set_task(4.5, "ReadPokemon", 1);
set_task(5.0, "PokeModLoaded");
}
public PokeModLoaded()
{
PM_Loaded = true;
load_all();
debugMessage( 0,7,EMPTY,LANG, 0, "POKEMOD_LOADED" );
// debugMessage( 0,7,"PokeMod has been Loaded." );
}
///////////////////////
//--Precached Items--//
///////////////////////
public plugin_precache()
{
//load the multilingual file for pokemod
register_dictionary("pokemod.txt");
//register the debug cvars for debug messages
register_pokecvar( pm_debug, cvar_default[pm_debug] );
register_pokecvar( pm_debug_key, cvar_default[pm_debug_key] );
spawnhookid = register_forward( FM_Spawn, "spawn_hook", 1);
SetupConfig();
new PokeFile[128];
Poke_FileName( F_PokeMaps, PokeFile);
if( file_exists(PokeFile) ){
new Data[124], len;
new mapname[32];
new line = 0;
new bool:finding_map = true;
get_mapname(mapname, 31);
while( (line = read_file(PokeFile , line , Data , 123 , len) ) != 0 ){
if( !ValidData( Data ) )
continue;
//Check the map
if( equal(Data, LEFT_BRACKET, 1) ){
replace(Data, 123, LEFT_BRACKET, EMPTY);
replace(Data, 123, RIGHT_BRACKET, EMPTY);
if( containi(Data,STAR)!=-1 ){
replace_all(Data, 123, STAR, EMPTY)
if(containi(mapname, Data)!=-1){ //deal with this map
finding_map = false;
continue;
}
}
else if(equali(mapname, Data)){
finding_map = false;
continue;
}
else
finding_map = true;
}
else if(!finding_map){ //do the commands
if(equali(Data,"-disabled")){
poke_error(LANG, 0, "POKEMOD_DISABLED");
PM_disabled = PM_OFF;
break;
}
else if(equali(Data,"-skills_off")){
poke_error(LANG, 0, "POKEMOD_SKILLSDISABLED");
PM_disabled = PM_XP;
break;
}
else{
//delay the command until after the mod has been loaded
set_task(10.0, "delay_cmd",0,Data,strlen(Data));
}
}
}
debugMessage( 0,7,"Config", "Map File Loaded." );
}
else{
ResetMapsConfig();
debugMessage( 0,7,"Config", "Map File Reset." );
}
}
public delay_cmd(Data[])
{
server_cmd(Data);
server_exec();
}
public spawn_hook()
{
poke_precaches();
unregister_forward( FM_Spawn, spawnhookid, 1 );
}
poke_precaches()
{
new i, PokeFile[128];
if( PM_disabled == PM_ON ){
debugMessage( 0,7,"Precache", "Starting." );
//check if theres enough resources for pokemod, well just check the first file (the intro sound)
formatex(PokeFile, 127, "%s%s", sound_directory, SOUNDS[0]);
if( file_exists(PokeFile) || contain(SOUNDS[0],"pokemon")==-1 ){
FoundSound[0] = true;
// get resources used so far
i = engfunc(EngFunc_PrecacheSound, SOUNDS[0]);
debugMessage( _,7,"Precache", "First sound precached at %d", i );
// add in the amount we will use in pokemod
i += MAX_SND;
debugMessage( _,7,"Precache", "Expecting to precache sounds to %d", i );
if( i > 512 ){
poke_error(LANG, 0, "POKEMOD_RESOURCES");
PM_disabled = PM_OFF;
return;
}
}
//check for one model
if( file_exists(MODELS_T[0]) || contain(MODELS_T[0],"pokemon")==-1 ){
FoundModelT[0] = true;
// get resources used so far
i = engfunc(EngFunc_PrecacheModel, MODELS_T[0]);
debugMessage( _,7,"Precache", "First model precached at %d", i );
// add in the amount we will use in pokemod
i += MAX_SPR + MAX_MDL + MAX_T_MDL;
debugMessage( _,7,"Precache", "Expecting to precache models to %d", i );
if( i > 512 ){
poke_error(LANG, 0, "POKEMOD_RESOURCES");
PM_disabled = PM_OFF;
return;
}
}
for(i=1; i<MAX_SND; i++)
poke_precache_sound( i );
for(i=1; i<MAX_T_MDL; i++)
poke_precache_model_t( i );
for(i=0; i<MAX_SPR; i++)
poke_precache_sprite( i );
for(i=0; i<MAX_MDL; i++)
poke_precache_model( i );
new missing = poke_missing_files();
if( missing ){
if( missing == 1 )
poke_error(LANG, 0, "POKEMOD_MISSINGFILE");
else
poke_error(LANG, 0, "POKEMOD_MISSINGFILES");
PM_disabled = PM_OFF;
}
debugMessage( 0,7,"Precache", "Done." );
}
}
poke_precache_model(const i)
{
if(file_exists(MODELS[i]) || contain(MODELS[i],"pokemon")==-1){
debugMessage( _,8,"Precache", "%d %s", engfunc(EngFunc_PrecacheModel, MODELS[i]) ,MODELS[i] );
return (FoundModel[i] = true);
}
return false;
}
poke_precache_model_t(const i)
{
if(file_exists(MODELS_T[i]) || contain(MODELS_T[i],"pokemon")==-1){
debugMessage( _,8,"Precache", "%d %s", engfunc(EngFunc_PrecacheModel, MODELS_T[i]) ,MODELS_T[i] );
return (FoundModelT[i] = true);
}
return false;
}
poke_precache_sprite(const i)
{
if(file_exists(SPRITES[i]) || contain(SPRITES[i],"pokemon")==-1){
debugMessage( _,8,"Precache", "%d %s", (SPRITE_INDEX[i] = engfunc(EngFunc_PrecacheModel, SPRITES[i])) ,SPRITES[i] );
return (FoundSprite[i] = true);
}
return false;
}
poke_precache_sound(const i)
{
new sound_location[151];
formatex(sound_location, 150, "%s%s", sound_directory, SOUNDS[i]);
if(file_exists(sound_location) || contain(SOUNDS[i],"pokemon")==-1){
debugMessage( _,8,"Precache", "%d %s", engfunc(EngFunc_PrecacheSound, SOUNDS[i]) ,SOUNDS[i] );
return (FoundSound[i] = true);
}
return false;
}
poke_missing_files()
{
new i, files_missing = 0, tempfile[52];
for(i=0; i<MAX_SND; i++){
if( !FoundSound[i] ){
formatex(tempfile, 51, "%s%s", sound_directory, SOUNDS[i]);
poke_error( LANG,0,"POKEMOD_FILENOTFOUND", tempfile );
files_missing++;
}
}
for(i=0; i<MAX_SPR; i++){
if( !FoundSprite[i] ){
poke_error( LANG,0,"POKEMOD_FILENOTFOUND", SPRITES[i] );
files_missing++;
}
}
for(i=0; i<MAX_MDL; i++){
if( !FoundModel[i] ){
poke_error( LANG,0,"POKEMOD_FILENOTFOUND", MODELS[i] );
files_missing++;
}
}
for(i=0; i<MAX_T_MDL; i++){
if( !FoundModelT[i] ){
poke_error( LANG,0,"POKEMOD_FILENOTFOUND", MODELS_T[i] );
files_missing++;
}
}
return files_missing;
}
poke_error(const error[], any:...)
{
new output[256];
vformat(output, 255, error, 2);
log_amx(output);
}
public plugin_end()
{
if( PM_disabled == PM_OFF )
return;
// SAVE EVERYTHING...
debugMessage( 0,3,"End", LANG, 0,"POKEMOD_FINALSAVES" );
save_all();
#if SAVE==SAVE_MYSQL
//Final cleanup in the saving include
saving_end();
#endif
cleanXP();
}
cvar_registry()
{
//CVARS used, but lets create them just incase
mp_freezetime = register_cvar("mp_freezetime","0");
//These Cvars should be in the game already
sv_lan = get_cvar_pointer("sv_lan");
mp_friendlyfire = get_cvar_pointer("mp_friendlyfire");
mp_logdetail = get_cvar_pointer("mp_logdetail");
//PokeMod Cvars
for(new i=0; i<MAX_CVARS; i++)
register_pokecvar(i,cvar_default[i]);
debugMessage( 0,7,"Init", "Done registering cvars." );
}
debugMessage(id=0, level=0, const key[], const msg[], any:... )
{
if( PM_disabled == PM_OFF )
return;
static debugMode;
debugMode = get_ppcvar_num( pm_debug );
if( debugMode < level && level )
return; //there is a level, but we arent looking that high
if( id && debugger && id != debugger )
return; //its about someone, but its not the debugger
static debug_key[51];
get_ppcvar_string( pm_debug_key, debug_key, 50 );
if( key[0] != '\0' && debug_key[0] != '\0' && containi(key,debug_key) == -1 )
return; //it didn't have the debug key in it
static output[256];
vformat( output, 255, msg, 5 );
if( id > 0 && id <= MAX_PLAYERS ){
static lastid;
static name[32],authid[32], userid;
if( lastid != id ){
lastid = id;
get_user_name( id, name, 31 );
get_user_authid( id, authid, 31 );
userid = get_user_userid( id );
}
if( userid > 0 )
format( output, 255, "\"%s<%d><%s><%s>\" %s", name,userid,authid,PokeToName(Pokemon[id]), output );
}
if( output[0] == '\0' )
return;
if( debugMode )
format( output, 255, "DEBUG %s: %s", key, output );
switch(debugMode)
{
case 0: log_amx( output ); //no matter what, were going to log it
case 1: log_amx( output ); //log it completely
case 2..9: console_print( 0, output ); //higher the number, more it outputs
case 10: log_amx( output ); //log everything (this is extremely crazy!)
}
if( debugger )
console_print( debugger, output ); //put it in console of debugger
}
Edited by mkardas98, 26.05.2012 08:36.
// ___ _ _ //
// / _ \___ | | _____ /\/\ ___ __| | //
// / /_)/ _ \| |/ / _ \/ \ / _ \ / _` | //
// / ___/ (_) | < __/ /\/\ \ (_) | (_| | //
// /_/ \___/|_|\_\___\/ \/\___/ \__,_| //
// //
////////////////////////////////////////////////
// //
// Welcome to The World of Pokemon. //
// //
////////////////////////////////////////////////
/*
//--ChangeLog--//
* v1.2.3 RC 2 - 0?/??/08
* - Fixed some problems with skills
* - Fixed some default skill/pokemon properties
* - New define TOUCH_SKILL_TEAM in custom.inl
* - Fixed "okemon" in PokeMart menu
* - Catch items with over 1000 chance will now catch pokemon with 'e' flag and pokemon above MAX_CATCH_LEVEL
* - Fixed problem with admin commands effecting @TEAMS
* - Fixed problem with first pokeitem being named "None"
* - Evolved pokemon can now be caught off the ground if they don't have the 'c' flag
* - New define in custom.inl SAVE_ID
* - More optimizations
* - Fixed problem with global skills not getting correct level
* - Renamed pokemon files to be more appropriate
* - New flag 'e' in pokemon.ini to disallow pokemon from being caught (removed define CATCH_SPECIAL from custom.inl)
* - Renamed MAX_CATCH_LEVEL to CATCH_MAX_LEVEL in custom.inl
* - New define CATCH_GHOST in custom.inl
* - Removed FASTSPEED and SLOWSPEED from custom.inl (they have been seperated)
* - More defines in skill_defines.inl
* - New define OAK_RESET_SKILLS in custom.inl
* - Made all skills independent of eachother (you don't need Rage for Counter to work, etc.)
* - Added pokemon images in pokedex and other motd windows
* - New define POKEDEX_IMAGES in custom.inl
* - Added partial MultiLingual Support
* - Fixed problem with pokerank being erased
* - Added checks to prevent crashing from over precaching
* - Changed MultiForwards
* - Removed unnecessary SQLX support
* - Fixed screenshake message
* -
* v1.2.3 RC - 05/27/08
* - Dropped skill forwards
* - Converted skill system to prepare for 1.3.0
* - Seperated skills into more files
* - Added maxarmor capabilities
* - Updated pokemod.inc
* - Converted some file natives to new file natives
* - Adjusted pokemon skills to damage based on skill type instead of pokemon type
* - Added functionality to change how skills are activated
* - Fixed potential bug when exiting Bill's PC
* - Every skill should be able to be global with new system
* - Added some more important debug messages
* - Changed the items.cfg file a little bit
* - Fixed small bug in pokemart that would show all categories
* - Renamed Bill's PC to Emp`s PC
* - Fixed bug where safari file would stay open
* - Can now change starting pokemon
* - Dropped support for other plugins with speed (got too complicated)
* - Added functions for skill damage for more universal use
* - Changed how delays after pokeskills work
* - Minor code improvements
* - Fixed being able to manually activate non-bind skills
* - Converted sprite system to match sounds and models
* - Added random player round saving
* - Fixed not being able to do command 'pokemod debug off'
* - Renamed config.inl to files.inl
* - Made find_free_spawn function more efficient
* - When doing 'pokemod' in console and the server is missing files, it will now list the files
* - Fixed define POKEBALL_SPECIAL
* - Redid pokedex
* - Made help menu smarter
* - Made pokedex smarter
* - Redid pokeitem help
* - Fixed problem where last pokemon's name would not be picked up
* - Changed NightShade to not go below MIN_INVIS
* - Finished all default pokemon
* - Fixed problem with round start being called at the wrong time with freezetime
* - Fixed problem when admins erased all experience
* - Burn will now catch all players on fire (not just teammates)
* - Added smarter item searching
* - Fixed problem with paralysis
* - Can no longer release or give away your active pokemon
* - Fixed bug where you would try to catch pokemon with items that can't catch
* - Fixed problem with many fake natives
* - Fixed problem with picking up the first registered item
* - Added flexibility to interact with EAM
* - Fixed Start Menu not working if you were assigned a pokemon
* - Redid menu code
* v1.2.2 - 02/01/08
* - Dropped hamsandwich module and added back fun module
* - Fixed and cleaned AoEdamage and Linedamage
* - Fixed speed issue that was occuring
* v1.2.1 - 01/26/08
* - Fixed fire status
* - Fixed harden skill
* - Fixed menus not working occasionally
* - Fixed mist and sky attack not displaying in correct position
* - Redid type system to prepare for 1.3.0
* - Added status effects for normal pokedamage function
* - Redid how status effects are calculated in pokedamage
* - Added type None
* - Added prefix TYPE_ to the type defines/enum
* - Redid admin commands
* - Fixed weird damages with AoE and Line damage
* - Dropped engine module, now uses fakemeta_util
* - Dropped fun module, now uses fakemeta and hamsandwich
* - Removed time include
* - Now requires Hamsandwich module
* - Fixed rock slide skill
* - Bots now release pokemon randomly
* - Fixed global skills being able to be done twice
* - Fixed dodrio
*
* v1.2.0 - 12/24/07
* - Seperated into smaller files
* - Added xp and lvls
* - Added more pokemon
* - And a lot more (for full list, check PokeMod forums)
* - Now requires AMXX 1.8 or greater
*
* v1.1.1 - 07/06/06
* - Fixed some things
* - Added some cvars
* - Cleaned code
* - Made a little bit ready for when lvls and xp are added
*
* v1.1.0 - 06/29/06
* - Redid menus
* - Added more pokemon (33 in total)
* - Cleaned code
* - Changed cvars to pcvars
* - Now requires AMXX 1.71 or greater
*
* v1.0.1 - Never Released
* - Fixed some stuff
* - Cleaned code
* - Added more cvars
*
* v1.0.0 - 01/15/06
* - Released to the public
*
//--Credits--//
* - RockThrow - modified sprites and sounds code from yang's Veronika hero
* - Teleport - used PassAimTest code from sharky / JTP10181 's Batgirl hero
* - Flamethrower - modified Cheap_Suit's flamethrower
* - KoST - for the get_distance_to_line stock
* - VEN - for his fm_is_ent_visible stock
* - PsyBeam - based on vittu's SSJ Gohan hero
* - SmokeScreen - made by Om3gA
*
* - Config files - based on superheromod's
* - XP Save key - based on superheromod's
* - Sounds - used some sounds from FFX mod
* - Models - used Prof. Oak model from old abandoned Pokemon Mod for Half-Life
* - original pokeball made by Emp`, fixed by Om3gA
* - bone model made by coca-cola
* - PokeLoop - used loop code from {HOJ} Batman/JTP10181 's Captain America hero
* - NPCs - used Twilight Suzuka's NPC guide
* - MYSQL Saving - Superhero Mod
* - SQLx Saving - Teame06
* - Dynamic Natives - help from Hawk552
* - Other - modified mole code from WC3FT mod
* - is_user_outside stock from timer16 by Twilight Suzuka
*
* - Anything not listed here was most likely done by Emp`
*
//--To Do--//
* - Personal colored huds
* - PP points
* - Read files rather than having defines
* - Personal Pokemon Names
* - Pokemon skill selection
* - Dynamic skill properties
* - Dynamic statuses
* - More fake natives
*/
///////////////////////////////////////////////////
// DO NOT CHANGE ANYTHING IN HERE! //
// Things for customizing your server //
// have been moved to the //
// _custom.inl and _skill_defines.inl //
///////////////////////////////////////////////////
#if defined _pokemod_plugin_included
#endinput
#endif
#define _pokemod_plugin_included
//Lets increase the memory
#pragma dynamic 32768
//Change the stupid escape character to the normal one
#pragma ctrlchar '\'
//Lets load some libraries
#include <amxmisc>
#include <fakemeta_util>
#include <fun>
#include <xs>
#if AMXX_VERSION_NUM < 180
#assert _____\
PokeMod requires AMXX 1.8 or higher and must be compiled locally!\
_____
#endif
//PokeMod includes
#tryinclude "pokemon/custom.inl" //gotta include these first because its used in the other files
#tryinclude "pokemon/defines.inl"
#if !defined _pokemod_custom_included || !defined _pokemod_defines_included
#assert _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \
_ _ _ _ _ _ _ _ _ _ _ PokeMod must be compiled locally! _ _ _ _ _ _ _ _ _ _ _ \
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
#endif
#if MOD==CS
#include <cstrike>
#endif
#if MOD==DOD
#include <dodfun>
#include <dodx>
#endif
#if MOD==NS
#include <ns>
#endif
#if SAVE==SAVE_MYSQL
#include <dbi>
#endif
#if SAVE==SAVE_NVAULT
#include <nvault>
#endif
#include "pokemon/skill_defines.inl"
#include "pokemon/globals.inl"
#include "pokemon/other.inl"
#include "pokemon/admin.inl"
#include "pokemon/bot.inl"
#include "pokemon/items.inl"
#include "pokemon/checks.inl"
#include "pokemon/eam.inl"
#include "pokemon/evolution.inl"
#include "pokemon/files.inl"
#include "pokemon/helps.inl"
#include "pokemon/menus.inl"
#include "pokemon/mod_specific.inl"
#include "pokemon/natives.inl"
#include "pokemon/oak.inl"
#include "pokemon/pokedamage.inl"
#include "pokemon/pokerank.inl"
#include "pokemon/publics.inl"
#include "pokemon/registers.inl"
#include "pokemon/skills.inl"
#include "pokemon/status.inl"
#include "pokemon/stocks.inl"
#include "pokemon/xp.inl"
/////////////////////
// Starts plugin //
/////////////////////
public plugin_init()
{
plugin_id = register_plugin(PLUGNAME, VERSION, AUTHOR);
//lets register the most important things first (incase pokemod was disabled)
set_pcvar_string( register_cvar("PokeMod_Version",VERSION,FCVAR_SERVER|FCVAR_SPONLY), VERSION );
register_concmd("pokemod","Console_Pokemod",ADMIN_ALL, "- information about PokeMod");
register_concmd("pm","Console_Pokemod");
//Client Say Commands
register_clcmd("say","HandleSay");
//if pokemod was disabled, we don't need to waste server resources
if( PM_disabled == PM_OFF )
return;
cvar_registry();
//Events
#if MOD==CS
register_event("Damage", "player_damage", "b", "2!0");
register_event("HLTV", "round_start", "a", "1=0", "2=0");
register_logevent("poke_round_end", 2, "1=Round_End");
register_logevent("poke_round_end", 2, "1&Restart_Round_");
register_event("StatusText", "pokemon_statustext", "b");
register_event("ResetHUD", "pokemon_spawn", "b");
register_event("Money", "pokemon_money", "b");
register_message(get_user_msgid("Health"), "message_Health");
#else
#if MOD==DOD
register_event("RoundState", "poke_round_end", "a", "1=3", "1=4");
#endif
#if MOD==NS
register_event("Damage", "player_damage", "b", "2!0");
#endif
register_event("ResetHUD", "team_ready", "b");
#endif
register_event("DeathMsg", "pokemon_death", "a");
register_event("CurWeapon", "WeaponChange", "be", "1=1");
register_forward(FM_Touch, "touches");
register_forward(FM_AddToFullPack, "forward_AddToFullPack", 1);
#if CHANGE_GAME_NAME==1
register_forward(FM_GetGameDescription,"GameDesc");
#endif
register_forward(FM_AlertMessage, "log_block");
//Loop every second
set_task(1.0, "pokemon_loop", 0, "", 0, "b");
debugMessage( 0,7,"Init", "Done registering events" );
//Client Console Commands
register_clcmd("+pokeskill","pokeskill_down", _, "- uses pokemon bind skill");
register_clcmd("-pokeskill","pokeskill_up");
new command[32];
for(new i=1; i <= MAX_SKILLS; i++){
formatex(command, 31, "+pokeskill%d", i);
register_clcmd(command,"pokeskill_down");
formatex(command, 31, "-pokeskill%d", i);
register_clcmd(command,"pokeskill_up");
}
register_clcmd("+pokeitem","pokeitem_down", _, "- brings up Item Menu");
register_clcmd("-pokeitem","pokeitem_up");
register_clcmd("pokeskill","updatecommands"); //this just tells them to rebind with a +
register_clcmd("pokemart","Console_Pokemart");
register_clcmd("fullupdate","fullupdate"); //this just blocks the fullupdate abuse
//All Console Commands
register_concmd("playerspokemon","Console_PlayersPokemon", _, "- shows everyones pokemon"); //views players pokemon
register_concmd("playerspokes","Console_PlayersPokemon"); //views players pokemon
register_concmd("playersitems","Console_PlayersItems", _, "- shows everyones items"); //views players items
register_concmd("pokedex","Console_Pokedex", _, "- shows pokemon information"); //views pokedex
register_concmd("pokeitem","Console_Pokeitem", _, "- shows pokeitem information"); //views pokeitem help
#if POKERANK_SYSTEM==1
//PokeRank Commands
register_concmd("pokerank","Console_PlayersRanks", _, "- shows players PokeRanks"); //views players ranks
#endif
pokeadmin_init();
debugMessage( 0,7,"Init", "Done registering commands" );
//Global Messages
gmsgScreenFade = get_user_msgid("ScreenFade");
gmsgScreenShake = get_user_msgid("ScreenShake");
gmsgDeathMsg = get_user_msgid("DeathMsg");
gmsgScoreInfo = get_user_msgid("ScoreInfo");
gmsgDamage = get_user_msgid("Damage");
//MultiForwards - thanks to vittu && teame06
PokePayForward = CreateMultiForward("poke_pay", ET_STOP, FP_CELL, FP_CELL); //stop on return value, id, amount
PlayerEventForward = CreateMultiForward("poke_player_event", ET_STOP, FP_CELL, FP_CELL); //stop on return value, id, props
ItemEventForward = CreateMultiForward("poke_item_event", ET_STOP, FP_CELL, FP_CELL, FP_CELL); //stop on return value, id, props, item
RegisterItemForward = CreateMultiForward("poke_register_item", ET_STOP); //stop on return value
debugMessage( 0,7,"Init", "Done making forwards" );
HUDSYNC = CreateHudSyncObj();
g_coloredMenus = colored_menus();
set_task(1.0, "StartPokeMod", 1);
set_task(SAVE_SPAM,"plugin_end",_,_,_,"d")
}
#if CHANGE_GAME_NAME==1
public GameDesc()
{
forward_return(FMV_STRING,GAME_NAME);
return FMRES_SUPERCEDE;
}
#endif
public StartPokeMod(initial)
{
debugMessage( 0,7,EMPTY, LANG, 0, "POKEMOD_START", initial );
// debugMessage( 0,7,"Starting PokeMod. Initial Start = %s", initial?"true":"false" );
if(initial){
#if ALLOW_WILD==1
set_task(180.0, "WildMessage", 0, "", 0, "b");
#endif
#if SAVE==SAVE_MYSQL || SAVE==SAVE_NVAULT
saving_init();
#endif
set_task(1.0, "poke_round_end");
set_task(2.0, "round_start");
}
LoadConfig();
set_task(1.0, "ReadXPs");
set_task(2.0, "SetSafariLevels");
set_task(2.5, "ReadSkills");
set_task(3.0, "ReadItems", 0);
set_task(3.5, "ReadPokemon", 0);
set_task(4.0, "ReadItems", 1);
set_task(4.5, "ReadPokemon", 1);
set_task(5.0, "PokeModLoaded");
}
public PokeModLoaded()
{
PM_Loaded = true;
load_all();
debugMessage( 0,7,EMPTY,LANG, 0, "POKEMOD_LOADED" );
// debugMessage( 0,7,"PokeMod has been Loaded." );
}
///////////////////////
//--Precached Items--//
///////////////////////
public plugin_precache()
{
//load the multilingual file for pokemod
register_dictionary("pokemod.txt");
//register the debug cvars for debug messages
register_pokecvar( pm_debug, cvar_default[pm_debug] );
register_pokecvar( pm_debug_key, cvar_default[pm_debug_key] );
spawnhookid = register_forward( FM_Spawn, "spawn_hook", 1);
SetupConfig();
new PokeFile[128];
Poke_FileName( F_PokeMaps, PokeFile);
if( file_exists(PokeFile) ){
new Data[124], len;
new mapname[32];
new line = 0;
new bool:finding_map = true;
get_mapname(mapname, 31);
while( (line = read_file(PokeFile , line , Data , 123 , len) ) != 0 ){
if( !ValidData( Data ) )
continue;
//Check the map
if( equal(Data, LEFT_BRACKET, 1) ){
replace(Data, 123, LEFT_BRACKET, EMPTY);
replace(Data, 123, RIGHT_BRACKET, EMPTY);
if( containi(Data,STAR)!=-1 ){
replace_all(Data, 123, STAR, EMPTY)
if(containi(mapname, Data)!=-1){ //deal with this map
finding_map = false;
continue;
}
}
else if(equali(mapname, Data)){
finding_map = false;
continue;
}
else
finding_map = true;
}
else if(!finding_map){ //do the commands
if(equali(Data,"-disabled")){
poke_error(LANG, 0, "POKEMOD_DISABLED");
PM_disabled = PM_OFF;
break;
}
else if(equali(Data,"-skills_off")){
poke_error(LANG, 0, "POKEMOD_SKILLSDISABLED");
PM_disabled = PM_XP;
break;
}
else{
//delay the command until after the mod has been loaded
set_task(10.0, "delay_cmd",0,Data,strlen(Data));
}
}
}
debugMessage( 0,7,"Config", "Map File Loaded." );
}
else{
ResetMapsConfig();
debugMessage( 0,7,"Config", "Map File Reset." );
}
}
public delay_cmd(Data[])
{
server_cmd(Data);
server_exec();
}
public spawn_hook()
{
poke_precaches();
unregister_forward( FM_Spawn, spawnhookid, 1 );
}
poke_precaches()
{
new i, PokeFile[128];
if( PM_disabled == PM_ON ){
debugMessage( 0,7,"Precache", "Starting." );
//check if theres enough resources for pokemod, well just check the first file (the intro sound)
formatex(PokeFile, 127, "%s%s", sound_directory, SOUNDS[0]);
if( file_exists(PokeFile) || contain(SOUNDS[0],"pokemon")==-1 ){
FoundSound[0] = true;
// get resources used so far
i = engfunc(EngFunc_PrecacheSound, SOUNDS[0]);
debugMessage( _,7,"Precache", "First sound precached at %d", i );
// add in the amount we will use in pokemod
i += MAX_SND;
debugMessage( _,7,"Precache", "Expecting to precache sounds to %d", i );
if( i > 512 ){
poke_error(LANG, 0, "POKEMOD_RESOURCES");
PM_disabled = PM_OFF;
return;
}
}
//check for one model
if( file_exists(MODELS_T[0]) || contain(MODELS_T[0],"pokemon")==-1 ){
FoundModelT[0] = true;
// get resources used so far
i = engfunc(EngFunc_PrecacheModel, MODELS_T[0]);
debugMessage( _,7,"Precache", "First model precached at %d", i );
// add in the amount we will use in pokemod
i += MAX_SPR + MAX_MDL + MAX_T_MDL;
debugMessage( _,7,"Precache", "Expecting to precache models to %d", i );
if( i > 512 ){
poke_error(LANG, 0, "POKEMOD_RESOURCES");
PM_disabled = PM_OFF;
return;
}
}
for(i=1; i<MAX_SND; i++)
poke_precache_sound( i );
for(i=1; i<MAX_T_MDL; i++)
poke_precache_model_t( i );
for(i=0; i<MAX_SPR; i++)
poke_precache_sprite( i );
for(i=0; i<MAX_MDL; i++)
poke_precache_model( i );
new missing = poke_missing_files();
if( missing ){
if( missing == 1 )
poke_error(LANG, 0, "POKEMOD_MISSINGFILE");
else
poke_error(LANG, 0, "POKEMOD_MISSINGFILES");
PM_disabled = PM_OFF;
}
debugMessage( 0,7,"Precache", "Done." );
}
}
poke_precache_model(const i)
{
if(file_exists(MODELS[i]) || contain(MODELS[i],"pokemon")==-1){
debugMessage( _,8,"Precache", "%d %s", engfunc(EngFunc_PrecacheModel, MODELS[i]) ,MODELS[i] );
return (FoundModel[i] = true);
}
return false;
}
poke_precache_model_t(const i)
{
if(file_exists(MODELS_T[i]) || contain(MODELS_T[i],"pokemon")==-1){
debugMessage( _,8,"Precache", "%d %s", engfunc(EngFunc_PrecacheModel, MODELS_T[i]) ,MODELS_T[i] );
return (FoundModelT[i] = true);
}
return false;
}
poke_precache_sprite(const i)
{
if(file_exists(SPRITES[i]) || contain(SPRITES[i],"pokemon")==-1){
debugMessage( _,8,"Precache", "%d %s", (SPRITE_INDEX[i] = engfunc(EngFunc_PrecacheModel, SPRITES[i])) ,SPRITES[i] );
return (FoundSprite[i] = true);
}
return false;
}
poke_precache_sound(const i)
{
new sound_location[151];
formatex(sound_location, 150, "%s%s", sound_directory, SOUNDS[i]);
if(file_exists(sound_location) || contain(SOUNDS[i],"pokemon")==-1){
debugMessage( _,8,"Precache", "%d %s", engfunc(EngFunc_PrecacheSound, SOUNDS[i]) ,SOUNDS[i] );
return (FoundSound[i] = true);
}
return false;
}
poke_missing_files()
{
new i, files_missing = 0, tempfile[52];
for(i=0; i<MAX_SND; i++){
if( !FoundSound[i] ){
formatex(tempfile, 51, "%s%s", sound_directory, SOUNDS[i]);
poke_error( LANG,0,"POKEMOD_FILENOTFOUND", tempfile );
files_missing++;
}
}
for(i=0; i<MAX_SPR; i++){
if( !FoundSprite[i] ){
poke_error( LANG,0,"POKEMOD_FILENOTFOUND", SPRITES[i] );
files_missing++;
}
}
for(i=0; i<MAX_MDL; i++){
if( !FoundModel[i] ){
poke_error( LANG,0,"POKEMOD_FILENOTFOUND", MODELS[i] );
files_missing++;
}
}
for(i=0; i<MAX_T_MDL; i++){
if( !FoundModelT[i] ){
poke_error( LANG,0,"POKEMOD_FILENOTFOUND", MODELS_T[i] );
files_missing++;
}
}
return files_missing;
}
poke_error(const error[], any:...)
{
new output[256];
vformat(output, 255, error, 2);
log_amx(output);
}
public plugin_end()
{
if( PM_disabled == PM_OFF )
return;
// SAVE EVERYTHING...
debugMessage( 0,3,"End", LANG, 0,"POKEMOD_FINALSAVES" );
save_all();
#if SAVE==SAVE_MYSQL
//Final cleanup in the saving include
saving_end();
#endif
cleanXP();
}
cvar_registry()
{
//CVARS used, but lets create them just incase
mp_freezetime = register_cvar("mp_freezetime","0");
//These Cvars should be in the game already
sv_lan = get_cvar_pointer("sv_lan");
mp_friendlyfire = get_cvar_pointer("mp_friendlyfire");
mp_logdetail = get_cvar_pointer("mp_logdetail");
//PokeMod Cvars
for(new i=0; i<MAX_CVARS; i++)
register_pokecvar(i,cvar_default[i]);
debugMessage( 0,7,"Init", "Done registering cvars." );
}
debugMessage(id=0, level=0, const key[], const msg[], any:... )
{
if( PM_disabled == PM_OFF )
return;
static debugMode;
debugMode = get_ppcvar_num( pm_debug );
if( debugMode < level && level )
return; //there is a level, but we arent looking that high
if( id && debugger && id != debugger )
return; //its about someone, but its not the debugger
static debug_key[51];
get_ppcvar_string( pm_debug_key, debug_key, 50 );
if( key[0] != '\0' && debug_key[0] != '\0' && containi(key,debug_key) == -1 )
return; //it didn't have the debug key in it
static output[256];
vformat( output, 255, msg, 5 );
if( id > 0 && id <= MAX_PLAYERS ){
static lastid;
static name[32],authid[32], userid;
if( lastid != id ){
lastid = id;
get_user_name( id, name, 31 );
get_user_authid( id, authid, 31 );
userid = get_user_userid( id );
}
if( userid > 0 )
format( output, 255, "\"%s<%d><%s><%s>\" %s", name,userid,authid,PokeToName(Pokemon[id]), output );
}
if( output[0] == '\0' )
return;
if( debugMode )
format( output, 255, "DEBUG %s: %s", key, output );
switch(debugMode)
{
case 0: log_amx( output ); //no matter what, were going to log it
case 1: log_amx( output ); //log it completely
case 2..9: console_print( 0, output ); //higher the number, more it outputs
case 10: log_amx( output ); //log everything (this is extremely crazy!)
}
if( debugger )
console_print( debugger, output ); //put it in console of debugger
}
Nic nie pomogło.1.
csstats_maxsize 3500
na
csstats_maxsize 99999
Edited by mkardas98, 26.05.2012 08:36.
radim
26.05.2012
1. Do core.ini dopisz
csstats_score addons/amxmodx/data/csstats.amxx
csstats addons/amxmodx/data/csstats.dat
2. Otwierasz configs/pokemon/pokemod.cfg i szukasz :
0 - nie zapisywać
3. W xp.inl
csstats_score addons/amxmodx/data/csstats.amxx
csstats addons/amxmodx/data/csstats.dat
2. Otwierasz configs/pokemon/pokemod.cfg i szukasz :
pm_save 0 //save players xp (1=on, 0=off)1 - zapisywać
0 - nie zapisywać
3. W xp.inl
Rob Zombie `
26.05.2012
zastosuj się do porad, następnie zrestartuj ranking jeszcze raz.
http://amxx.pl/topic...tart-statystyk/
http://amxx.pl/topic...tart-statystyk/
mkardas98
26.05.2012
W 2. Pytaniu miałem ustawione 1. Ale nie zapisuje. Bardzo mi zależy aby to działało. A ranking chyba działa thx.
To pokemod.cfg
//CVARS for PokeMod, these are loaded every map change
pm_pokemod 1 //turns pokemod on and off (1=on, 0=off)
pm_admin m //what accessflag admins need to mess with PokeMod
pm_save 1 //save players xp (1=on, 0=off)
pm_xpsavedays 365 //how many days to save xp for before erasing it
pm_safari_mode 0 //turns safari mode on and off (1=on, 0=off)
pm_debug 0 //turns pokemod debug messages on and off (1=on, 0=off)
pm_debug_key //only shows debug messages with this in it
pm_wild 0 //how many people needed to be wild
pm_wild_level 30 //max level that wild pokemon will be (set to 0 to disable)
pm_maxhp 255 //max hp that someone can get with bonuses
pm_maxarmor 255 //max armor that someone can get with bonuses
pm_botsays 1 //turns on bot radio commands when they choose/buy a pokemon/item
pm_pokecenter 200 //set to 0 if you dont want the npcs to be spawned. otherwise this is the distance you can be from pokecenter to use it
pm_oak ab //prof oak properties (a = pokemart, b = heal, c = team specific)
pm_oakhp 0 //how much hp oak has (set to 0 for godmode)
pm_pokeballs 1 //spawn pokeballs with pokemon in them at spawns (1=yes, 0=no)
pm_buytime 0.0 //minutes that you can buy things from pokemart, set to 0 for infinite time
pm_itemtime 30.0 //items disappear after this time, set to 0 to remove at end of round
pm_pokemart_open 1 //allow buying from pokemart
pm_ffa 0 //make pokemod work with free for all
pm_burntime 5 //how long until players are no longer on fire
pm_burndamage 5 //how much damage per half second burn does
pm_waterheal 3 //how much hp is healed per second in water (if using a water pokemon)
pm_poisondamage 7 //how long until players are no longer poisoned
pm_poisontime 10 //how much damage per second poison does
pm_sleeptime 3 //players will fall asleep for this amount of time
echo "PokeMod - Successfully Loaded PokeMod Config File"
Mam jeszcze pytanie do 3. Jak to zmienie to wystarczy to jeszcze wrzucić na serwa?
Edited by mkardas98, 26.05.2012 15:59.
To pokemod.cfg
//CVARS for PokeMod, these are loaded every map change
pm_pokemod 1 //turns pokemod on and off (1=on, 0=off)
pm_admin m //what accessflag admins need to mess with PokeMod
pm_save 1 //save players xp (1=on, 0=off)
pm_xpsavedays 365 //how many days to save xp for before erasing it
pm_safari_mode 0 //turns safari mode on and off (1=on, 0=off)
pm_debug 0 //turns pokemod debug messages on and off (1=on, 0=off)
pm_debug_key //only shows debug messages with this in it
pm_wild 0 //how many people needed to be wild
pm_wild_level 30 //max level that wild pokemon will be (set to 0 to disable)
pm_maxhp 255 //max hp that someone can get with bonuses
pm_maxarmor 255 //max armor that someone can get with bonuses
pm_botsays 1 //turns on bot radio commands when they choose/buy a pokemon/item
pm_pokecenter 200 //set to 0 if you dont want the npcs to be spawned. otherwise this is the distance you can be from pokecenter to use it
pm_oak ab //prof oak properties (a = pokemart, b = heal, c = team specific)
pm_oakhp 0 //how much hp oak has (set to 0 for godmode)
pm_pokeballs 1 //spawn pokeballs with pokemon in them at spawns (1=yes, 0=no)
pm_buytime 0.0 //minutes that you can buy things from pokemart, set to 0 for infinite time
pm_itemtime 30.0 //items disappear after this time, set to 0 to remove at end of round
pm_pokemart_open 1 //allow buying from pokemart
pm_ffa 0 //make pokemod work with free for all
pm_burntime 5 //how long until players are no longer on fire
pm_burndamage 5 //how much damage per half second burn does
pm_waterheal 3 //how much hp is healed per second in water (if using a water pokemon)
pm_poisondamage 7 //how long until players are no longer poisoned
pm_poisontime 10 //how much damage per second poison does
pm_sleeptime 3 //players will fall asleep for this amount of time
echo "PokeMod - Successfully Loaded PokeMod Config File"
Mam jeszcze pytanie do 3. Jak to zmienie to wystarczy to jeszcze wrzucić na serwa?
Edited by mkardas98, 26.05.2012 15:59.
mkardas98
26.05.2012
Ranking jednak nie działa. Wszedł kolega graliśmy. Zresetowałem serwer i ranking zresetowany...!
radim
27.05.2012
Musisz jeszcze skompilować pokemod'a.Mam jeszcze pytanie do 3. Jak to zmienie to wystarczy to jeszcze wrzucić na serwa?
A jaki masz zapis, nvault czy mysql ?