AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   function inb? (https://forums.alliedmods.net/showthread.php?t=3627)

Burnzy 07-10-2004 19:26

function inb?
 
whats is the function 'inb' from amx now?

Quote:

undefined symbol "inb"

jtp10181 07-10-2004 19:29

WTH are you talking about?

its not a function in AMX nor AMXx

Are you sure you just did not forget to define something?

SidLuke 07-10-2004 19:30

:shock: post code :P

Burnzy 07-10-2004 19:38

Code:
#include <amxmodx> #include <amxmisc> #include <fun> #define NEG_GRAV                -50.0 #define CRUSH_GRAV       999999999.0 #define DELAY                    1.0 #define RISE_TIME                3.0 #define FALL_TIME                4.0 #define SMALL_JUMP              15 new Float:old_grav          // to remember old grav setting new bool:is_in_progress     // to know if there is a crush in progress new thePlayers[32], nb      // to remember which players are being crushed public grav_crush(id,level,cid) {     // check access rights     if (!cmd_access(id,level,cid,1))         return PLUGIN_HANDLED     // check if there is already a crush     if (is_in_progress)     {         console_print(id,"There is already a crush in progress.")         return PLUGIN_HANDLED     }     // send hud warning     is_in_progress = true     show_hudmessage(0, "Now, you will all be crushed !")     // support for amx_show_activity     switch (get_cvar_num("amx_show_activity"))     {     case 1 :         client_print(0, print_chat, "ADMIN has launched a gravity crush !")     case 2 :         {             new name[32]             get_user_name(id, name, 31)             client_print(0, print_chat, "ADMIN %s has launched a gravity crush !", name)         }     }     // set all tasks     set_task(DELAY, "begin_jump")     set_task(DELAY + RISE_TIME, "reverse_grav")     set_task(DELAY + FALL_TIME, "restore_grav")     return PLUGIN_HANDLED } public begin_jump() {     // change gravity     old_grav = get_cvar_float("sv_gravity")     set_cvar_float("sv_gravity", NEG_GRAV)     // make all alive players jump     get_players(thePlayers,nb,"a")     new origin[3]     for(new i=0; i<nb; ++i)     {         get_user_origin(thePlayers[i], origin)         origin[2] += SMALL_JUMP         set_user_origin(thePlayers[i], origin)     }         return PLUGIN_HANDLED } public reverse_grav() {     // reverse gravity     set_cvar_float("sv_gravity", CRUSH_GRAV)     // set all immune alive players in godmode     get_players(thePlayers,nb,"a")       for(new i=0; inb; ++i)         if (get_user_flags(thePlayers[i])&ADMIN_IMMUNITY)                   set_user_godmode(thePlayers[i],1)     return PLUGIN_HANDLED } public restore_grav() {     // restore gravity     set_cvar_float("sv_gravity", old_grav)     // remove godmode for everyone     get_players(thePlayers,nb)       for(new i=0; inb; ++i)         if (get_user_godmode(thePlayers[i]))                    set_user_godmode(thePlayers[i])     is_in_progress = false     return PLUGIN_HANDLED } public plugin_init() {     register_plugin("Gravity Crush","1.0","Vince1")     register_concmd("amx_gravity_crush","grav_crush",ADMIN_SLAY)     is_in_progress = false     return PLUGIN_CONTINUE }

kingpin 07-10-2004 19:41

umm anything has to be defined first i.e. "inb" has to be defined somewhere in the code. i.e. "new inb" or something I didnt read the code yet I dont know what context you are using it in.

jtp10181 07-10-2004 19:42

Code:

inb
should be
Code:

i < nb

Burnzy 07-10-2004 19:42

im porting a plugin. Seems it wasnt even defined...

Burnzy 07-10-2004 19:45

originally from here
http://amxmod.net/amx-getplugin.php?id=17501&t=17501

SidLuke 07-10-2004 19:45

Quote:

Originally Posted by jtp10181
Code:

inb
should be
Code:

i < nb

Yes
Code:

public restore_grav()
{
    // restore gravity
    set_cvar_float("sv_gravity", old_grav)

    // remove godmode for everyone
    get_players(thePlayers,nb) 
    for(new i=0; i<nb; ++i)
        if (get_user_godmode(thePlayers[i]))         
            set_user_godmode(thePlayers[i])

    is_in_progress = false
    return PLUGIN_HANDLED
}


Burnzy 07-10-2004 19:52

thx man


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

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