I'm making Vote system (+rep help)
#2

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.

PHP код:
new Votes[2];
new 
string[40];
format(stringsizeof(string), -1"[VOTE] Votes: Yes: %d No: %d"Votes[1], Votes[0]);
SCMA(-1string); 
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.
Reply


Messages In This Thread
I'm making Vote system (+rep help) - by maksicnm - 10.11.2017, 21:34
Re: I'm making Vote system (+rep help) - by Sew_Sumi - 10.11.2017, 22:44

Forum Jump:


Users browsing this thread: 1 Guest(s)