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

plugin fix


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Sp@jk
Member
Join Date: May 2010
Location: Serbia
Old 12-08-2010 , 14:17   plugin fix
Reply With Quote #1

I am a big Noob... Can someone fix plugin to work fine ?

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <ftp>
#include <zombieplague>

#define PLUGIN "ZombiePlagueTracker>"
#define VERSION "1.0"
#define AUTHOR "Sp@jk"

new const file[] = "config.php";

public plugin_init() 
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    set_task(30.0,"takeinfo")
}
public takeinfo()
{
    new data4[128]
    new data3[128]
    new data2[128]
    new data5[128]
    new data1[128]
    new map[41] 
    get_mapname(map,40);
    new maxpl= get_maxplayers();
    new pl = get_playersnum(0);
    new zombies = zp_get_zombie_count();
    new humans = zp_get_human_count();
    formatex(data1,127,"$map = %s",map)
    formatex(data2,127,"$maxpl = %s",maxpl)
    formatex(data3,127,"$pl = %s",pl)
    formatex(data4,127,"$zombies = %s",zombies)
    formatex(data5,127,"$humans = %s",humans)
    delete_file(file);
    write_file(file,"<?php",-1);
    write_file(file,data1,-1);
    write_file(file,data2,-1);
    write_file(file,data3,-1);
    write_file(file,data4,-1);
    write_file(file,data5,-1);
    write_file(file,"
?>",-1);
}
It compiles fine but it's ot working good. The output file looks like this:

Code:
<?php
$map = zm_dust2
$maxpl =  zm_dust2
$pl =  zm_dust2
$zombies =   zm_dust2
$humans =   zm_dust2
?>
Sp@jk is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 12-08-2010 , 15:39   Re: plugin fix
Reply With Quote #2

That's some serious shit. Use normal scripts that can lively grab the data from the server without using any plugins.
__________________
xPaw is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-08-2010 , 15:55   Re: plugin fix
Reply With Quote #3

You're formatting everything as strings, but only the map name is a string and the rest are integers.
See this or this.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Sp@jk
Member
Join Date: May 2010
Location: Serbia
Old 12-08-2010 , 16:06   Re: plugin fix
Reply With Quote #4

thanks it worked I am a big NOOB
Sp@jk 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 15:22.


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