| closedMy very first plaugin! NOT! :( |
| Started by Lt.Gordon on 05-09-2010, 09:01 AM |
Threads: 2
Joined: Apr 2010
This plugin is supposed to greet players as they join a team. I'm pretty sure that there is nothing write in here. Some help? Please!?rnrnrn/* Plugin generated by AMXX-Studio */rnrn#include <amxmodx>rn#include <amxmisc>rn#include <dodfun> //This is for "dod_get_pl_teamname"rn#include <dodx> //This is for "#Define ALLIES 1"rnrn#define PLUGIN "Team Greeter"rn#define VERSION "1.0"rn#define AUTHOR "Lt.Gordon"rnrn#define ALLIES "1"rn#define AXIS "2"rnrnrnpublic plugin_init() {rn register_plugin(PLUGIN, VERSION, AUTHOR)rn rn // Add your code here...rn}rn{rn if (dod_get_pl_teamname(plteam == 1) // I want this to get the name of the players team.rn print("Welcome to the Allied Powers soldier!") //If the team is "1"(allies) than say...rn else rn print("Welcome to the Axis Powers soldier!") //If it's not (axis) than say...rn}
Threads: 3
Joined: Aug 2007
I wrote one up quickly for you:rnrn
#include <amxmodx>rnrnpublic plugin_init()rn{rn register_clcmd("jointeam", "cmdJoinTeam")rn}rnrnpublic cmdJoinTeam(id)rn{rn new szArg[2]rn read_argv(1, szArg, charsmax(szArg))rn new iTeam = str_to_num(szArg)rn rn switch(iTeam)rn {rn case 1: client_print(id, print_chat, "Welcome to the Allied Powers soldier!")rn case 2: client_print(id, print_chat, "Welcome to the Axis Powers soldier!")rn }rn}rnThreads: 2
Joined: Apr 2010
Wow I was so lost making that. I'm trying to learn the PAWN language but there are also DOD commands you have to learn to. Thanks for correccting me!
Threads: 75
Joined: Nov 2007
Gordon get to know what a forward is, and what a native is, and do alot of test prints so you can see what happens. You are on your way. And remember that are more ways to do stuff... In this case i would do like this :rnrnrn
#include <amxmodx>rn#include <dodx>rnrn#define PLUGIN "New Plug-In"rn#define VERSION "1.0 by Dr.G"rn#define AUTHOR "AMXX DoD Team"rnrnrnpublic plugin_init() rn{rn register_plugin(PLUGIN, VERSION, AUTHOR)rn rn // Add your code here...rn}rnrnpublic dod_client_changeteam(id, team, oldteam)rn{rn switch(team) rn { rn case 1: client_print(id, print_chat, "Welcome to the Allied Powers soldier!") rn rn case 2: client_print(id, print_chat, "Welcome to the Axis Powers soldier!") rn rn }rn}Threads: 75
Joined: Nov 2007

