Raised This Month: $12 Target: $400
 3% 

Filling a double dimensional array


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Depresie
Veteran Member
Join Date: Nov 2013
Old 06-23-2017 , 09:29   Filling a double dimensional array
Reply With Quote #1

What is wrong in this ?

PHP Code:
new Float:gf_PlayerDamage[33][31] = { 1.0, .. } 
__________________

Last edited by Depresie; 06-23-2017 at 09:30.
Depresie is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 06-23-2017 , 09:44   Re: Filling a double dimensional array
Reply With Quote #2

I don't know, what is wrong ? you have anny error ?
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
Depresie
Veteran Member
Join Date: Nov 2013
Old 06-23-2017 , 09:45   Re: Filling a double dimensional array
Reply With Quote #3

"invalid expression, assumed zero"
__________________
Depresie is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 06-23-2017 , 09:50   Re: Filling a double dimensional array
Reply With Quote #4

can you post the whole code please ?
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 06-23-2017 , 09:52   Re: Filling a double dimensional array
Reply With Quote #5

Better to initialize it for player in client_connect or client_putinserver.
__________________
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 06-23-2017 , 09:59   Re: Filling a double dimensional array
Reply With Quote #6

yes, as pro said, this is the only way that have been working to compile after some sort tests, if i find another method i will post.
PHP Code:
#include <amxmodx>

new Float:gf_PlayerDamage[33][31];

public 
client_putinserver(id)
{
    
gf_PlayerDamage[id][id] = 1.0;

__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
Depresie
Veteran Member
Join Date: Nov 2013
Old 06-23-2017 , 10:11   Re: Filling a double dimensional array
Reply With Quote #7

Well, i really want no to do it on client connect, that's why i came here..
__________________
Depresie is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 06-23-2017 , 10:14   Re: Filling a double dimensional array
Reply With Quote #8

Lol, everybody try to compile this plugin and print the output errors:
PHP Code:
#include <amxmodx>

enum MyData
{
       
Float:Float1[33] = 1.0,
       
Float2[33] = 1.0
};

new const 
PD[MyData];

public 
client_putinserver(id)
{
    
// just a test...
    
PD[Float1[id]] = 30.0;
    
PD[Float2[id]] = 40.0;

__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 06-23-2017 , 11:39   Re: Filling a double dimensional array
Reply With Quote #9

Quote:
Originally Posted by Depresie View Post
Well, i really want no to do it on client connect, that's why i came here..
And how you reset it for next connected player? (old one player was disconnected, and new one connected got slot of old player)
__________________
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
eyal282
Veteran Member
Join Date: Aug 2011
Old 06-23-2017 , 16:09   Re: Filling a double dimensional array
Reply With Quote #10

Quote:
Originally Posted by PRoSToTeM@ View Post
And how you reset it for next connected player? (old one player was disconnected, and new one connected got slot of old player)
I'm quite sure it's handled automatically.
eyal282 is offline
Reply


Thread Tools
Display Modes

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 16:44.


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