AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [SOLVED] Help fixing "Tag mismatch" (https://forums.alliedmods.net/showthread.php?t=233863)

mlar98 01-21-2014 03:17

[SOLVED] Help fixing "Tag mismatch"
 
Hello. I'm editing a plugin that I found somewhere in this forum to change the speed when using the knife. I added a cvar, the plugin is working but when compile I get these warnings:

Warning: Tag mismatch on line 20. [new MAXSPEED = get_pcvar_float(g_MAXSPEED);]
Warning: Tag mismatch on line 24. [set_user_maxspeed(id, MAXSPEED)]

What's wrong with the plugin? Please help me!
Thanks in advance :)

PHP Code:

#include <amxmodx>
#include <fun>

#define PLUGIN "Faster with knife"
#define VERSION "0.1"
#define AUTHOR "v3x"

new g_MAXSPEED

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
register_event("CurWeapon","Event_CurWeapon","b");
    
g_MAXSPEED register_cvar("knife_speed""420.0")
}

public 
Event_CurWeaponid )
{
    new 
clipammoweapon get_user_weapon(id,clip,ammo);
    new 
MAXSPEED get_pcvar_float(g_MAXSPEED);

    if(
weapon == CSW_KNIFE)
    {
        
set_user_maxspeed(idMAXSPEED)
    }



DavidJr 01-21-2014 04:00

Re: Help fixing "Tag mismatch"
 
PHP Code:

new MAXSPEED 

:arrow:

PHP Code:

new Float:MAXSPEED 


mlar98 01-21-2014 04:29

Re: Help fixing "Tag mismatch"
 
Quote:

Originally Posted by DavidJr (Post 2088918)
PHP Code:

new MAXSPEED 

:arrow:

PHP Code:

new Float:MAXSPEED 


Thank you :)

hornet 01-21-2014 05:21

Re: [SOLVED] Help fixing "Tag mismatch"
 
I recommend that you take an extra step to make the plugin substantially more efficient.

CurWeapon is sent every time the clip ammo is changed, therefore in this plugin it's being sent far more times than necessary, since you only want it when a player pulls out their knife.

Therefore it should instead be registered like this:
Code:
register_event( "CurWeapon", "Event_CurWeapon", "be", "1=1", "2=29" );

You can than also remove the line that checks if the player is holding a knife.


All times are GMT -4. The time now is 10:08.

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