AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Little question (https://forums.alliedmods.net/showthread.php?t=17072)

PM 08-25-2005 10:57

Little question
 
What is the meaning of this?

Code:

/home/groups/amxmodx/tmp/phptYeMJV.sma(48) : warning 213: tag mismatch
/home/groups/amxmodx/tmp/phptYeMJV.sma(52) : warning 213: tag mismatch
/home/groups/amxmodx/tmp/phptYeMJV.sma(63) : warning 213: tag mismatch

3 Warnings.


v3x 08-25-2005 11:06

Code? ...

PM 08-25-2005 11:17

Its a plugin i am making just for some fun and im trying to learn it

Code:
#include <amxmodx> #include <fun> #include <cstrike> #include <amxmisc> new PLUGIN[]="PGravity" new AUTHOR[]="B0oGeYm4n" new VERSION[]="1.00" public plugin_init() {      register_plugin(PLUGIN, VERSION, AUTHOR)      register_concmd("amx_pgravity", "cmd_pgrav", ADMIN_SLAY, "<target> <gravity>") } public cmd_hp(id, level, cid) {      if (!cmd_access(id, level, cid, 3))         return PLUGIN_HANDLED      new Arg1[24]      new Arg2[4]            read_argv(1, Arg1, 23)      read_argv(2, Arg2, 3)            new Gravity = str_to_num(Arg2)            if (Arg1[0] == '@')      {           new Team = 0           if (equali(Arg1[1], "CT"))           {                Team = 2           } else if (equali(Arg1[1], "T")) {                Team = 1           }           new players[32], num           get_players(players, num)           new i           for (i=0; i<num; i++)           {                if (!Team)                {                     set_user_gravity(players[i], Gravity)                } else {                     if (get_user_team(players[i]) == Team)                     {                          set_user_gravity(players[i], Gravity)                     }                }           }      } else {           new player = cmd_target(id, Arg1, 1)           if (!player)           {                console_print(id, "The player could not be found", Arg1)                return PLUGIN_HANDLED           } else {                set_user_gravity(player, Gravity)           }      }      return PLUGIN_HANDLED }

Brad 08-25-2005 11:37

It means that it's expecting one type of variable and you pass it a different type. In your case, you're passing an integer (as the gravity) instead of a float.

Instead of:
Code:
new Gravity = str_to_num(Arg2)
Use this:
Code:
new Gravity = floatstr(Arg2)

v3x 08-25-2005 12:13

Code:
new Float:Gravity = floatstr(Arg2)
*

Brad 08-25-2005 14:14

<head hung in shame>

Yeah, what v3x said.

Xanimos 08-25-2005 14:57

also
Code:
     register_concmd("amx_pgravity", "cmd_pgrav", ADMIN_SLAY, "<target> <gravity>") } public cmd_hp(id, level, cid)

should be

Code:
     register_concmd("amx_pgravity", "cmd_pgrav", ADMIN_SLAY, "<target> <gravity>") } public cmd_pgrav(id, level, cid)

PM 08-26-2005 03:30

Tnx guys


All times are GMT -4. The time now is 14:20.

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