10.11.2017, 22:44
You shouldn't use arrays in this manner...
Also, your string size being 256 is silly, as the client can only display 144 on a single line, and even then your string will never be of a size that will exceed 40.
I've simply done [1] to be yes, and [0] to be no, as it's because 1 is usually a positive, and 0 is usually a false.
This is also not tested, but it should be something. You could do VoteYes, VoteNo as normal variables, and use them that way, but seeing as you were trying to use a an array, I thought it could be something to highlight to teach you regarding the array misuse.
Also, your string size being 256 is silly, as the client can only display 144 on a single line, and even then your string will never be of a size that will exceed 40.
PHP код:
new Votes[2];
new string[40];
format(string, sizeof(string), -1, "[VOTE] Votes: Yes: %d No: %d", Votes[1], Votes[0]);
SCMA(-1, string);
This is also not tested, but it should be something. You could do VoteYes, VoteNo as normal variables, and use them that way, but seeing as you were trying to use a an array, I thought it could be something to highlight to teach you regarding the array misuse.