AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Pawn preprocessor (https://forums.alliedmods.net/showthread.php?t=243356)

GuskiS 07-03-2014 10:11

Pawn preprocessor
 
PHP Code:

stock cs_reset_user_maxspeed(id)
{
    static 
Float:maxspeed;
    switch(
get_user_weapon(id))
    {
        case 
CSW_SG550CSW_AWPCSW_G3SG1maxspeed 210.0;
        case 
CSW_M249maxspeed 220.0;
        case 
CSW_AK47maxspeed 221.0;
        case 
CSW_M3CSW_M4A1maxspeed 230.0;
        case 
CSW_SG552maxspeed 235.0;
        case 
CSW_XM1014CSW_AUGCSW_GALILCSW_FAMASmaxspeed 240.0;
        case 
CSW_P90maxspeed 245.0;
        case 
CSW_SCOUTmaxspeed 260.0;
        default: 
maxspeed 250.0;
    }
    
#if defined _fun_included
    
set_user_maxspeed(idmaxspeed);
    
#elseif defined _engine_included
    
entity_set_float(idEV_FL_maxspeedmaxspeed);
    
#else
    
set_pev(idpev_maxspeedmaxspeed);
    
#endif


This code gives me error: undefined symbol "set_user_maxspeed", but includes look like this:
PHP Code:

#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <hamsandwich>
#include <cstrike>
#include <jailbreak> // my include which includes that stock 

What is the problem?

Porta0123 07-03-2014 10:19

Re: Pawn preprocessor
 
Quote:

Originally Posted by GuskiS (Post 2161351)
PHP Code:

stock cs_reset_user_maxspeed(id)
{
    static 
Float:maxspeed;
    switch(
get_user_weapon(id))
    {
        case 
CSW_SG550CSW_AWPCSW_G3SG1maxspeed 210.0;
        case 
CSW_M249maxspeed 220.0;
        case 
CSW_AK47maxspeed 221.0;
        case 
CSW_M3CSW_M4A1maxspeed 230.0;
        case 
CSW_SG552maxspeed 235.0;
        case 
CSW_XM1014CSW_AUGCSW_GALILCSW_FAMASmaxspeed 240.0;
        case 
CSW_P90maxspeed 245.0;
        case 
CSW_SCOUTmaxspeed 260.0;
        default: 
maxspeed 250.0;
    }
    
#if defined _fun_included
    
set_user_maxspeed(idmaxspeed);
    
#elseif defined _engine_included
    
entity_set_float(idEV_FL_maxspeedmaxspeed);
    
#else
    
set_pev(idpev_maxspeedmaxspeed);
    
#endif


This code gives me error: undefined symbol "set_user_maxspeed", but includes look like this:
PHP Code:

#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <hamsandwich>
#include <cstrike>
#include <jailbreak> // my include which includes that stock 

What is the problem?

---------------------------
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team

Header size: 404 bytes
Code size: 444 bytes
Data size: 40 bytes
Stack/heap size: 16384 bytes; estimated max. usage=42 cells (168 bytes)
Total requirements: 17272 bytes
Done.
--------------------------

i put the same code ... and it dont show any error

GuskiS 07-03-2014 10:28

Re: Pawn preprocessor
 
Weird, I'm still having this error. Try to include fun, compile then. After that recompile without fun, I'm wondering if it somehow stays in memory :O

Porta0123 07-03-2014 11:04

Re: Pawn preprocessor
 
without fun:
http://i60.tinypic.com/2rrmdr8.png

with fun:

http://i62.tinypic.com/29mk2sl.png

GuskiS 07-03-2014 11:15

Re: Pawn preprocessor
 
The thing about "stock" is that it means you can compile without that function if you don't use it. Set it to public and you should get that error.

Porta0123 07-03-2014 11:19

Re: Pawn preprocessor
 
Code:
#include <amxmodx> #include <engine> #include <fakemeta> #include <hamsandwich> #include <cstrike> public cs_reset_user_maxspeed(id) {     static Float:maxspeed;     switch(get_user_weapon(id))     {         case CSW_SG550, CSW_AWP, CSW_G3SG1: maxspeed = 210.0;         case CSW_M249: maxspeed = 220.0;         case CSW_AK47: maxspeed = 221.0;         case CSW_M3, CSW_M4A1: maxspeed = 230.0;         case CSW_SG552: maxspeed = 235.0;         case CSW_XM1014, CSW_AUG, CSW_GALIL, CSW_FAMAS: maxspeed = 240.0;         case CSW_P90: maxspeed = 245.0;         case CSW_SCOUT: maxspeed = 260.0;         default: maxspeed = 250.0;     }     #if defined _fun_included     set_user_maxspeed(id, maxspeed);     #elseif defined _engine_included     entity_set_float(id, EV_FL_maxspeed, maxspeed);     #else     set_pev(id, pev_maxspeed, maxspeed);     #endif }

Code:
#include <amxmodx> #include <engine> #include <fakemeta> #include <hamsandwich> #include <cstrike> stock cs_reset_user_maxspeed(id) {     static Float:maxspeed;     switch(get_user_weapon(id))     {         case CSW_SG550, CSW_AWP, CSW_G3SG1: maxspeed = 210.0;         case CSW_M249: maxspeed = 220.0;         case CSW_AK47: maxspeed = 221.0;         case CSW_M3, CSW_M4A1: maxspeed = 230.0;         case CSW_SG552: maxspeed = 235.0;         case CSW_XM1014, CSW_AUG, CSW_GALIL, CSW_FAMAS: maxspeed = 240.0;         case CSW_P90: maxspeed = 245.0;         case CSW_SCOUT: maxspeed = 260.0;         default: maxspeed = 250.0;     }     #if defined _fun_included     set_user_maxspeed(id, maxspeed);     #elseif defined _engine_included     entity_set_float(id, EV_FL_maxspeed, maxspeed);     #else     set_pev(id, pev_maxspeed, maxspeed);     #endif }   public client_putinserver(id) {     cs_reset_user_maxspeed(id) }

Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team

Header size: 484 bytes
Code size: 984 bytes
Data size: 44 bytes
Stack/heap size: 16384 bytes; estimated max. usage=42 cells (168 bytes)
Total requirements: 17896 bytes
Done.

GuskiS 07-03-2014 12:39

Re: Pawn preprocessor
 
Sorry, indeed it works. I forgot that I had used set_user_maxspeed somewhere in that plugin. I was working on that stock and I was doing something wrong, after fixing it, I didn't read the whole message - that error was in plugin, not stock. Thanks anyways :D


All times are GMT -4. The time now is 21:16.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.