Raised This Month: $51 Target: $400
 12% 

[HELP] Fix word variable


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
extream87
Senior Member
Join Date: Aug 2011
Old 08-09-2015 , 15:35   [HELP] Fix word variable
Reply With Quote #1

Hello all, someone can fix or tell me whats wrong with code?
Im using maxlen = 20 but i can only put 8 characters.

Code:
new ChangeNameCommand[] = ".rankname", ChangeNameCommandCvar const ChangeNameCommandMaxLen = 20 register_event("SayText", "NameChange", "b"); ChangeNameCommandCvar = register_cvar("changeName_cmd",ChangeNameCommand) public NameChange(id){      new id = read_data(1);         new command[ChangeNameCommandMaxLen]     get_pcvar_string(ChangeNameCommandCvar,command,ChangeNameCommandMaxLen-1)         new commandStringLen = strlen(command)         new commandGiven[ChangeNameCommandMaxLen]     read_data(4, commandGiven, commandStringLen + 32);             if(equal(command,commandGiven,commandStringLen) && commandGiven[commandStringLen] == ' ')     {         new name[32]         format(name,31,commandGiven[commandStringLen])            replace_all(name, charsmax(name), " ", " ")                 new szTemp[ 512 ]         formatex( szTemp, charsmax( szTemp ),         "UPDATE %s SET nick = '%s' WHERE authid = '%s'", SQL_TABLE, name[ id ], g_szAuthID[ id ] )             SQL_ThreadQuery( g_SqlTuple, "IgnoreHandle", szTemp )     } }

Last edited by extream87; 08-11-2015 at 06:20.
extream87 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 04:54.


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