←  [RSS] Pluginy

AMXX.pl: Support AMX Mod X i SourceMod

»

[ANY] Welcome [Final]

Adminek AMXX.PL - zdjęcie Adminek AMXX.PL 23.06.2012

Welcome v2.0

IntroductionWelcomes users to your server with; now supports Colors, and hooks!ConVarssm_Join_Message - Sets the message to display when users join the server.RequirementsSourceMod v1.4.3Colors.inc (Needed to compile)InstallationCopy the .SMX file into your plugins directory (./addons/sourcemod/plugins/)SourceI'm providing the source so users can tell me what needs to be fixed/what can be done better. Code: #pragma semicolon 1#include #include new Handle:sm_Join_Message = INVALID_HANDLE;new String:Message[128];public Plugin:myinfo ={ name = "Welcome", author = "Hunter S. Thompson", description = "My First Plugin - Displays a welcome message when the user joins.", version = "1.0.0.0", url = "http://forums.alliedmods.net/showthread.php?t=187975"};public OnPluginStart(){ sm_Join_Message = CreateConVar("sm_join_message", "Welcome %N, to Conflagration Deathrun!", "Default Join Message", FCVAR_NOTIFY); AutoExecConfig(true, "onJoin"); HookEvent("player_activate", Player_Activated, EventHookMode_Post);}public Action:Player_Activated(Handle:event, const String:name[], bool:dontBroadcast){ new client = GetClientOfUserId(GetEventInt(event, "userid")); CreateTimer(4.0, Timer_Welcome, client, TIMER_FLAG_NO_MAPCHANGE);}public Action:Timer_Welcome(Handle:timer, any:client){ if (IsClientConnected(client) && IsClientInGame(client)) { GetConVarString(sm_Join_Message, Message, sizeof(Message)); CPrintToChat(client, Message, client); }}Credits
  • TheTwistedPanda
  • PowerLord
  • Mitchell
  • Minimoney1
This is my first plugin, so please feel free to scrutinize, and tell me what needs to be done/what can be done better. Attached Files Dołączona grafika Get Plugin or Get Source (Welcome.sp - 1.1 KB) Dołączona grafika Welcome.smx (5.3 KB)

Wyświetl pełny artykuł
Odpowiedz