AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   what's wrong here? (https://forums.alliedmods.net/showthread.php?t=6412)

Kamikizzle 09-30-2004 20:54

what's wrong here?
 
my code isn't working....it's just to make an motd pop up and open a file.....but it won't open the motd

Code:

/**********************************************
* MapView
* By: Kamikizzle
*
* Commands: ADMIN_ACCESS_A
*  kami_maplist
*
**********************************************/

#include <amxmodx>
#include <amxmisc>
#include <amxconst>
#include <cstrike>

// File
new g_szFileMaps[] = "/addons/amxmodx/configs/maps.htm"

// Registers
public plugin_init()
{
        register_plugin("Maplist","1.0","Kamikizzle")
        register_clcmd("kami_maplist","ClCmd_kami_maplist",ADMIN_MAP,"- Displays all of maps on the server (MOTD)")
}

public ClCmd_kami_maplist(id,lvl,cid)
{
        if( !cmd_access(id,lvl,cid,1) )
        {
        show_motd(id,g_szFileMaps,"Maps On Server")
        return PLUGIN_HANDLED
        }
        else{
        }
}

yes, i kno there r things like this, but i wanna script my own for practice, and it sure seems like i need it :roll: :(

Tauphi 09-30-2004 22:31

try this if u want that everyone can use this command...

Code:

#include <amxmodx>
#include <amxmisc>
#include <amxconst>
#include <cstrike>

public plugin_init() {
  register_plugin("Maplist","1.0","Kamikizzle")
  register_clcmd("kami_maplist","ClCmd_kami_maplist",0,"- Displays all of maps on the server (MOTD)")
}

public ClCmd_kami_maplist(id,lvl,cid) {
  show_motd(id,"addons/amxmodx/configs/maps.htm","Maps On Server")
  return PLUGIN_HANDLED
}

if u want to make it with your rights ...

Code:

#include <amxmodx>
#include <amxmisc>
#include <amxconst>
#include <cstrike>

public plugin_init()
{
  register_plugin("Maplist","1.0","Kamikizzle")
  register_clcmd("kami_maplist","ClCmd_kami_maplist",ADMIN_MAP,"- Displays all of maps on the server (MOTD)")
}

public ClCmd_kami_maplist(id,lvl,cid)
{
  if( !cmd_access(id,lvl,cid,1) )
  {
      return PLUGIN_HANDLED
  }
  else{
    show_motd(id,"addons/amxmodx/configs/maps.htm" ,"Maps On Server")
    return PLUGIN_HANDLED
  }
}


Kamikizzle 10-01-2004 17:15

err...it's closer....i did what u said, and it still had a problem with opening, but then i changed where to put it (i used ../ instead) and it gave the motd w where the file was...how come it won't open the file?

breaddawson 10-03-2004 11:20

if u thins the problem is based on the var "g_szFileMaps"
maybe u should use these to specify the dictionary where u put the file

Quote:

stock get_basedir(name[],len)
return get_localinfo("amxx_basedir",name,len)

stock get_configsdir(name[],len)
return get_localinfo("amxx_configsdir",name,len)

stock get_datadir(name[],len)
return get_localinfo("amxx_datadir",name,len)
and i found them in amxmisc.inc


All times are GMT -4. The time now is 17:18.

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