Raised This Month: $ Target: $400
 0% 

Simple Error :(


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
emoD
Junior Member
Join Date: Oct 2007
Old 10-29-2007 , 10:22   Simple Error :(
Reply With Quote #1

Hello, I'm New At AMXX Scripting But I Know C++ Syntax.
I've Tryed To Creat Plugin But There Is Alot Of Errors And I Don't Know What To Do.

Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "DainiusD"
#define MATCH_P 10
new Players[32], Act, I, Player
public plugin_init() {
 register_plugin(PLUGIN, VERSION, AUTHOR)
 
 get_players(Players, Act)
 for (I=0; I<Act; I++)
     Player = Players[I]
     if (Player < MATCH_P) {
      set_hudmessage(0, 255, 0, -1.0, -1.0)
      show_hudmessage(id, "Waiting For Other Players")      
     }
     else if (Player > MATCH_P) {
      set_hudmessage(0, 255, 0, -1.0, -1.0)
      show_hudmessage(id, "Too Many Players On Server")
     }
     else if (Player == Match_P) {
      set_hudmessage(0, 255, 0, -1.0, -1.0)
      show_hudmessage(id, "Players Have Joined Server, Match Starting...")
 }
  return PLUGIN_HANDLED
}
Code:
/home/groups/amxmodx/tmp3/textlReC14.sma(20) : warning 217: loose indentation
/home/groups/amxmodx/tmp3/textlReC14.sma(22) : error 017: undefined symbol "id"
/home/groups/amxmodx/tmp3/textlReC14.sma(22) : warning 215: expression has no effect
/home/groups/amxmodx/tmp3/textlReC14.sma(22) : error 001: expected token: ";", but found ")"
/home/groups/amxmodx/tmp3/textlReC14.sma(22) : error 029: invalid expression, assumed zero
/home/groups/amxmodx/tmp3/textlReC14.sma(22) : fatal error 107: too many error messages on one line

Compilation aborted.
4 Errors.
Srry For My English.
Could Someone Help Me? Thanks.
emoD is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 10-29-2007 , 10:28   Re: Simple Error :(
Reply With Quote #2

I realy don't get the usage of this plugin but nvm...

Code:
#include <amxmodx>
 
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "DainiusD"
 
#define MATCH_P 10
 
new Players[32], Act;
 
public plugin_init() {
 
 register_plugin(PLUGIN, VERSION, AUTHOR)
 
 get_players(Players, Act);
 
 if (Act < MATCH_P) {
  set_hudmessage(0, 255, 0, -1.0, -1.0)
  show_hudmessage(0, "Waiting For Other Players")      
 }
 
 else if (Act > MATCH_P) {
  set_hudmessage(0, 255, 0, -1.0, -1.0)
  show_hudmessage(0, "Too Many Players On Server")
 }
 
 else if (Act == MATCH_P) {
  set_hudmessage(0, 255, 0, -1.0, -1.0)
  show_hudmessage(0, "Players Have Joined Server, Match Starting...")
 }
}
I think you must do a check whenever a player is enter on server, and after that display the messages :s

Note: plugin_init() - is called once, when plugins are initiallyzed(server open / mapchange)
__________________
Still...lovin' . Connor noob! Hello

Last edited by Alka; 10-29-2007 at 10:32.
Alka is offline
emoD
Junior Member
Join Date: Oct 2007
Old 10-29-2007 , 10:32   Re: Simple Error :(
Reply With Quote #3

how to do check?

i need to show message all the time when Players < MATCH_P :S
but dunno how
emoD is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 10-29-2007 , 10:38   Re: Simple Error :(
Reply With Quote #4

Here :

Code:
#include <amxmodx>
 
#define PLUGIN "New Plugin"
#define VERSION "1.0"
#define AUTHOR "emoD"
 
#define MIN_PLAYERS 10
 
public plugin_init() {
 
 register_plugin(PLUGIN, VERSION, AUTHOR);
}
 
public client_putinserver(id)
{
 static Players[32], Num;
 get_players(Players, Num, "ch");
 
 if(Num < MIN_PLAYERS)
 {
  set_hudmessage(0, 255, 0, -1.0, -1.0, 0, 6.0, 5.0, 0.1, 0.1, -1);
  show_hudmessage(id, "! Waiting for other players...");
 }
 else if(Num > MIN_PLAYERS)
 {
  set_hudmessage(0, 255, 0, -1.0, -1.0, 0, 6.0, 5.0, 0.1, 0.1, -1);
  show_hudmessage(id, "! Too many players on server...");
 }
 else if(Num == MIN_PLAYERS)
 {
  set_hudmessage(0, 255, 0, -1.0, -1.0, 0, 6.0, 5.0, 0.1, 0.1, -1);
  show_hudmessage(id, "! Enough players has joined.Match started...");
 }
}
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-29-2007 , 10:55   Re: Simple Error :(
Reply With Quote #5

Probably a little better. I don't like using set_task().

Code:
    #include <amxmodx>           #define MIN_PLAYERS 10     #define MAX_PLAYERS 32         #define LOOP_TIME 2.0                 public plugin_init()     {         register_plugin( "Waiting players", "1.0", "Amxx Community" );                 set_task( LOOP_TIME, "DisplayHUD", 0, _, _, "b" );     }             public DisplayHUD()     {         switch( get_playersnum() )         {             case 1 .. MIN_PLAYERS - 1 :             {                 set_hudmessage( 0, 255, 0, 0.1, 0.5, 0, 6.0, 5.0, 0.1, 0.1, -1 );                 show_hudmessage( 0, "! Waiting for other players..." );             }             case MIN_PLAYERS :             {                 set_hudmessage(0, 255, 0, 0.1, 0.5, 0, 6.0, 5.0, 0.1, 0.1, -1 );                 show_hudmessage( 0, "! Enough players has joined.Match started...");             }             case MIN_PLAYERS + 1 .. MAX_PLAYERS :             {                 set_hudmessage(0, 255, 0, 0.1, 0.5, 0, 6.0, 5.0, 0.1, 0.1, -1 );                 show_hudmessage( 0, "! Too many players on server...");             }             default : return;         }     }
__________________
Arkshine is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 10-29-2007 , 11:09   Re: Simple Error :(
Reply With Quote #6

Quote:
Originally Posted by arkshine View Post
Probably a little better. I don't like using set_task().
, but you use it...
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
emoD
Junior Member
Join Date: Oct 2007
Old 10-29-2007 , 11:06   Re: Simple Error :(
Reply With Quote #7

Many Thanks To You Guys
Finaly Plugin Is Working
emoD is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-29-2007 , 11:15   Re: Simple Error :(
Reply With Quote #8

Yeah. Because I don't want to think too much just for that.
__________________

Last edited by Arkshine; 10-29-2007 at 11:27.
Arkshine is offline
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 01:18.


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