AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Tag mismatch (https://forums.alliedmods.net/showthread.php?t=60275)

Contrus 08-30-2007 14:45

Tag mismatch
 
Hello, does anyone know why i keep getting tag mismatch on line 21?

EDIT!: sorry should have posted the full code

/home/groups/amxmodx/tmp3/phpV0DF7b.sma(21) : warning 213: tag mismatch
/home/groups/amxmodx/tmp3/phpV0DF7b.sma(21) : warning 213: tag mismatch
/home/groups/amxmodx/tmp3/phpV0DF7b.sma(21) : warning 213: tag mismatch
/home/groups/amxmodx/tmp3/phpV0DF7b.sma(39) : warning 213: tag mismatch
/home/groups/amxmodx/tmp3/phpV0DF7b.sma(59) : warning 213: tag mismatch
Header size: 432 bytes
Code size: 1892 bytes
Data size: 328 bytes
Stack/heap size: 16384 bytes; estimated max. usage=40 cells (160 bytes)
Total requirements: 19036 bytes

5 Warnings.
Done.

Code:
<font face="monospace"><font color="#339900">#include <amxmodx> #include <fakemeta> #include <engine> #include <fun> new Float:event_cooldown[33] new Float:last_event[33] public plugin_init() {     register_concmd("test", "function") } stock bool:vacant_hull(const Float:origin[3], hull,id) {     new trace_results = 0     engfunc(EngFunc_TraceHull, origin, origin, 0, hull, id, trace_results)     if (!get_tr2(trace_results , TR_StartSolid) && !get_tr2(trace_results, TR_AllSolid) && get_tr2(trace_results , TR_InOpen))         return true                     return false } public function(id) {         static Float:time;     global_get(glb_time,time);         event_cooldown[id] = 2.0;         if (time - event_cooldown[id] < last_event[id]) return PLUGIN_HANDLED;         new Float:hull = pev(id, pev_flags) & FL_DUCKING ? HULL_HEAD : HULL_HUMAN     new distance=100     new Float:originalSpot[3],Float:aimVec[3], Float:dest[3]                       entity_get_vector(id,EV_VEC_origin,originalSpot)             VelocityByAim(id,distance,aimVec)             dest[0] = originalSpot[0] + aimVec[0]     dest[1] = originalSpot[1] + aimVec[1]     dest[2] = originalSpot[2] + aimVec[2] + 45.0;             entity_set_vector(id,EV_VEC_origin,dest)         if (!vacant_hull(dest, hull,id))     {         dest[0] = originalSpot[0]         dest[1] = originalSpot[1]         dest[2] = originalSpot[2]         entity_set_vector(id,EV_VEC_origin,dest)     }         else return PLUGIN_HANDLED;         last_event[id] = time;         return PLUGIN_HANDLED             } </font></font>


Arkshine 08-30-2007 15:03

Re: Tag mismatch
 
I've pasted this code into a plugin and it compiles fine...

Alka 08-30-2007 16:20

Re: Tag mismatch
 
Quote:

Originally Posted by arkshine (Post 525337)
I've pasted this code into a plugin and it compiles fine...

Hmm , strange ...for me was the same errors but i fixed and tested the code ; seems to work.... :S

Code:

#include <amxmodx>
#include <fakemeta>
 
#define PLUGIN "Teleport"
#define VERSION "1.0"
#define AUTHOR "Contrus"
 
#define MAX_PLAYERS 32
 
new Float:event_cooldown[MAX_PLAYERS + 1];
new Float:last_event[MAX_PLAYERS + 1];
 
public plugin_init() {
 
 register_plugin(PLUGIN, VERSION, AUTHOR);
 
 register_clcmd("teleport", "teleport_player");
}
 
public teleport_player(id)
{
 new Float:game_time = get_gametime();
 
 event_cooldown[id] = 2.0;
 
 if(game_time - event_cooldown[id] < last_event[id])
  return 1;
 
 new Hull = pev(id, pev_flags) & FL_DUCKING ? HULL_HEAD : HULL_HUMAN
 
 new Distance = 500;
 
 new Float:Origin[3],Float:AimVec[3], Float:Dest[3];
 pev(id, pev_origin, Origin);
 
 velocity_by_aim(id, Distance, AimVec);
 
 Dest[0] = Origin[0] + AimVec[0];
 Dest[1] = Origin[1] + AimVec[1];
 Dest[2] = Origin[2] + AimVec[2] + 45.0;
 
 engfunc(EngFunc_SetOrigin, id, Dest);
 
 if(!vacant_hull(Dest, Hull, id))
 {
  Dest[0] = Origin[0];
  Dest[1] = Origin[1];
  Dest[2] = Origin[2];
 
  engfunc(EngFunc_SetOrigin, id, Dest);
 }
 else
  return 1;
 
 last_event[id] = game_time;
 
 return 1;
}
 
stock bool:vacant_hull(const Float:origin[3], hull, id)
{
 new trace_results = 0;
 engfunc(EngFunc_TraceHull, origin, origin, 0, hull, id, trace_results);
 if(!get_tr2(trace_results , TR_StartSolid) && !get_tr2(trace_results, TR_AllSolid) && get_tr2(trace_results , TR_InOpen))
  return true;
 
 return false;
}


Contrus 08-31-2007 10:37

Re: Tag mismatch
 
Thanks alot +karma!

kp_uparrow 09-02-2007 13:57

Re: Tag mismatch
 
does that when <engine> is included

Alka 09-02-2007 15:19

Re: Tag mismatch
 
Quote:

Originally Posted by kp_uparrow (Post 526415)
does that when <engine> is included

#Off : Actually yeah, because engine sux! :D


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

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