Raised This Month: $ Target: $400
 0% 

Eh help array prob :(


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
vbSteve
Junior Member
Join Date: Jun 2006
Old 06-21-2006 , 07:41   Eh help array prob :(
Reply With Quote #1

Eh? How do I make this array to work?
(I'm used to Visual Basic language)


Code:
#include <amxmodx> #include <amxmod> #include <amxmisc> #include <engine> #include <fun> #define PLUGIN "HP Mod" #define VERSION "1.23" #define AUTHOR "mCoDev Systems" #define MAX_PLAYERS 33 new portusCoords[MAX_PLAYERS][3]; // Portus coordinates TO public plugin_init() {     register_clcmd("say /setportus", "setPortus")// Set teleport TO origins     register_clcmd("hpmod_setportus", "setPortus"); // Set teleport TO origins     register_clcmd("say /goportus", "goPortus");    // Teleport the user     register_clcmd("hpmod_goportus", "goPortus");   // Teleport the user } public setPortus(id){     if(is_user_alive(id)){         // Set coordinates TELEPORT_EXIT         get_user_origin(id, portusCoords[id]);         client_print(id, print_chat, "[HP Mod] Set portus to (%i, %i, %i)", portusCoords[id][1], portusCoords[id][2], portusCoords[id][3]);     }         return PLUGIN_HANDLED; } public goPortus(id){     if(is_user_alive(id)){         // Go to teleport coords:         set_user_origin(id, portusCoords[id]);     }     return PLUGIN_HANDLED; }

Code:
C:\Small Compiler>compile amxx_wizard.cpp
Small compiler 2.6.0            Copyright (c) 1997-2004, ITB CompuPhase

amxx_wizard.cpp(233) : error 032: array index out of bounds (variable "portusCoo
rds")

1 Error.
vbSteve is offline
Cheap_Suit
Veteran Member
Join Date: May 2004
Old 06-21-2006 , 07:45  
Reply With Quote #2

Where is that line?

Is MAX_PLAYERS = 33?
__________________
HDD fried, failed to backup files. Sorry folks, just don't have free time anymore. This is goodbye.
Cheap_Suit is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 06-21-2006 , 07:47  
Reply With Quote #3

You need to have the line
#define MAX_PLAYERS 33

after you includes.

[edit] Nope not whole plugin....
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
vbSteve
Junior Member
Join Date: Jun 2006
Old 06-21-2006 , 07:47  
Reply With Quote #4

yeh, 33
sorry didn't inlude the whole code.

> #defile MAX_PLAYERS 33
vbSteve is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 06-21-2006 , 07:49  
Reply With Quote #5

well show us the line where it messes up
its line 233. also show the function around that line.
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
vbSteve
Junior Member
Join Date: Jun 2006
Old 06-21-2006 , 07:53  
Reply With Quote #6

Code:
...
lol dunno if that helps you
vbSteve is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 06-21-2006 , 07:57  
Reply With Quote #7

Doh!

CheapSuit, we missed the mistake in the first post.

Code:
        client_print(id, print_chat, "[HP Mod] Set portus to (%i, %i, %i)", portusCoords[id][1], portusCoords[id][2], portusCoords[id][3]);
should be
Code:
        client_print(id, print_chat, "[HP Mod] Set portus to (%i, %i, %i)", portusCoords[id][0], portusCoords[id][1], portusCoords[id][2]);
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
Cheap_Suit
Veteran Member
Join Date: May 2004
Old 06-21-2006 , 08:00  
Reply With Quote #8

Here's your problem

Code:
 client_print(id, print_chat, "[HP Mod] Set portus to (%i, %i, %i)", portusCoords[id][1], portusCoords[id][2], portusCoords[id][3]); Should be portusCoords[id][0], portusCoords[id][1], portusCoords[id][2]
__________________
HDD fried, failed to backup files. Sorry folks, just don't have free time anymore. This is goodbye.
Cheap_Suit is offline
Cheap_Suit
Veteran Member
Join Date: May 2004
Old 06-21-2006 , 08:00  
Reply With Quote #9

bah u beat me
__________________
HDD fried, failed to backup files. Sorry folks, just don't have free time anymore. This is goodbye.
Cheap_Suit is offline
vbSteve
Junior Member
Join Date: Jun 2006
Old 06-21-2006 , 08:02  
Reply With Quote #10

Eh! Thanks!
vbSteve 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 08:00.


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