Raised This Month: $ Target: $400
 0% 

Change plugin vip


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
krystann
Junior Member
Join Date: Mar 2012
Location: Romania - Cluj
Old 08-25-2012 , 07:55   Change plugin vip
Reply With Quote #1

What is wrong with this plugin?
Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plugin"
#define VERSION "1.0"
#define AUTHOR "Author"


public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_clcmd("say /vip", "Motd");
	RegisterHam(Ham_Spawn, "player", "Spawn", 1);
}

public_Spawn(id) {
	new GetFlags = get_user_flags(id);
	
	if(is_user_alive(id)) {
		if((GetFlags & (ADMIN_LEVEL_F)) == ((ADMIN_LEVEL_F)) {
		         set_task(0.5, "iScoreBoard", id + 6969)
		         set_task(1.0, "give", id)

	         }
         }
}

public iScoreBoard(tID) {
	new id = tID - 6969
	
	message_begin(MSG_ALL, get_user_msgid("ScoreAttrib"));
	write_byte(id);
	write_byte(4);
	message_end();
}

public give(id) {
set_user_health(id, 150);
	cs_set_user_armor(id, 150, CS_ARMOR_VESTHELM);
	give_item(id, "weapon_hegrenade");
	give_item(id, "weapon_flashbang");
	give_item(id, "weapon_smokegrenade");
	cs_set_user_bpammo(id, CSW_FLASHBANG, 3);
	cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 3);
}

public Motd(id) {
	new iCfgDir[32], iFile[192];
	
	get_configsdir(iCfgDir, charsmax(iCfgDir));
	formatex(iFile, charsmax(iFile), "%s/vip.html", iCfgDir);

	show_motd(id, iFile, gTitle);
}
Receive error child
I want to explain / show what you modified to be child
krystann is offline
Torge
Veteran Member
Join Date: Oct 2011
Old 08-25-2012 , 09:01   Re: Change plugin vip
Reply With Quote #2

Try this, you forgot to add 'cstrike' 'fun' and 'hamsandwich'.
By the way, you can ignore loose identation:

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

#include <amxmodx>
#include <cstrike>
#include <fun>
#include <hamsandwich>
#include <amxmisc>

#define PLUGIN "New Plugin"
#define VERSION "1.0"
#define AUTHOR "Author"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /vip""Motd");
    
RegisterHam(Ham_Spawn"player""Spawn"1);
}

public 
Spawn(id) {
    new 
GetFlags get_user_flags(id);
    
    if(
is_user_alive(id)) {
        if (
GetFlags ADMIN_LEVEL_F) {
                 
set_task(0.5"iScoreBoard"id 6969)
                 
set_task(1.0"give"id)

             }
         }
}

public 
iScoreBoard(tID) {
    new 
id tID 6969
    
    message_begin
(MSG_ALLget_user_msgid("ScoreAttrib"));
    
write_byte(id);
    
write_byte(4);
    
message_end();
}

public 
give(id) {
set_user_health(id150);
    
cs_set_user_armor(id150CS_ARMOR_VESTHELM);
    
give_item(id"weapon_hegrenade");
    
give_item(id"weapon_flashbang");
    
give_item(id"weapon_smokegrenade");
    
cs_set_user_bpammo(idCSW_FLASHBANG3);
    
cs_set_user_bpammo(idCSW_SMOKEGRENADE3);
}

public 
Motd(id) {
    new 
iCfgDir[32], iFile[192];
    
    
get_configsdir(iCfgDircharsmax(iCfgDir));
    
formatex(iFilecharsmax(iFile), "%s/vip.html"iCfgDir);

    
show_motd(idiFile"Your title");


Last edited by Torge; 08-25-2012 at 09:59.
Torge is offline
krystann
Junior Member
Join Date: Mar 2012
Location: Romania - Cluj
Old 08-25-2012 , 15:17   Re: Change plugin vip
Reply With Quote #3

Thank you for this code.
krystann 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 03:20.


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