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-06-2005 , 08:52  
Reply With Quote #1

Lol sorry, I guess I've been teaching you a bit incorrectly. Yes, that semicolon after votes++ will work, but it is not required.

A lot of scripters put semicolons at the end of functions. I do it because A) I was into C++ before I came here, and B) I want to learn more C++. In C++, semicolons are required.

If you have no intentions of eventually learning C++ or any higher level language (actually, just Java), then don't bother with the semicolons.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
semaja2
Member
Join Date: Aug 2005
Location: Adelaide
Old 11-07-2005 , 04:49  
Reply With Quote #2

yeh i didnt know if semi colons were needed as im learning c++ as well and was getting confused but if you have msn could u add me so we can talk and figure out why my plugin keeps saying "you vote...." whenver they type anything not relating to extend even


Quote:
Originally Posted by Hawk552
Lol sorry, I guess I've been teaching you a bit incorrectly. Yes, that semicolon after votes++ will work, but it is not required.

A lot of scripters put semicolons at the end of functions. I do it because A) I was into C++ before I came here, and B) I want to learn more C++. In C++, semicolons are required.

If you have no intentions of eventually learning C++ or any higher level language (actually, just Java), then don't bother with the semicolons.
semaja2 is offline
Send a message via MSN to semaja2
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 11-07-2005 , 05:44  
Reply With Quote #3

It does? Put in a print after read_argv is done, print out arg.

client_print(id,print_chat,arg);
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
semaja2
Member
Join Date: Aug 2005
Location: Adelaide
Old 11-10-2005 , 01:39  
Reply With Quote #4

Quote:
Originally Posted by Hawk552
It does? Put in a print after read_argv is done, print out arg.

client_print(id,print_chat,arg);
hey i dont quite get what ya mean

PS. sorry about late reply been busy with school
semaja2 is offline
Send a message via MSN to semaja2
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 11-10-2005 , 06:26  
Reply With Quote #5

Like this:

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 and Hawk552");         // Catches when someone says anything     register_clcmd("say","Hook_Say");         // cvars     register_cvar("amx_extend","1");     register_cvar("amx_extend_votes","5");     register_cvar("amx_extend_checktime", "5");     register_cvar("amx_extend_time","5");         // sets task for checking timeleft     set_task(get_cvar_float ( "amx_extend_time" ),"check_tl"); } public Hook_Say(id) {     // if extend off, stop     if(!get_cvar_num("amx_extend") || get_timeleft() > get_cvar_num("amx_extend_time"))         return 0;         // reads what the person said     new arg[128];     read_argv(1,arg,127);         client_print(id,print_chat,arg);         // 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;                 //cmds to extend         new maptime  =  get_cvar_num ( "mp_timeleft" )         set_cvar_num ( "mp_timeleft" , maptime+10 )             }     else     {         // if that stuff above doesn't happen, then check again in 5 seconds         set_task(get_cvar_float ( "amx_extend_checktime" ),"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