Raised This Month: $ Target: $400
 0% 

Getting wrong player index


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
XAM
Junior Member
Join Date: Mar 2008
Old 07-26-2008 , 15:57   Getting wrong player index
Reply With Quote #1

When someone with an index over 9, 2 numbers that means, it will only read the first number, and it will ban wrong person.

Example: a Player with index 13, gets banned by HLGUARD and kicked. But the ban will be applied to the player with index 1 instead. (in my case its my HLTV, so no harm done, but it needs to be fixed).

My code:
PHP Code:
public hlguardBan() {
    new 
bIds[1],bId[1],bLength[8],bReason[64],bNick[32],bSteamid[32],sqlCache[512]
    
read_argv(1,bIds,1)
    
bId[0] = str_to_num(bIds)
    
read_argv(2bLength7)
    
read_argv(3bReason63)
    
get_user_name(bId[0],bNick,31)
    
get_user_authid(bId[0],bSteamid,31)
    
replace_all(bNick,31,"'"," ")
    if(
equal(bLength,"3600"))
        
formatex(sqlCache,511,"INSERT INTO bans(steamid, steamid_admin, nickname, reason, added, ends, removed) VALUES('%s', '%s', '%s', '%s', NOW(), '2100-01-01 00:00:00', 0)",bSteamid,"HLGUARD",bNick,bReason)
    else
        
formatex(sqlCache,511,"INSERT INTO bans(steamid, steamid_admin, nickname, reason, added, ends, removed) VALUES('%s', '%s', '%s', '%s', NOW(), date_add(NOW(), interval %s day), 0)",bSteamid,"HLGUARD",bNick,bReason,bLength)
    
SQL_ThreadQuery(g_SqlTuple,"sqlQueryDefault",sqlCache,bId,1)

XAM is offline
 


Thread Tools
Display Modes

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 05:31.


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