enum & float double array - tag mismatch
Code:
|
Re: float double array - tag mismatch
Try :
PHP Code:
|
Re: float double array - tag mismatch
Done, same problem.
I forgot to mention that stats[id][pmp] & stats[id][pap] takes some astronomical values, over 6 digits. |
Re: float double array - tag mismatch
Add Float:
Eg : new Float:mp_pool = Float:stats[id][pmp]; or you can directly put Float: in the enum on each element. |
Re: float double array - tag mismatch
Quote:
What here fails is the tag list_stats. You have make a decision do you use the tag or not, either connors way or: PHP Code:
PHP Code:
|
Re: float double array - tag mismatch
Quote:
Quote:
|
Re: float double array - tag mismatch
This worked:
Code:
But I don't understand why it worked, the items from enum should be the 2nd index for the double array, the index should be integer, right? |
Re: float double array - tag mismatch
_: is not needed there.
I don't know much about that and I badly explain but in Pawn you can use structs like in C with an enum. The way you use in your code is a struct of severals float vars. An enum is a list of possible value for a variable. A struct is a list of different sub-variables ( bool, float, integer, array or custom tags ) for variables. A simple basic enum : Code:
Now, a basic structs : Code:
A struct with differents types : Code:
I've used _: to remove the tag since PData has no tag otherwise you will get a tag mismatch. So, it works for you because it's a struct of float sub-variables. Since all are float you can tag the var as float too like you have done and then no need to detag when you set a float value. You can get more informations in the Pawn guide ( .pdf ) you can found on the wiki. |
Re: float double array - tag mismatch
Now I understand, thanks again Arkshine!
|
Re: float double array - tag mismatch
Quote:
You are saying the index should be an integer. I don't quite get what are you meaning with an integer. If you are meaning that the index can't be tagged you are wrong. Quote:
|
| All times are GMT -4. The time now is 13:42. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.