Raised This Month: $ Target: $400
 0% 

[SOLVED] Help fixing "Tag mismatch"


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mlar98
Junior Member
Join Date: Mar 2012
Location: Lima, Peru
Old 01-21-2014 , 03:17   [SOLVED] Help fixing "Tag mismatch"
Reply With Quote #1

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)
    }


Last edited by mlar98; 01-21-2014 at 04:29. Reason: Solved.
mlar98 is offline
DavidJr
Senior Member
Join Date: Apr 2012
Old 01-21-2014 , 04:00   Re: Help fixing "Tag mismatch"
Reply With Quote #2

PHP Code:
new MAXSPEED 


PHP Code:
new Float:MAXSPEED 
__________________
What are you looking for here?
DavidJr is offline
mlar98
Junior Member
Join Date: Mar 2012
Location: Lima, Peru
Old 01-21-2014 , 04:29   Re: Help fixing "Tag mismatch"
Reply With Quote #3

Quote:
Originally Posted by DavidJr View Post
PHP Code:
new MAXSPEED 


PHP Code:
new Float:MAXSPEED 
Thank you
mlar98 is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 01-21-2014 , 05:21   Re: [SOLVED] Help fixing "Tag mismatch"
Reply With Quote #4

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.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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