Raised This Month: $ Target: $400
 0% 

Truncate value from vault


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
alonelive
Senior Member
Join Date: Jan 2011
Location: Big snow country.. :)
Old 06-07-2013 , 11:48   Truncate value from vault
Reply With Quote #1

Hello!

we have this:

server_print("%d. %-20.20s %d", (i + 1), data[VD_Key], data[VD_Value]);
How i can truncate for printing value in data[VD_Key]: 'TIMEPLAYED' ?

What i have:

3. TIMEPLAYED[P*D]Dredd 8

What i want:

3. [P*D]Dredd 8

PHP Code:
    new name[33];
    new 
vaultkey[64], vaultdata[64];
    
    
get_user_name(idname32);
    
    
format(vaultkey63"TIMEPLAYED%s"name); 
    
format(vaultdata63"%d"PlayedTime); 
__________________
sorry my bad english...
alonelive is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 06-07-2013 , 12:20   Re: Truncate value from vault
Reply With Quote #2

TIMEPLAYED%s -> %s TIMEPLAYED
__________________
Kia is offline
alonelive
Senior Member
Join Date: Jan 2011
Location: Big snow country.. :)
Old 06-07-2013 , 12:29   Re: Truncate value from vault
Reply With Quote #3

Quote:
Originally Posted by Kia View Post
TIMEPLAYED%s -> %s TIMEPLAYED
no..
i want to remove the word 'TIMEPLAYED' from output of server_print
but this keyword will still in DB (do not edit).
__________________
sorry my bad english...
alonelive is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 06-07-2013 , 13:21   Re: Truncate value from vault
Reply With Quote #4

Quote:
Originally Posted by alonelive View Post
no..
i want to remove the word 'TIMEPLAYED' from output of server_print
but this keyword will still in DB (do not edit).
Oh sorry, misunderstood that.
__________________
Kia is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-07-2013 , 12:38   Re: Truncate value from vault
Reply With Quote #5

Will the value always be? "TIMEPLAYED$name$"?

If so, just reference the string with strVariable[ 10 ]

Or change it when saved? Based on your last post it sounds like you do not want to change the way its saved?

PHP Code:
format(vaultkey63"TIMEPLAYED%s"name);  

to 

formatex
(vaultkey63"%s"name); 
__________________

Last edited by Bugsy; 06-07-2013 at 12:41.
Bugsy is offline
alonelive
Senior Member
Join Date: Jan 2011
Location: Big snow country.. :)
Old 06-07-2013 , 12:44   Re: Truncate value from vault
Reply With Quote #6

Thank you!, solved..
__________________
sorry my bad english...
alonelive is offline
Reply


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


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