Correct way to do this?
You cease amxx scripting for months and already forget a lot...
I've tried different ways that I already forgot and that take up more lines and still don't give the result I want. Here's a code that generates a serial code'ish code. PHP Code:
What it prints: "Generation: A" Don't judge :nono: |
Re: Correct way to do this?
what BonusCode is doing there ?
ColorChat(id, GREY, "%s", BonusCode);. it should be ColorChat(id, GREY, "%s", SCode); just change this PHP Code:
PHP Code:
|
Re: Correct way to do this?
I do not use ColorChat but it appears it has built-in formatting so there is no need for using format(). Also, you should use formatex() when you do need to format a string.
|
Re: Correct way to do this?
FYI,
While this may work, it is uses improper (confusing) functions to do it: Code:
gSChars[random_num(0, charsmax(gSChars))] Code:
gSChars[random(sizeof gSChars)] Code:
ColorChat(id, GREY, SCode); |
Re: Correct way to do this?
@indraraj striker
That did the job, thanks! @Bugsy && Fysiks At first, I thought charsmax() was the same as sizeof() - 1, that's what everyone said until I found Quote:
Also I should have made that a global variable, because I need that code to be stored and used somewhere else, my mistake. That's why I used format. Thanks for the replies! |
Re: Correct way to do this?
Quote:
|
Re: Correct way to do this?
Quote:
Code:
new size_of_array = sizeof gSChars // Gets the size of the first dimension |
Re: Correct way to do this?
Yes, I see. Thanks again.
|
All times are GMT -4. The time now is 22:45. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.