AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   tag mismatch but why oO (https://forums.alliedmods.net/showthread.php?t=63052)

SchlumPF* 11-10-2007 15:51

tag mismatch but why oO
 
i use this code to show my top10 but i dont know why it doesnt work :( i use the code to get the time several times in my plugin without any problems. pls help me xD

PHP Code:

public topten_show(id) {
    new 
motd[2048]
    new 
szvault[64], szmap[32]
    
get_mapname(szmap,32)
    
format(szvault,64,"pk_%s",szmap)
    
    new 
vault nvault_open(szvault)
    if(
vault != -1) {
        
add(motd,2048,"<html><head><style>");
        
add(motd,2048,"body { background-color:#000000; font-family:Tahoma; font-size:10px; color:#FFFFFF; }")
        
add(motd,2048,".tabel { border-style:solid; border-width:1px; border-color:#FFFFFF; font-family:Tahoma; font-size:10px; color:#FFFFFF; }")
        
add(motd,2048,".header { background-color:#292929; font-family:Tahoma; font-size:10px; color:#FFFFFF; font-weight:800; }")
        
add(motd,2048,"</style></head><body>")
        
add(motd,2048,"<br><br><table border=0 cellspacing=0 cellpadding=1 width=90% align=center class=tabel>")
        
        
add(motd,2048,"<tr><td class=header>#</td><td class=header>Name</td><td class=header>Time</td><td class=header>Checkpoints</td></tr>")
        new 
szkey[8]
        for(new 
i=1;i<=10;i++) {
            new 
szreturn[162]
            
format(szkey,8,"%d",i)
            
nvault_get(vault,szkey,szreturn,162)
            
            new 
arg1[32], arg2[8], arg3[8], arg4[34]
            if(
parse(szreturn,arg1,32,arg2,8,arg3,8,arg4,34) != 0) {
                new 
sztime[32], imin
                
new kreedztime str_to_float(arg2)
                if((
kreedztime 60.0) >= 1) {  //  <--- tag mismatch oO
                    
imin floatround(kreedztime 60.0,floatround_floor)
                    
kreedztime -= imin 60
                
}
                
                
format(sztime,32,"%d:%f",imin,kreedztime)
                
add(motd,2048,"<tr><td>")
                
add(motd,2048,szkey)
                
add(motd,2048,"</td><td>")
                
add(motd,2048,arg1)
                
add(motd,2048,"</td><td>")
                
add(motd,2048,sztime)
                
add(motd,2048,"</td><td>")
                
add(motd,2048,arg3)
                
add(motd,2048,"</td></tr>")
            }
        }
        
        
nvault_close(vault)
        
        
add(motd,2048,"</table></body></html>")
        
show_motd(id,motd,"ProKreedz Top10")
    }



Arkshine 11-10-2007 15:56

Re: tag mismatch but why oO
 
Code:
new kreedztime = str_to_float(arg2)
to

Code:
new Float:kreedztime = str_to_float(arg2)

Alka 11-10-2007 15:58

Re: tag mismatch but why oO
 
lol ?!
Code:

new kreedztime = str_to_float(arg2)
duh...kreedztime must be a float.
Code:

new Float:kreedztime = str_to_float(arg2)
:)

@arkshine - o.O damn!

SchlumPF* 11-10-2007 16:01

Re: tag mismatch but why oO
 
xD bad mistake xD thx ^^


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

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