Raised This Month: $32 Target: $400
 8% 

2-Part Beginner Scripting Tutorial [REVISED]


Post New Thread Reply   
 
Thread Tools Display Modes
PvtSmithFSSF
Senior Member
Join Date: Jul 2008
Old 10-04-2008 , 12:53   Re: New to scripting? This will get you started.
Reply With Quote #21

What other tutorials? I don't plan on making one about menus because there already is a great one by Emp`. If you need extra help, PM me.
PvtSmithFSSF is offline
Churchboy587
BANNED
Join Date: Oct 2008
Old 10-09-2008 , 20:43   Re: 2-Part Beginner Scripting Tutorial [REVISED]
Reply With Quote #22

Bloodshot here. Nice tutorial. Umm I need to know how to make a command that gives admins money if they say "money" or "/money"

Last edited by Emp`; 10-10-2008 at 20:04.
Churchboy587 is offline
platEE
Member
Join Date: Jul 2008
Location: Finland, Kuopio
Old 10-10-2008 , 11:39   Re: 2-Part Beginner Scripting Tutorial [REVISED]
Reply With Quote #23

Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>

new const NAME[]    =    "AdminMoney";
new const VERSION[]    =    "1.0";
new const AUTHOR[]    =    "platEE";

new adminmoney

new const MONEY_FLAG = ADMIN_CVAR

public plugin_init() {
    register_plugin(NAME, VERSION, AUTHOR)
    
    register_clcmd("say /money", "cmdMoney", MONEY_FLAG);
    register_clcmd("say money", "cmdMoney", MONEY_FLAG);
    register_clcmd("say_team /money", "cmdMoney", MONEY_FLAG);
    register_clcmd("say_team money", "cmdMoney", MONEY_FLAG);
    
    adminmoney = register_cvar("amx_adminmoney", "16000");
}

public cmdMoney(id, level, cid)
{
    if (!cmd_access(id, level, cid, 3))
    return PLUGIN_HANDLED
    
    cs_set_user_money(id, get_pcvar_num(adminmoney));
    client_print(id, print_chat, "Your money has set to %s", cs_get_user_money(id))
    return PLUGIN_HANDLED;
}
Try this its not tested but compiling fine

+Karma is Appreciated
__________________
ALWAYS leave your name when giving +Karma

Last edited by platEE; 10-10-2008 at 11:46.
platEE is offline
Skeam
New Member
Join Date: Oct 2008
Old 10-18-2008 , 13:53   Re: 2-Part Beginner Scripting Tutorial [REVISED]
Reply With Quote #24

Thanks +karma
Skeam is offline
PvtSmithFSSF
Senior Member
Join Date: Jul 2008
Old 10-18-2008 , 20:58   Re: 2-Part Beginner Scripting Tutorial [REVISED]
Reply With Quote #25

Thanks

ps: karma doesn't affect people until you have 10 posts (or perhaps 5)
PvtSmithFSSF is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 10-19-2008 , 04:00   Re: 2-Part Beginner Scripting Tutorial [REVISED]
Reply With Quote #26

fakemeta way + cleanup code a little
PHP Code:
#include <amxmodx>
#include <fakemeta>

#define PLUGIN    "AdminMoney"
#define VERSION    "1.1"
#define AUTHOR    "platEE / xPaw"

#define MONEY_FLAG ADMIN_CVAR
#define fm_get_user_money(%1) get_pdata_int( %1, 115 )

new g_AdminMoneyg_msgMoney;

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /money",        "cmdMoney");
    
register_clcmd("say money",        "cmdMoney");
    
register_clcmd("say_team /money",    "cmdMoney");
    
register_clcmd("say_team money",    "cmdMoney");
    
    
g_AdminMoney register_cvar("amx_adminmoney""16000");
    
    
g_msgMoney get_user_msgid("Money")
}

public 
cmdMoney(id)
{
    if (
get_user_flags(id) & MONEY_FLAG) {
        
fm_set_user_money(idget_pcvar_num(g_AdminMoney));
        
client_print(idprint_chat"Your money has set to %s"fm_get_user_money(id))
        return 
PLUGIN_HANDLED;
    }
    return 
PLUGIN_HANDLED;
}

public 
fm_set_user_money idi_Money 

    
set_pdata_int id115i_Money ); 
  
    
message_begin MSG_ONEg_msgMoney_id ); 
    
write_long i_Money ); 
    
write_byte ); 
    
message_end (); 

__________________
xPaw is offline
platEE
Member
Join Date: Jul 2008
Location: Finland, Kuopio
Old 10-21-2008 , 02:15   Re: 2-Part Beginner Scripting Tutorial [REVISED]
Reply With Quote #27

Hmm... i shud use
PHP Code:
#define MONEY_FLAG ADMIN_CVAR 
Instead off #include <amxmisc> =)
__________________
ALWAYS leave your name when giving +Karma
platEE is offline
jaaaalot
Senior Member
Join Date: Oct 2008
Old 10-27-2008 , 09:09   Re: 2-Part Beginner Scripting Tutorial [REVISED]
Reply With Quote #28

ty for the tut very help
but how do i make that if someone buy steroids it's say

"nick" , you have just bought steroids!

Example if my name is jaaaalot and i say /steroids

then it's say in chat jaaaalot , you have just bought steroids and you have XXXX $ dollar left

Last edited by jaaaalot; 10-27-2008 at 09:36.
jaaaalot is offline
PvtSmithFSSF
Senior Member
Join Date: Jul 2008
Old 11-13-2008 , 20:41   Re: 2-Part Beginner Scripting Tutorial [REVISED]
Reply With Quote #29

Sorry for the late delay - you can find these easily by searching the forums or checking other simple plugins
But I can find the code if you still need it
PvtSmithFSSF is offline
jaaaalot
Senior Member
Join Date: Oct 2008
Old 11-14-2008 , 17:02   Re: 2-Part Beginner Scripting Tutorial [REVISED]
Reply With Quote #30

done not need it ,this was my first post when i was new scripter ty anyway
jaaaalot is offline
Reply


Thread Tools
Display Modes

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 08:04.


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