Raised This Month: $ Target: $400
 0% 

what's wrong here?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kamikizzle
Member
Join Date: Aug 2004
Old 09-30-2004 , 20:54   what's wrong here?
Reply With Quote #1

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
Kamikizzle is offline
Tauphi
SourceMod Donor
Join Date: Sep 2004
Location: Germany
Old 09-30-2004 , 22:31  
Reply With Quote #2

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 
   } 
}
Tauphi is offline
Send a message via ICQ to Tauphi Send a message via Skype™ to Tauphi
Kamikizzle
Member
Join Date: Aug 2004
Old 10-01-2004 , 17:15  
Reply With Quote #3

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?
Kamikizzle is offline
breaddawson
Senior Member
Join Date: Jul 2004
Location: Beijing,China
Old 10-03-2004 , 11:20  
Reply With Quote #4

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
__________________
i'm bread dawson ,a chinese boy
wish u be happy~
breaddawson is offline
Send a message via ICQ to breaddawson Send a message via MSN to breaddawson
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 17:18.


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