AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   String formatted incorrectly - parameter 4 (total 3) (https://forums.alliedmods.net/showthread.php?t=162098)

gamer99 07-15-2011 00:55

String formatted incorrectly - parameter 4 (total 3)
 
while formating

format(sArgvAll,127,sArgvAll[1])

I am getting this error ...what could be the possible reason ?

the full errot is given below .


L 07/14/2011 - 19:05:35: String formatted incorrectly - parameter 4 (total 3)
L 07/14/2011 - 19:05:35: [AMXX] Displaying debug trace (plugin "alias.amxx")
L 07/14/2011 - 19:05:35: [AMXX] Run time error 25: parameter error
L 07/14/2011 - 19:05:35: [AMXX] [0] TP_aim.sma::client_command (line 64)
L 07/14/2011 - 20:05:45: Start of error session.

^SmileY 07-15-2011 01:05

Re: String formatted incorrectly - parameter 4 (total 3)
 
Quote:

Originally Posted by gamer99 (Post 1510940)
while formating

format(sArgvAll,127,sArgvAll[1])

I am getting this error ...what could be the possible reason ?

the full errot is given below .


L 07/14/2011 - 19:05:35: String formatted incorrectly - parameter 4 (total 3)
L 07/14/2011 - 19:05:35: [AMXX] Displaying debug trace (plugin "alias.amxx")
L 07/14/2011 - 19:05:35: [AMXX] Run time error 25: parameter error
L 07/14/2011 - 19:05:35: [AMXX] [0] TP_aim.sma::client_command (line 64)
L 07/14/2011 - 20:05:45: Start of error session.

Show the code of plugin :grrr:

Exolent[jNr] 07-15-2011 01:18

Re: String formatted incorrectly - parameter 4 (total 3)
 
Use copy() for that.

gamer99 07-15-2011 02:05

Re: String formatted incorrectly - parameter 4 (total 3)
 
it is inside client_command
Quote:


if(equal(sArgv,"say")||equal(sArgv,"say_team" ))
{
new iMessages=get_pcvar_num(g_dCvarMessages)
if(iMessages > 0)
{
new sArgv[64],sArgvAll[128],sBuffer[64],sBanReason[64],dLen
new dArgc=read_argc()

for(new i=1;i<dArgc;i++)
{
read_argv(i,sArgv,63)
format(sArgvAll,127,"%s %s",sArgvAll,sArgv)
}

format(sArgvAll,127,sArgvAll[1])

new dSize=ArraySize(g_sMessages)

for(new i;i<dSize;i++)
{
ArrayGetString(g_sMessages,i,sBuffer,63)

dLen=strlen(sBuffer)

if(sBuffer[0]=='['&&sBuffer[dLen-1]==']')
{
format(sBanReason,dLen-2,sBuffer[1])
continue
}
else
{
if(containi(sArgvAll,sBuffer)!=-1)
{
if(g_dPlayerStatus[id]==true)
{
//ban messages

new iBanTime=get_pcvar_num(g_dCvarMessagesBanTime )
ban(id,iMessages,sBanReason,iBanTime)

}
return PLUGIN_HANDLED
}
}
}
}
}

Exolent[jNr] 07-15-2011 09:16

Re: String formatted incorrectly - parameter 4 (total 3)
 
Quote:

Originally Posted by Exolent[jNr] (Post 1510946)
Use copy() for that.


gamer99 07-15-2011 11:45

Re: String formatted incorrectly - parameter 4 (total 3)
 
can u show me how to ue copy() ? i never used it :(

Erox902 07-15-2011 11:47

Re: String formatted incorrectly - parameter 4 (total 3)
 
http://www.amxmodx.org/funcwiki.php?go=func&id=55

gamer99 07-15-2011 17:40

Re: String formatted incorrectly - parameter 4 (total 3)
 
thanks Exolent[jNr] and Erox902 the problem got resolved :D


All times are GMT -4. The time now is 00:46.

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