2-Part Beginner Scripting Tutorial [REVISED]
I was really bored last week..So for your enjoyment I made a 2-part tutorial covering the VERY basics of amxx scripting for those new scripters who don't understand how anything works.
I really hope you enjoy them and learn from them. +Karma is appreciated if you like my work. Part I - The Beginning... Code:
/* This is my part one of my first tutorial, meant for people that just cannot learn scripting. Part II - A little more advanced...But still simple. Code:
/* Welcome! This is part II of II in "Beginner Tutorial" in my scripting tutorials series. |
Re: New to scripting? This will get you started.
Some minor corrections
Quote:
wouldnt hurt telling them that they give acces to other powerfull commands/nativs Quote:
Quote:
register_concmd is when someone types something in server or clients console register_srvcmd is when something is typed in the servers console Quote:
Quote:
other stuff* you should tell them that the thing you calld phrases are integers and explain what they do and what they store in this plugin. you should explain that id is storing the first parameter in the function and it contains the players number ho triggerd it in your cases. Exept those stuff it was nice keep it up:up: and sry about my spelling. |
Re: New to scripting? This will get you started.
Trying to make it 100% newb-friendly so calling them 'integers' may confuse )
But cs_get_user_money uses cstrike include, no? |
Re: New to scripting? This will get you started.
wierd was able to compile it whitout it OO
But it dosent hurt to tell them what everything do and how it all work. Leaving some minor details out might confuse them later on. Explaining the integers and what they do in your cases are quite important so they know what they do exactly and how they work. So they dont have to ask if they used it right later on. Think its good calling them integers because when they search for help later on they will easly find it if they used the correct words. But its a nice guide^^ so keep it up as i said:up: |
Re: New to scripting? This will get you started.
Hi, im new to scripting.
very nice tutorial. if possible to make: part.III - building menus. part.IV - how to add commands to menu. thanks :) |
Re: New to scripting? This will get you started.
an error I noticed with part II code is your usage of price, and plugin_on. The way you defined them they are pcvars thus instead of
Code:
if (plugin_on == 1) Code:
if (get_pcvar_num(plugin_on) == 1) Code:
register_cvar("amx_tutorial_plugin", "1") edit: yes do Code:
cs_set_user_money(id, money - get_pcvar_num(price)) Code:
public steroids(id) |
Re: New to scripting? This will get you started.
@ fxfghter thanks for tips, oh and btw i just noticed you said clcmd was when they typed in console.
I thought it was when they typed in chat? What is, if this isn't? @ whyme, read Emp's tutorial about menus. If you can't understand it post here again and I'll try to make a more noob-friendly one. @ g-dog thanks a lot but what do I need to change for price? Change that line to: cs_set_user_money(id, money - (get_pcvar_num(price)) ?? |
Re: New to scripting? This will get you started.
register_clcmd only a client can use it
register_concmd server and client register_srvcmd server only so if you use concmd whit a say cmd the server can trigger it to. So use clcmd for say msgs. When they say something in chat they use say or say_team cmd in the console. |
Re: New to scripting? This will get you started.
Yah that's how I have it :)
|
Re: New to scripting? This will get you started.
just your explanation of it was wrong.
you should update the first post betwin whit the changes. |
All times are GMT -4. The time now is 09:43. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.