Zarejestruj się Użytkownicy Kalendarz Zaznacz Wszystkie Fora jako Przeczytane CS FAQ Regulamin forum =w= Tani STEAM

Pojedynczy post dla tematu:

PokeMod - Błąd w kompilacji


PokeMod - Błąd w kompilacji

  stare
JaCo is Offline
Super Moderator
 
Avatar JaCo
 
Postów: 3,245

Poziom upalenia:
XXX----- Doświadczenie: pali bongi
Zarejestrowany: Jul 2007
Wiek: 16
   

Siema.

Kompiluje ten plugin

Kod php:

 
////////////////////////////////////////////////
 //     ___      _                         _   //
 //    / _ \___ | | _____  /\/\   ___   __| |  //
 //   / /_)/ _ \| |/ / _ \/    \ / _ \ / _` |  //
 //  / ___/ (_) |   <  __/ /\/\ \ (_) | (_| |  //
 // /_/    \___/|_|\_\___\/    \/\___/ \__,_|  //
 //                                               //
 ////////////////////////////////////////////////
 //                                               //
 //         Welcome to The World of Pokemon.       //
 //                                               //
 ////////////////////////////////////////////////
 
 /*
 //--ChangeLog--//
 *    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--//
 *    - Onix                    - modified sprites and sounds code from yang's Veronika hero
 *    - Abra                    - used PassAimTest code from sharky / JTP10181 's Batgirl hero
 *    - Growlithe                - modified Cheap_Suit's flamethrower
 *                            - KoST - for the get_distance_to_line stock
 *                            - VEN - for his fm_is_ent_visible stock
 *    - Kadabra                - based on vittu's SSJ Gohan hero
 *    - Magmar                - 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
 *    - PokeLoop                - used loop code from {HOJ} Batman/JTP10181 's Captain America hero
 *    - NPCs                    - used Twilight Suzuka's NPC guide thing
 *    - 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--//
 *    - More pokemon???
 *    - Personal colored huds
 *    - Custom pokemon support
 *    - PP points
 *    - Use New File Natives
 *    - Read files rather than having defines
 *    - Full MultiMod support for DoD and NS
 */





    ////////////////////////////////////////////////////
    //        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>
 
 //PokeMod includes
 #include "pokemon/custom.inl"    //gotta include these first because its used in the other files
 #include "pokemon/defines.inl"

 #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_SQLX
    #include <sqlx>
 #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/config.inl"
 #include "pokemon/evolution.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()
 {
    
register_plugin(PLUGNAMEVERSIONAUTHOR);

    
//lets register the most important things first (incase pokemod was disabled)

    //Thanks to SuperHeroMod
    
register_cvar("PokeMod_Version",VERSION,FCVAR_SERVER|FCVAR_SPONLY);
    
set_cvar_string("PokeMod_Version",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==1)
        return;

    
cvar_registry();

    
//Events
    #if MOD==CS
        
register_event("Damage""pokemon_damage""b""2!0");
        
register_logevent("round_start"2"1=Round_Start");
        
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");
    
#else
        #if MOD==DOD
            
register_event("RoundState""poke_round_end""a""1=3""1=4");
        
#endif
        #if MOD==NS
            
register_event("Damage""pokemon_damage""b""2!0");
        
#endif
        
register_event("ResetHUD""team_ready""b");
    
#endif
    
register_event("DeathMsg""pokemon_death""a");
    
register_event("AmmoX""pokemon_ammox""b");
    
register_event("CurWeapon""WeaponChange""be""1=1");
    
register_forward(FM_Touch"touches");

    
#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");

    
debugMessage0,7,"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<= MAX_SKILLSi++){
        
formatex(command31"+pokeskill%d"i);
        
register_clcmd(command,"pokeskill_down");
        
formatex(command31"-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("pokeitem","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 pokedex

    #if POKERANK_SYSTEM==1
    //PokeRank Commands
    
register_concmd("pokerank","Console_PlayersRanks"_"- shows players PokeRanks");    //views players ranks
    #endif

    //Admin Console Commands
    
register_pokeadmincmd("givepoke","admin_givepoke",ADMIN_ALL,"<nick | @TEAM | @ALL> <pokemon name> <level> - gives players a pokemon");
    
register_pokeadmincmd("setpoke","admin_setpoke",ADMIN_ALL,"<nick | @TEAM | @ALL> <pokemon name> - temporarily gives players pokemon power");
    
register_pokeadmincmd("takepoke","admin_takepoke",ADMIN_ALL,"<nick | @TEAM | @ALL> <pokemon | @ALL | @# | @C> - takes a pokemon away from players");
    
register_pokeadmincmd("morph","admin_morph",ADMIN_ALL,"<nick | @TEAM | @ALL> <pokemon | @ALL | @# | @C> <new pokemon> - morphes a pokemon into a new one");

    
register_pokeadmincmd("givexp","admin_givexp",ADMIN_ALL,"<nick | @TEAM | @ALL> <pokemon | @ALL | @# | @C> <amount> - gives xp to players pokemon");
    
register_pokeadmincmd("setxp","admin_setxp",ADMIN_ALL,"<nick | @TEAM | @ALL> <pokemon | @ALL | @# | @C> <amount> - sets xp on players pokemon");

    
#if POKERANK_SYSTEM==1
    
register_pokeadmincmd("addrank","admin_rank",ADMIN_ALL,"<nick | @TEAM | @ALL> <amount> - gives rank points to player");
    
register_pokeadmincmd("setrank","admin_rank",ADMIN_ALL,"<nick | @TEAM | @ALL> <amount> - sets rank points on player");
    
#endif

    
register_pokeadmincmd("setlevel","admin_setlvl",ADMIN_ALL);
    
register_pokeadmincmd("setlvl","admin_setlvl",ADMIN_ALL,"<nick | @TEAM | @ALL> <pokemon | @ALL | @# | @C> <level> - sets level on players pokemon");

    
register_pokeadmincmd("giveitem","admin_giveitem",ADMIN_ALL,"<nick | @TEAM | @ALL> <item name> <amount> - gives players an item");

    
register_pokeadmincmd("debugger","admin_debugger",ADMIN_ALL,"<nick | 0> - changes who recieves the debug messages");

    
#if PM_ADMIN_COMMANDS==1
    
register_pokeadmincmd("help","admin_help",ADMIN_ALL," - shows admin command help");
    
#endif
    #if PM_ADMIN_COMMANDS==1 && PM_CVAR_PREFIX==1
    
register_pokeadmincmd("cvar","admin_cvar",ADMIN_ALL," - saves changes to pokemod cvars");
    
#endif

    
register_pokeadmincmd("enable","admin_enable",ADMIN_ALL,"<pokemon | @ALL> - enables the use of a pokemon");
    
register_pokeadmincmd("tempenable","admin_enable",ADMIN_ALL,"<pokemon | @ALL> - temporarily enables the use of a pokemon");
    
register_pokeadmincmd("disable","admin_disable",ADMIN_ALL,"<pokemon | @ALL> - disables the use of a pokemon");
    
register_pokeadmincmd("tempdisable","admin_disable",ADMIN_ALL,"<pokemon | @ALL> - temporarily disables the use of a pokemon");

    
register_pokeadmincmd("pokemart","admin_pokemart",ADMIN_ALL,"<pokemon name | item name> <price> - changes items in Pokemart");
    
register_pokeadmincmd("safari","admin_safari",ADMIN_ALL,"<pokemon name> <level> - changes pokemon in Safari");
    
register_pokeadmincmd("reset","admin_reset",ADMIN_RCON," - resets pokemod files");
    
register_pokeadmincmd("loadconfig","admin_loadconfig",ADMIN_BAN," - loads pokemod config files");
    
register_pokeadmincmd("erasexp","admin_erasexp",ADMIN_RCON," - erases all xp");

    
debugMessage0,7,"done registering commands" );

    
//Global Messages
    #if MOD==CS
    
gmsgMoney        get_user_msgid("Money");
    
#endif
    
gmsgScreenFade    get_user_msgid("ScreenFade");
    
gmsgDeathMsg    get_user_msgid("DeathMsg");
    
gmsgScoreInfo    get_user_msgid("ScoreInfo");
    
gmsgDamage        get_user_msgid("Damage");

    
//MultiForwards - thanks to posts by vittu && teame06
    
PokePayForward CreateMultiForward("poke_pay"ET_STOPFP_CELLFP_CELL);                //stop on return value, id, amount
    
PokeBuyForward CreateMultiForward("poke_buy"ET_STOPFP_CELLFP_CELLFP_CELL);    //stop on return value, id, item, amount
    
PokeBuyPokeForward CreateMultiForward("poke_buypoke"ET_STOPFP_CELLFP_CELL);        //stop on return value, id, poke

    
if(!PM_disabled){
        
PokeASkillForward CreateMultiForward("poke_attack_skill"ET_STOPFP_CELLFP_CELLFP_CELLFP_CELLFP_CELL);    //stop on return value, attacker, attacker_poke, victim, weapon, damage
        
PokeBSkillForward CreateMultiForward("poke_bind_skill"ET_STOPFP_CELLFP_CELL);                                //stop on return value, player, poke
        
PokeVSkillForward CreateMultiForward("poke_victim_skill"ET_STOPFP_CELLFP_CELLFP_CELLFP_CELLFP_CELL);    //stop on return value, attacker, victim, victim_poke, weapon, damage
        
PokeItemForward CreateMultiForward("poke_item_use"ET_STOPFP_CELLFP_CELL);                                    //stop on return value, id, item

        
RegisterItemForward CreateMultiForward("poke_register_item"ET_STOP);                                    //stop on return value
    
}

    
debugMessage0,7,"done making forwards" );

    
HUDSYNC CreateHudSyncObj();
    
g_coloredMenus colored_menus();

    
set_task(1.0"StartPokeMod"1);
 }

 
#if CHANGE_GAME_NAME==1
 
public GameDesc()
 {
    
forward_return(FMV_STRING,GAME_NAME);
    return 
FMRES_SUPERCEDE;
 }
 
#endif

 
public StartPokeMod(initial)
 {
    if(
initial){
        
#if ALLOW_WILD==1
            
set_task(180.0"WildMessage"0""0"b");
        
#endif

        #if SAVE==SAVE_MYSQL || SAVE==SAVE_SQLX || SAVE==SAVE_NVAULT
            
saving_init();
        
#endif

        #if POKERANK_SYSTEM==1
            
LoadRanks();
        
#endif

        
set_task(1.0"poke_round_end");
        
set_task(2.0"round_start");
    }

    
LoadConfig();

    
set_task(1.0"ResetMenus");
    
set_task(1.0"ReadXPs");
    
set_task(2.0"SetSafariLevels");
    
set_task(2.5"ResetItemCosts");    //create these before reading the pokemon
    
set_task(3.0"ReadPokemon");
 }
 
///////////////////////
 //--Precached Items--//
 ///////////////////////
 
public plugin_precache()
 {
    
SetupConfig();

    new 
0;

    new 
PokeFile[128];
    
Poke_FileNameF_PokeMapsPokeFile);

    if(
file_exists(PokeFile)){
        new 
Data[124], len;
        new 
mapname[32];
           new 
line 0;
        new 
bool:finding_map true;

        
get_mapname(mapname31);

        while( (
line read_file(PokeFile line Data 123 len) ) != ){

            if(
strlen(Data)<|| Data[0] == ';' || equali(Data,"//",2))
                continue;

            
//Check the map
            
if( Data[0] == '[' ){
                
replace(Data123"[""");
                
replace(Data123"]""");

                if(
containi(Data,"*")!=-1){
                    
replace_all(Data123"*""")
                    if(
containi(mapnameData)!=-1){    //deal with this map
                        
finding_map false;
                        continue;
                    }
                }
                else if(
equali(mapnameData)){
                    
finding_map false;
                    continue;
                }
                else
                    
finding_map true;
            }
            else if(!
finding_map){    //do the commands
                
if(equali(Data,"-disabled")){
                    
poke_error("%s PokeMod has been disabled.",PREFIX);
                    
PM_disabled 1;
                    break;
                }
                else if(
equali(Data,"-skills_off")){
                    
poke_error("%s PokeMod skills have been disabled.",PREFIX);
                    
PM_disabled = -1;
                    break;
                }
                else{
                    
set_task(5.0"delay_cmd",0,Data,strlen(Data));
                }
            }

        }
    }
    else 
ResetMapsConfig();

    if(!
PM_disabled){
        new 
precaches 1;

        
//Precached Sounds
        
for(i=0i<MAX_SNDi++)
            
precaches *=    poke_precache_sound(SOUNDS[i]);

        
//Precached Sprites
        
precaches *=    rope =             poke_precache_model("sprites/rope.spr");
        
precaches *=    bubble =         poke_precache_model("sprites/bubble.spr");
        
precaches *=    shockwave =        poke_precache_model("sprites/shockwave.spr");
        
precaches *=    steam1 =        poke_precache_model("sprites/steam1.spr");
        
precaches *=    explode1 =        poke_precache_model("sprites/explode1.spr");
        
precaches *=    xfire =            poke_precache_model("sprites/xfire.spr");
        
precaches *=    ballsmoke =        poke_precache_model("sprites/ballsmoke.spr");
        
precaches *=    zbeam6 =        poke_precache_model("sprites/zbeam6.spr");
        
precaches *=    eexplo =        poke_precache_model("sprites/eexplo.spr");
        
precaches *=    fire =            poke_precache_model("sprites/fire.spr");
        
precaches *=    lgtning =        poke_precache_model("sprites/lgtning.spr");
        
precaches *=    muzzleflash1 =    poke_precache_model("sprites/muzzleflash1.spr");
        
precaches *=    bigspit =        poke_precache_model("sprites/cnt1.spr");
        
//Custom Pokemon Sprites
        
precaches *=    xplode =         poke_precache_model("sprites/pokemon/zerogxplode2.spr");
        
precaches *=    arbok =         poke_precache_model("sprites/pokemon/arbok.spr");
        
precaches *=    trail =            poke_precache_model("sprites/pokemon/psybeam.spr");
        
precaches *=    gas =            poke_precache_model("sprites/pokemon/splash.spr");
        
precaches *=    snow =            poke_precache_model("sprites/pokemon/snow.spr");

        
//Precached Models
        
for(i=0i<MAX_MDLi++)
            
precaches *=    poke_precache_model(MODELS[i]);
        for(
i=0i<MAX_T_MDLi++)
            
precaches *=    poke_precache_model(MODELS_T[i]);

        if(
precaches==0){
            
poke_error("One or more files required for PokeMod not found. Pausing PokeMod.");
            
PM_disabled 1;
        }
    }
 }
 public 
delay_cmd(Data[])
    
server_cmd(Data);
 
poke_precache_model(const model[])
 {
    if(
file_exists(model) || contain(model,"pokemon")==-1){
        if( 
equal(model,"sprites"7)){
            new 
precache_return precache_model(model);
            if( !
precache_return )
                
poke_error("Error Precaching Sprite %s"model );
            return 
precache_return;
        }
        
precache_model(model);
        return 
1;
    }
    
poke_error("%s Not Found In Server"model );
    return 
0;
 }
 
poke_precache_sound(const sound[])
 {
    new 
sound_location[151];
    
formatex(sound_location150"sound/%s",sound);
    if(
file_exists(sound_location) || contain(sound,"pokemon")==-1){
        
precache_sound(sound);
        return 
1;
    }
    
poke_error("%s Not Found In Server"sound_location );
    return 
0;
 }
 
poke_error(const error[], {Float,Sql,Result,_}:...)
 {
    new 
output[256];
    
vformat(output255error2);
    
log_amx(output);
 }
 public 
plugin_end()
 {
    if(
PM_disabled==1)
        return;

    
// SAVE EVERYTHING...
    
debugMessage0,3,"[PokeMod] Making final saves before plugin unloads" );
    
save_all();

    
#if SAVE==SAVE_MYSQL || SAVE==SAVE_SQLX
        //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");
    
amx_show_activity register_cvar("amx_show_activity","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=0i<MAX_CVARSi++)
        
register_pokecvar(i,cvar_default[i]);

    
debugMessage0,7,"done registering cvars" );
 }

 
debugMessage(id=0level=0, const msg[], {Float,Sql,Result,_}:... )
 {
    if( 
PM_disabled==)
        return;

    static 
debugMode;
    
debugMode get_ppcvar_numpm_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 output[256];
    
vformatoutput255msg);

    static 
debug_key[51];
    
get_ppcvar_stringpm_debug_keydebug_key50 );
    if( 
debug_key[0] != '\0' && containi(output,debug_key) == -)
        return;        
//it didn't have the debug key in it

    
if( id