SHOW:
|
|
- or go back to the newest paste.
| 1 | /* | |
| 2 | ||
| 3 | - INFO | |
| 4 | ||
| 5 | Include u izradi od: 25.04.2014. godi | |
| 6 | ne | |
| 7 | Verzija Includea: v1.0.0 | |
| 8 | Include By: Kalibar .300 | |
| 9 | ||
| 10 | ||
| 11 | ||
| 12 | - NAPOMENE: | |
| 13 | ||
| 14 | Da bi ste ovaj Include instalirali kako treba, procitajte ''Instalacija.txt'' | |
| 15 | ||
| 16 | ||
| 17 | ||
| 18 | - UPDATE LOG: | |
| 19 | ||
| 20 | v1.0.0 | |
| 21 | ------- | |
| 22 | - Osnovni System generiranja koda od 8 znamenki. | |
| 23 | - U kod se ukljucuju brojevne znamenke od 0 do 9 i slova, mala i velika, od a do d. | |
| 24 | ||
| 25 | ||
| 26 | */ | |
| 27 | ||
| 28 | ||
| 29 | //INCLUDE FAJLOVI | |
| 30 | #include <a_samp> | |
| 31 | ||
| 32 | ||
| 33 | //DEFINICIJE | |
| 34 | #define LAST_UPDATE "25.04.2014." | |
| 35 | #define VERSION "v1.0.0" | |
| 36 | ||
| 37 | ||
| 38 | enum _chars {
| |
| 39 | lower[1] | |
| 40 | }; | |
| 41 | ||
| 42 | new chars[26][_chars] = {
| |
| 43 | {"a"},
| |
| 44 | {"b"},
| |
| 45 | {"c"},
| |
| 46 | {"d"},
| |
| 47 | {"e"},
| |
| 48 | {"f"},
| |
| 49 | {"g"},
| |
| 50 | {"h"},
| |
| 51 | {"i"},
| |
| 52 | {"j"},
| |
| 53 | {"k"},
| |
| 54 | {"l"},
| |
| 55 | {"m"},
| |
| 56 | {"n"},
| |
| 57 | {"o"},
| |
| 58 | {"p"},
| |
| 59 | {"q"},
| |
| 60 | {"r"},
| |
| 61 | {"s"},
| |
| 62 | {"t"},
| |
| 63 | {"u"},
| |
| 64 | {"v"},
| |
| 65 | {"w"},
| |
| 66 | {"x"},
| |
| 67 | {"y"},
| |
| 68 | {"z"}
| |
| 69 | }; | |
| 70 | ||
| 71 | forward inc300_generateCODE(); | |
| 72 | public inc300_generateCODE() {
| |
| 73 | new char_num = 8, //we use more memory, but still easier to change number of chars | |
| 74 | string[char_num] = ""; | |
| 75 | ||
| 76 | for (new char_done = 0; char_done < char_num; char_done++) {
| |
| 77 | switch (random(2)) {
| |
| 78 | case 1: {
| |
| 79 | format(string, sizeof(string), "%s%s", string, chars[random(25)][lower]); | |
| 80 | } | |
| 81 | case 2: {
| |
| 82 | - | format(string, sizeof(string), "%s%s", string, toupper(chars[random(25)][lower]); |
| 82 | + | format(string, sizeof(string), "%s%s", string, toupper(chars[random(25)][lower])); |
| 83 | } | |
| 84 | default: {
| |
| 85 | format(string, sizeof(string), "%s%d", random(9)); | |
| 86 | } | |
| 87 | } | |
| 88 | } | |
| 89 | ||
| 90 | return string; | |
| 91 | } | |
| 92 | ||
| 93 | public gCODE300_OnIncInit() | |
| 94 | {
| |
| 95 | ||
| 96 | printf("------------------------------ generateCODE ------------------------------");
| |
| 97 | printf("- generateCODE System je uspjesno ucitan.");
| |
| 98 | printf("- Include By Kalibar .300");
| |
| 99 | printf("- Verzija Includa: "VERSION".");
| |
| 100 | printf("- Zadnji Update: "LAST_UPDATE"");
| |
| 101 | printf("--------------------------------------------------------------------------");
| |
| 102 | return 1; | |
| 103 | } |