AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   multi " in one line (https://forums.alliedmods.net/showthread.php?t=92744)

biscuit628 05-19-2009 02:45

multi " in one line
 
halo, i am script a plugin it's need at least three "
like this
-----delete-----

here is my new problem!
PHP Code:

server_cmd("hlg_action ^"u:found^" ^"hlg_say [HLGViolation by %n(%idetected^"")

server_cmd("hlg_action ^"u:found^" ^"hlg_say [HLGViolation: %y^"")

server_cmd("hlg_action ^"u:found^" ^"hlg_say [HLGPunishmentban^"")

server_cmd("hlg_action ^"u:found^" ^"amx_banip #%u 0^"") 

and i get this error
L 05/20/2009 - 08:16:38: String formatted incorrectly - parameter 2 (total 1)
L 05/20/2009 - 08:16:38: [AMXX] Displaying debug trace (plugin "anti_cheat.amxx")
L 05/20/2009 - 08:16:38: [AMXX] Run time error 25: parameter error

don't tell me just using the hlg_xxx.cfg..
sorry for my poor english..

-=hunter=- 05-19-2009 02:59

Re: many " in one line
 
use register_srvcmd
Code:

register_srvcmd ( const server_cmd[],const function[],flags=-1, info[]="" )

biscuit628 05-20-2009 06:33

Re: many " in one line
 
Quote:

Originally Posted by -=hunter=- (Post 830320)
use register_srvcmd
Code:

register_srvcmd ( const server_cmd[],const function[],flags=-1, info[]="" )

i think that isn't work for me in this case

minimiller 05-20-2009 08:15

Re: multi " in one line
 
what are you trying to do?

Bugsy 05-20-2009 10:11

Re: multi " in one line
 
It looks like you are trying to pass variables into the string but you do not specify the variables.

Try to stick to these:
Code:

%s - String
%f - Floating point number
%d - Integer

PHP Code:

// %n and %i
server_cmd("hlg_action ^"u:found^" ^"hlg_say [HLGViolation by %n(%idetected^"" variable1 variable2 )

// %y
server_cmd("hlg_action ^"u:found^" ^"hlg_say [HLGViolation: %y^"" variable1 )

server_cmd("hlg_action ^"u:found^" ^"hlg_say [HLGPunishmentban^"" )

// %u
server_cmd("hlg_action ^"u:found^" ^"amx_banip #%u 0^"" , variable1 ) 


biscuit628 05-20-2009 11:21

Re: multi " in one line
 
1 Attachment(s)
Quote:

Originally Posted by Bugsy (Post 831053)
It looks like you are trying to pass variables into the string but you do not specify the variables.

Try to stick to these:
Code:

%s - String
%f - Floating point number
%d - Integer

.....


thank,and i also know that..i try already..it's not work
PHP Code:

public hlg_check()
{
    for( new 
id 0id <= g_MaxPlayersid++ ) 
    {
    new 
name[33],ip[17]
    
get_user_name(id,name,32)
    
get_user_ip(id,ip,16)
   
server_cmd("hlg_action ^"u:found^" ^"hlg_say [HLGViolation by %s(%sdetected^"",name,ip)
   
server_cmd("hlg_action ^"u:found^" ^"hlg_say [HLGViolationSomething^"")
   
server_cmd("hlg_action ^"u:found^" ^"hlg_say [HLGPunishmentban^"")
   
server_cmd("hlg_action ^"u:found^" ^"amx_banip #%d 0^"",get_user_userid(id))
   
}


but the hlg file also setting like that


All times are GMT -4. The time now is 01:29.

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