AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   TS RP Super Jump (https://forums.alliedmods.net/showthread.php?t=26669)

Nimgoble 04-07-2006 03:10

TS RP Super Jump
 
Hello. I've created a little script to slay a user that picks up the superjump item. Ideally, the item wouldn't be able to be picked up at all, but I just started scripting today. It compiles fine, but does not work with the TS RP mod. I believe the AMXX version the server is using is 1.01.

Code:

#include <amxmodx>
#include <tsx>
#include <tsconst>
#include <tsfun>
#include <tsstats>

public plugin_init()
{
    register_plugin("TS Super Jump Disable","1.0","Nimgoble");
    register_cvar("amx_togglesuperjump","0");
    register_event("PwUp","check_powerup","be");
}

public check_powerup(id)
{
    //new items = ts_getuseritems(id);
    if( get_cvar_num("ts_has_superjump") && !get_cvar_num("amx_togglesuperjump"))
    {
            user_kill(id);
            client_print(id,print_chat,"Super Jump is not allowed.");
    }
    //client_print(id,print_chat,"No Super Jump");
   
    return PLUGIN_CONTINUE;
}

This is a bastardized version of someone else's script in another super jump thread. I also added "ts_has_superjump" because all the other items had one of their own. Does this not work because of the AMXX version or my code? Thanks for your help.

VEN 04-07-2006 07:10

Quote:

Does this not work because of the AMXX version or my code?
Check amxx logs for the related errors.

Maddo 04-07-2006 08:44

ts_has_superjump is a function, not a cvar.

Try this:

Code:

#include <amxmodx>
#include <tsx>
#include <tsfun>

public plugin_init()
{
    register_plugin("TS Super Jump Disable","1.0","Nimgoble");
    register_cvar("amx_togglesuperjump","0");
    register_event("PwUp","check_powerup","be");
}

public check_powerup(id)
{
    //new items = ts_getuseritems(id);
    if( ts_has_superjump(id) && !get_cvar_num("amx_togglesuperjump"))
    {
            user_kill(id);
            client_print(id,print_chat,"Super Jump is not allowed.");
    }
    //client_print(id,print_chat,"No Super Jump");
   
    return PLUGIN_CONTINUE;
}


Nimgoble 04-07-2006 19:17

Thank you sir, I shall try that.


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

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