Raised This Month: $ Target: $400
 0% 

Modifying Fullthrottles rules script, couple of problems


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Link
New Member
Join Date: Mar 2005
Old 04-02-2005 , 20:13   Modifying Fullthrottles rules script, couple of problems
Reply With Quote #1

I am trying to modify this script to perform different actions depending on the number of times a player has been warned for breaking the rules. Basically, it should do teh following

1. Just give a warning
2. Slay the player
3. Kick the player
4. Temp ban the player
5. Perm ban the player

However, what it actually does is this

1. Just give a warning
2. Nothing (Slay command must just be wrong)
3. Kick the player
At this point, if the player rejoins, it starts from the top (Warning, notslay, kick)

The slay is, I imagine an easy fix, simply an incorrect command. However, I think the fact that it "forgets" players previous warnings is due to using the player names instead of steamids. I have changed it to perform actions on authids rather than names, but I won't be able to test it untill tommorow, so if someone sees a reason its not working thats not that, please let me know.

Anyway, I am trying to modify this script. The only modification I have done is to the handleViolation function, as follows:

Code:
public handleViolation(id,player) {     WARNINGS[player]++         new authid[32], authid2[32], name[32], name2[32]     new something=0         get_user_authid(id, authid, 31)     get_user_authid(player, authid2, 31)     get_user_name(id, name, 31)     get_user_name(player, name2, 31)                    new userid2 = get_user_userid(player)     new reason[MAXENTRYLENGTH]     reason = ENTRY[MENU_OPTION[id]]     new nAction = get_cvar_num( CVARMAXWARNINGSACTION )     new nLimit = get_cvar_num( CVARMAXWARNINGS )     new nBanTime = get_cvar_num( CVARBANTIME )         switch(get_cvar_num("amx_show_activity")) {         case 2: client_print(0, print_chat, "ADMIN %s: %s %s for: %s", name, (WARNINGS[player] <= nLimit) ? ACTIONS[0] : ACTIONS[nAction], name2, reason )         case 1: client_print(0, print_chat, "ADMIN: %s %s for: %s", (WARNINGS[player] <= nLimit) ? ACTIONS[0] : ACTIONS[nAction], name2, reason )     }     if ( WARNINGS[player] <= nLimit ) {         displayentry( player, MENU_OPTION[id] )     } else {         nAction = WARNINGS[player]         something++                 switch(nAction) {             case 1: server_cmd( "" )             case 2: server_cmd( "amx_slay #%d", userid2 )             case 3: server_cmd( "kick #%d", userid2 )             case 4: server_cmd( "banid %d #%d kick;writeid", nBanTime, userid2 )             case 5: server_cmd( "banid %d #%d kick;writeid", 0, userid2 )         }       }     return PLUGIN_HANDLED }

Anyone got any ideas where I am going wrong?

*Edit - Of course disabling my immunity allows me to test this.. ok, so I'm a dumbarse ;)
Anyway, a bit of work on this, it now slays properly, but still forgets people after they reconnect from the kick.

*Code updated to current
Link is offline
 



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:03.


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