Raised This Month: $ Target: $400
 0% 

TS RP Super Jump


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Nimgoble
Junior Member
Join Date: Apr 2006
Old 04-07-2006 , 03:10   TS RP Super Jump
Reply With Quote #1

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.
Nimgoble is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 04-07-2006 , 07:10  
Reply With Quote #2

Quote:
Does this not work because of the AMXX version or my code?
Check amxx logs for the related errors.
VEN is offline
Maddo
Member
Join Date: Dec 2004
Old 04-07-2006 , 08:44  
Reply With Quote #3

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; 
}
Maddo is offline
Nimgoble
Junior Member
Join Date: Apr 2006
Old 04-07-2006 , 19:17  
Reply With Quote #4

Thank you sir, I shall try that.
Nimgoble is offline
Reply



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 16:40.


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