Raised This Month: $ Target: $400
 0% 

Extend Caller


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 11-05-2005 , 21:41  
Reply With Quote #1

I noticed some error in my code, and also documented it

Code:
#include <amxmodx> // Stores the amount of votes new votes; // Tells whether or not timeleft thing has already been done new bool:switchy; public plugin_init() {     register_plugin("NS Combat Extender","1.0","semaja2");         // Catches when someone says anything     register_clcmd("say","Hook_Say");         // cvars     register_cvar("amx_extend","1");     register_cvar("amx_extend_votes","5");         // sets task for checking timeleft     set_task(5.0,"check_tl"); } public Hook_Say(id) {     // if extend off, stop     if(!get_cvar_num("amx_extend"))         return 0;             // reads what the person said     new arg[128];     read_argv(1,arg,127);         // if it contains "extend", increase votes     if(containi(arg,"extend") != -1)         votes++;             client_print(id,print_chat,"You have voted to extend the map.");         return 0; } public check_tl() {     if(!get_cvar_num("amx_extend") || switchy)         return 0;             // get timeleft     new timeleft = get_timeleft();         if(timeleft <= 300 && votes >= get_cvar_num("amx_extend_votes"))     {         // timeleft stuff said now         switchy = true;                 // place your voting stuff here         // whatever vote stuff     }     else     {         // if that stuff above doesn't happen, then check again in 5 seconds         set_task(5.0,"check_tl");     }         return 0; }
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
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 23:37.


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