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

subtracting time code


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
yamin
BANNED
Join Date: Jan 2012
Location: Sharjah
Old 06-16-2012 , 08:00   subtracting time code
Reply With Quote #1

this code doesn't works
PHP Code:
    formatex(g_query,511,"UPDATE played_time SET playedtime=playedtime-350 WHERE name='%s'",name)
    
SQL_ThreadQuery(sql,"query",g_query
yamin is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 06-17-2012 , 04:12   Re: subtracting time code
Reply With Quote #2

I'm at no advanced level of PHP, but I believe an entry must already exist in order to use UPDATE. Are you getting an error?

Show your full code.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
yamin
BANNED
Join Date: Jan 2012
Location: Sharjah
Old 06-17-2012 , 05:09   Re: subtracting time code
Reply With Quote #3

i am not getting errors just some warnings
PHP Code:
public client_death(killer,victim){
    if(
victim!=isolo)
        return
    
    new 
name[32]
    
get_user_name(victim,name,31)
    
    
formatex(g_query,511,"UPDATE played_time SET playedtime=playedtime-350 WHERE name='%s'",name)
    
SQL_ThreadQuery(sql,"query",g_query)
    
    
get_user_name(killer,name,31)
    
    
formatex(g_query,511,"UPDATE played_time SET playedtime=playedtime+100 WHERE name='%s'",name)
    
SQL_ThreadQuery(sql,"query",g_query)

yamin is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 06-17-2012 , 05:13   Re: subtracting time code
Reply With Quote #4

What are the warnings you are getting?
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
yamin
BANNED
Join Date: Jan 2012
Location: Sharjah
Old 06-17-2012 , 05:17   Re: subtracting time code
Reply With Quote #5

/tmp/textseJfqW.sma(39) : warning 201: redefinition of constant/macro (symbol "SILVER")
/tmp/textseJfqW.sma(41) : warning 201: redefinition of constant/macro (symbol "ADMIN")
/tmp/textseJfqW.sma(59) : warning 217: loose indentation
/tmp/textseJfqW.sma(105) : warning 217: loose indentation
/tmp/textseJfqW.sma(10 : warning 217: loose indentation
/tmp/textseJfqW.sma(113) : warning 217: loose indentation
/tmp/textseJfqW.sma(12 : warning 209: function "eCurWeapon" should return a value
/tmp/textseJfqW.sma(134) : warning 217: loose indentation
/tmp/textseJfqW.sma(135) : warning 217: loose indentation
/tmp/textseJfqW.sma(137) : warning 217: loose indentation
/tmp/textseJfqW.sma(163) : warning 217: loose indentation
/tmp/textseJfqW.sma(173) : warning 217: loose indentation
/tmp/textseJfqW.sma(373) : warning 203: symbol is never used: "colorChat"
/tmp/textseJfqW.sma(373) : warning 203: symbol is never used: "findAnyPlayer"
/tmp/textseJfqW.sma(373) : warning 203: symbol is never used: "g_addCvar"
/tmp/textseJfqW.sma(373) : warning 203: symbol is never used: "messageSayText"
/tmp/textseJfqW.sma(373) : warning 203: symbol is never used: "messageTeamInfo"
yamin is offline
yamin
BANNED
Join Date: Jan 2012
Location: Sharjah
Old 06-17-2012 , 05:22   Re: subtracting time code
Reply With Quote #6

there is no warning in this code
yamin is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 06-17-2012 , 05:23   Re: subtracting time code
Reply With Quote #7

Those warnings do not apply to the code snippet you supplied


Now, back to your original question. Define "doesn't work". How do you know it is not working? What kind of debugging have you done? Are you sure it is even executing? Is the SQL server accepting your query and executing it without any errors?
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Waleed
Senior Member
Join Date: May 2012
Location: Pakistan
Old 06-17-2012 , 05:56   Re: subtracting time code
Reply With Quote #8

For loose indentation you can use Indenter,Click on Tools->Indenter
This should solve your 99% indentation warning.
You have put these variables,But you are not using them,Put "//" before them to disable,If no warnings are given,Then you can delete those variables as you are not using them.


/tmp/textseJfqW.sma(373) : warning 203: symbol is never used: "colorChat"
/tmp/textseJfqW.sma(373) : warning 203: symbol is never used: "findAnyPlayer"
/tmp/textseJfqW.sma(373) : warning 203: symbol is never used: "g_addCvar"
/tmp/textseJfqW.sma(373) : warning 203: symbol is never used: "messageSayText"
/tmp/textseJfqW.sma(373) : warning 203: symbol is never used: "messageTeamInfo"
__________________
Working On:
  1. Gameplay 1 - 0% [PAUSED]
Waleed is offline
Send a message via Skype™ to Waleed
yamin
BANNED
Join Date: Jan 2012
Location: Sharjah
Old 06-17-2012 , 12:10   Re: subtracting time code
Reply With Quote #9

how will i know if the plugin works or not?
yamin is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-17-2012 , 12:27   Re: subtracting time code
Reply With Quote #10

Quote:
Originally Posted by yamin View Post
how will i know if the plugin works or not?
lol, I think you are in trouble if you have to ask that. The plugin works if it does what it is supposed to do. Therefore, if it does not do what it is supposed to do then it doesn't work . . .
__________________
fysiks 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 10:46.


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