AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Solved Image in /top15 (https://forums.alliedmods.net/showthread.php?t=307710)

karimoo97 05-21-2018 19:58

Image in /top15
 
HELLO everyone I hope you are doing well
I want to edit the /top15 of the plugin I use (Basic SkillPoints[FVault])

Request 1: Show 15 players instead of 10.
Spoiler


Request 2: Add an image on top.

I have seen a server that uses a costum version of this plugin that has an image on top of the motd as you you will see below :



Of course I tried doing it myself [i'm a noob] by adding this
Spoiler


to the (what I think is the code of /top15)
Spoiler


It didn't work of course :nono::stupid:
Is it because:
1- I did it wrong.
2- They are using the SQL version (LINK) while I'm using the fvault one ?
I'm pretty it's because of reason 1,I know that it is possible to use images in motd
.
.
.
.
.
Extra questions if it's doable :
1- Can I use a GIF image ? (animated)
2- what is the ma size of the image ?
3- Can I use more then one ? eg:one on top with my server name and one below with some info (ranks will be reset XX/XX/XX at XX:YY....)

THANK YOU VERY MUCH

GREETINGS


EDIT:
Solution :
PHP Code:

<img src=^"TheLinkToYourImage.jpg^" alt=^"Top15^" width=^"100%%^" height=^"100px^">\ 


Natsheh 05-21-2018 20:44

Re: Image in /top15
 
Already been asked search..

Its due motd characters limitation.

If you want to use more than the motd char limit use web page.

karimoo97 05-21-2018 23:43

Re: Image in /top15
 
Quote:

Originally Posted by Natsheh (Post 2593201)
Already been asked search..

Its due motd characters limitation.

If you want to use more than the motd char limit use web page.

So there is a character limitation,good to know


I didn't find any topic related to using an image in top15 via the sma of a plugin,HELP please

Natsheh 05-21-2018 23:58

Re: Image in /top15
 
Use sql to send to ur web server data about ur top15 list and then display it on ur web

karimoo97 05-22-2018 00:15

Re: Image in /top15
 
I don't mean to be rude bro but did you even read the thread ?


tarsisd2 05-22-2018 08:59

Re: Image in /top15
 
Quote:

1- Can I use a GIF image ? (animated)
Yes you can, with few frames or it won't show properly

edit: size it will depend on players resolution, to big, it will be longer to load, or it won't show!

Natsheh 05-22-2018 09:48

Re: Image in /top15
 
Quote:

Originally Posted by karimoo97 (Post 2593217)

Well i was referring to request one.


PHP Code:

<body>
<
img src="img.jpg" alt="Top15" width="100%%" height="100px">
</
body

Btw your request has nothing to do with pawn language.

karimoo97 05-22-2018 21:52

Re: Image in /top15
 
Quote:

Originally Posted by Natsheh (Post 2593303)
Well i was referring to request one.

I don't know what you are talking about,sorry

Quote:

Originally Posted by Natsheh (Post 2593303)
PHP Code:

<body>
<
img src="img.jpg" alt="Top15" width="100%%" height="100px">
</
body

Btw your request has nothing to do with pawn language.

This should be HTML ?
Thank you very much for your help,please tell me where do I put it ? is this ok ?

PHP Code:

public TopSkillid 

    if( !
get_pcvar_numg_iEnableSkillPointsTop15 ) ) 
    { 
        
ClientPrintColorid"!g%s!n Command disabled"PREFIX 
    } 
     
    else 
    { 
        
show_motdidg_szMotd"TOP 15" 
    } 
     
    return ( 
get_pcvar_numg_iHideCmds ) == ) ? PLUGIN_CONTINUE PLUGIN_HANDLED_MAIN 


public 
MakeTop15( ) 

    new 
iLen 
    iLen 
formatexg_szMotdcharsmaxg_szMotd ), 
    
"<body bgcolor=#A4BED6>\ 
    <body><img src="
img.jpg" alt="Top15" width="100%%" height="100px"></body> // <-- here ? and should I remove /body ?
    <table width=100%% cellpadding=2 cellspacing=0 border=0>\ 
    <tr align=center bgcolor=#52697B>\ 
    <th width=4%%>#\ 
    <th width=30%% align=left>Player\ 
    <th width=8%%>Kills\ 
    <th width=8%%>Deaths\ 
    <th width=8%%>HS\ 
    <th width=8%%>Knife\ 
    <th width=8%%>Grenade\ 
    <th width=8%%>Bombs\ 
    <th width=8%%>Defuses\ 
    <th width=10%>SkillPoints" 

     
    new Array:
aKey ArrayCreate35 
    new Array:
aData ArrayCreate128 
    new Array:
aAll ArrayCreateFvaultData 
     
    
fvault_loadg_VaultSkillPointsaKeyaData 
     
    new 
iArraySize ArraySizeaKey 
     
    new 
DataFvaultData 
     
    new 

    
for( 0iArraySizei++ ) 
    { 
        
ArrayGetStringaKeyiDataszSteamID ], sizeof DataszSteamID ] - 
        
ArrayGetStringaDataiDataszSkillP_Data ], sizeof DataszSkillP_Data ] - 
         
        
ArrayPushArrayaAllData 
    } 
     
    
ArraySortaAll"SortData" 
     
    new 
szPlayerPoints
    new 
szPlayerLevel
     
    new 
szPlayerKills
    new 
szPlayerDeahts
    new 
szPlayerHeadShots
    new 
szPlayerKnifeKills
    new 
szPlayerKnifeDeaths
    new 
szPlayerGrenadeKills
    new 
szPlayerGrenadeDeaths
    new 
szPlayerBombExplosions
    new 
szPlayerDefusedBombs
    new 
szPlayerWonRounds
     
    new 
szName22 
    new 
iSize clampiArraySize012 
     
    new 

    
for( 0iSizej++ ) 
    { 
        
ArrayGetArrayaAlljData 
         
        
fvault_get_datag_VaultNamesDataszSteamID ], szNamecharsmaxszName ) ) 
         
        
replace_allszNamecharsmaxszName ), "<""[" 
        
replace_allszNamecharsmaxszName ), ">""]" 
         
        
parseDataszSkillP_Data ], 
        
szPlayerPointscharsmaxszPlayerPoints ), 
        
szPlayerLevelcharsmaxszPlayerLevel ), 
         
        
szPlayerKillscharsmaxszPlayerKills ), 
        
szPlayerDeahtscharsmaxszPlayerDeahts ), 
        
szPlayerHeadShotscharsmaxszPlayerHeadShots ), 
        
szPlayerKnifeKillscharsmaxszPlayerKnifeKills ), 
        
szPlayerKnifeDeathscharsmaxszPlayerKnifeDeaths ), 
        
szPlayerGrenadeKillscharsmaxszPlayerGrenadeKills ), 
        
szPlayerGrenadeDeathscharsmaxszPlayerGrenadeDeaths ), 
        
szPlayerBombExplosionscharsmaxszPlayerBombExplosions ), 
        
szPlayerDefusedBombscharsmaxszPlayerDefusedBombs ), 
        
szPlayerWonRoundscharsmaxszPlayerWonRounds ) ) 
         
        
iLen += formatexg_szMotdiLen ], charsmaxg_szMotd ) - iLen"<tr align=center>" 
        
iLen += formatexg_szMotdiLen ], charsmaxg_szMotd ) - iLen"<td>%i"
        
iLen += formatexg_szMotdiLen ], charsmaxg_szMotd ) - iLen"<td align=left>%s"szName 
        
iLen += formatexg_szMotdiLen ], charsmaxg_szMotd ) - iLen"<td>%s"szPlayerKills 
        
iLen += formatexg_szMotdiLen ], charsmaxg_szMotd ) - iLen"<td>%s"szPlayerDeahts 
        
iLen += formatexg_szMotdiLen ], charsmaxg_szMotd ) - iLen"<td>%s"szPlayerHeadShots 
        
iLen += formatexg_szMotdiLen ], charsmaxg_szMotd ) - iLen"<td>%s"szPlayerKnifeKills 
        
iLen += formatexg_szMotdiLen ], charsmaxg_szMotd ) - iLen"<td>%s"szPlayerGrenadeKills 
        
iLen += formatexg_szMotdiLen ], charsmaxg_szMotd ) - iLen"<td>%s"szPlayerBombExplosions 
        
iLen += formatexg_szMotdiLen ], charsmaxg_szMotd ) - iLen"<td>%s"szPlayerDefusedBombs 
        
iLen += formatexg_szMotdiLen ], charsmaxg_szMotd ) - iLen"<td>%s"szPlayerPoints 
    } 
     
    
iLen += formatexg_szMotdiLen ], charsmaxg_szMotd ) - iLen"</table></body>" 
     
    
ArrayDestroyaKey 
    
ArrayDestroyaData 
    
ArrayDestroyaAll 



Natsheh 05-22-2018 22:14

Re: Image in /top15
 
Remove the body tag and add at the last of the line this \

And add this before each quote ^

karimoo97 05-22-2018 22:53

Re: Image in /top15
 
Like this ?

PHP Code:

public TopSkillid )  
{  
    if( !
get_pcvar_numg_iEnableSkillPointsTop15 ) )  
    {  
        
ClientPrintColorid"!g%s!n Command disabled"PREFIX )  
    }  
      
    else  
    {  
        
show_motdidg_szMotd"TOP 15" )  
    }  
      
    return ( 
get_pcvar_numg_iHideCmds ) == ) ? PLUGIN_CONTINUE PLUGIN_HANDLED_MAIN  
}  

public 
MakeTop15( )  
{  
    new 
iLen  
    iLen 
formatexg_szMotdcharsmaxg_szMotd ),  
    
"<body bgcolor=#A4BED6>\  
    <img ^src="
TheLinkToMyImage.jpg" ^alt="Top15" ^width="100%%" ^height="100px">\
    <table width=100%% cellpadding=2 cellspacing=0 border=0>\  
    <tr align=center bgcolor=#52697B>\  
    <th width=4%%>#\  
    <th width=30%% align=left>Player\  
    <th width=8%%>Kills\  
    <th width=8%%>Deaths\  
    <th width=8%%>HS\  
    <th width=8%%>Knife\  
    <th width=8%%>Grenade\  
    <th width=8%%>Bombs\  
    <th width=8%%>Defuses\  
    <th width=10%>SkillPoints" 
)  
      
    new Array:
aKey ArrayCreate35 )  
    new Array:
aData ArrayCreate128 )  
    new Array:
aAll ArrayCreateFvaultData )  
      
    
fvault_loadg_VaultSkillPointsaKeyaData )  
      
    new 
iArraySize ArraySizeaKey )  
      
    new 
DataFvaultData ]  
      
    new 
i  
    
for( 0iArraySizei++ )  
    {  
        
ArrayGetStringaKeyiDataszSteamID ], sizeof DataszSteamID ] - )  
        
ArrayGetStringaDataiDataszSkillP_Data ], sizeof DataszSkillP_Data ] - )  
          
        
ArrayPushArrayaAllData )  
    }  
      
    
ArraySortaAll"SortData" )  
      
    new 
szPlayerPoints]  
    new 
szPlayerLevel]  
      
    new 
szPlayerKills]  
    new 
szPlayerDeahts]  
    new 
szPlayerHeadShots]  
    new 
szPlayerKnifeKills]  
    new 
szPlayerKnifeDeaths]  
    new 
szPlayerGrenadeKills]  
    new 
szPlayerGrenadeDeaths]  
    new 
szPlayerBombExplosions]  
    new 
szPlayerDefusedBombs]  
    new 
szPlayerWonRounds]  
      
    new 
szName22 ]  
    new 
iSize clampiArraySize012 )  
      
    new 
j  
    
for( 0iSizej++ )  
    {  
        
ArrayGetArrayaAlljData )  
          
        
fvault_get_datag_VaultNamesDataszSteamID ], szNamecharsmaxszName ) )  
          
        
replace_allszNamecharsmaxszName ), "<""[" )  
        
replace_allszNamecharsmaxszName ), ">""]" )  
          
        
parseDataszSkillP_Data ],  
        
szPlayerPointscharsmaxszPlayerPoints ),  
        
szPlayerLevelcharsmaxszPlayerLevel ),  
          
        
szPlayerKillscharsmaxszPlayerKills ),  
        
szPlayerDeahtscharsmaxszPlayerDeahts ),  
        
szPlayerHeadShotscharsmaxszPlayerHeadShots ),  
        
szPlayerKnifeKillscharsmaxszPlayerKnifeKills ),  
        
szPlayerKnifeDeathscharsmaxszPlayerKnifeDeaths ),  
        
szPlayerGrenadeKillscharsmaxszPlayerGrenadeKills ),  
        
szPlayerGrenadeDeathscharsmaxszPlayerGrenadeDeaths ),  
        
szPlayerBombExplosionscharsmaxszPlayerBombExplosions ),  
        
szPlayerDefusedBombscharsmaxszPlayerDefusedBombs ),  
        
szPlayerWonRoundscharsmaxszPlayerWonRounds ) )  
          
        
iLen += formatexg_szMotdiLen ], charsmaxg_szMotd ) - iLen"<tr align=center>" )  
        
iLen += formatexg_szMotdiLen ], charsmaxg_szMotd ) - iLen"<td>%i")  
        
iLen += formatexg_szMotdiLen ], charsmaxg_szMotd ) - iLen"<td align=left>%s"szName )  
        
iLen += formatexg_szMotdiLen ], charsmaxg_szMotd ) - iLen"<td>%s"szPlayerKills )  
        
iLen += formatexg_szMotdiLen ], charsmaxg_szMotd ) - iLen"<td>%s"szPlayerDeahts )  
        
iLen += formatexg_szMotdiLen ], charsmaxg_szMotd ) - iLen"<td>%s"szPlayerHeadShots )  
        
iLen += formatexg_szMotdiLen ], charsmaxg_szMotd ) - iLen"<td>%s"szPlayerKnifeKills )  
        
iLen += formatexg_szMotdiLen ], charsmaxg_szMotd ) - iLen"<td>%s"szPlayerGrenadeKills )  
        
iLen += formatexg_szMotdiLen ], charsmaxg_szMotd ) - iLen"<td>%s"szPlayerBombExplosions )  
        
iLen += formatexg_szMotdiLen ], charsmaxg_szMotd ) - iLen"<td>%s"szPlayerDefusedBombs )  
        
iLen += formatexg_szMotdiLen ], charsmaxg_szMotd ) - iLen"<td>%s"szPlayerPoints )  
    }  
      
    
iLen += formatexg_szMotdiLen ], charsmaxg_szMotd ) - iLen"</table></body>" )  
      
    
ArrayDestroyaKey )  
    
ArrayDestroyaData )  
    
ArrayDestroyaAll )  




All times are GMT -4. The time now is 10:14.

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