#include <a_samp> enum test { ext, ext1, etc[7], etc1[5], ext2, ext3, etc2[9], } new testt[test]; main() { print("\n----------------------------------"); print(" Blank Gamemode by your name here"); print("----------------------------------\n"); } public OnGameModeInit() { testt[ext] = 1111; testt[ext1] = 1; testt[etc][0] = EOS; strins(testt[etc], "123456", 0); testt[etc1][0] = EOS; strins(testt[etc1], "1234", 0); testt[etc2][0] = EOS; strins(testt[etc2], "12345678", 0); testt[ext2] = 0; testt[ext3] = 1341234; printf("%d, %d, %s, %s, %d, %d, %s", testt[ext], testt[ext1], testt[etc], testt[etc1], testt[ext2], testt[ext3], testt[etc2]); return 1; }
[22:42:56] 1111, 1, 123456, 1234, 0, 1341234, 12345678 [22:42:56] ---------------------------------- [22:42:56] Blank Gamemode by your name here [22:42:56] ---------------------------------- [22:42:56] Number of vehicle models: 0
#include <a_samp> enum test { ext, ext1, etc[7], etc1[5], ext2, ext3, etc2[2], } new testt[test]; main() { print("\n----------------------------------"); print(" Blank Gamemode by your name here"); print("----------------------------------\n"); } public OnGameModeInit() { testt[ext] = 1111; testt[ext1] = 1; testt[etc][0] = EOS; strins(testt[etc], "123456", 0); testt[etc1][0] = EOS; strins(testt[etc1], "1234", 0); testt[etc2][0] = EOS; strins(testt[etc2], "12345678", 0); testt[ext2] = 0; testt[ext3] = 1341234; printf("%d, %d, %s, %s, %d, %d, %s", testt[ext], testt[ext1], testt[etc], testt[etc1], testt[ext2], testt[ext3], testt[etc2]); return 1; }
[22:44:12] --------------- [22:44:12] Loaded 0 filterscripts. [22:44:12] 1111, 1, 123456, 1234, 0, 1341234, 12345678 [22:44:12] 345678 [22:44:12] Blank Gamemode by your name here [22:44:12] ---------------------------------- [22:44:12] Number of vehicle models: 0
#include <a_samp> enum test { ext, ext1, etc[7], etc1[5], etc2[2], ext2, ext3, } new testt[test]; main() { print("\n----------------------------------"); print(" Blank Gamemode by your name here"); print("----------------------------------\n"); } public OnGameModeInit() { testt[ext] = 1111; testt[ext1] = 1; testt[etc][0] = EOS; strins(testt[etc], "123456", 0); testt[etc1][0] = EOS; strins(testt[etc1], "1234", 0); testt[etc2][0] = EOS; strins(testt[etc2], "12345678", 0); testt[ext2] = 0; testt[ext3] = 1341234; printf("%d, %d, %s, %s, %d, %d, %s", testt[ext], testt[ext1], testt[etc], testt[etc1], testt[ext2], testt[ext3], testt[etc2]); return 1; }
[22:48:25] --------------- [22:48:25] Loaded 0 filterscripts. [22:48:25] 1111, 1, 123456, 1234, 0, 1341234, 12 [22:48:25] 5678 [22:48:25] Blank Gamemode by your name here [22:48:25] ---------------------------------- [22:48:25] Number of vehicle models: 0
#include <a_samp> enum test { ext, ext1, etc[7], etc2[2], etc1[5], ext2, ext3, } new testt[test]; main() { print("\n----------------------------------"); print(" Blank Gamemode by your name here"); print("----------------------------------\n"); } public OnGameModeInit() { testt[ext] = 1111; testt[ext1] = 1; testt[etc][0] = EOS; strins(testt[etc], "123456", 0); testt[etc1][0] = EOS; strins(testt[etc1], "1234", 0); testt[etc2][0] = EOS; strins(testt[etc2], "12345678", 0); testt[ext2] = 0; testt[ext3] = 1341234; printf("%d, %d, %s, %s, %d, %d, %s", testt[ext], testt[ext1], testt[etc], testt[etc1], testt[ext2], testt[ext3], testt[etc2]); return 1; }
[17:36:50] --------------- [17:36:50] Loaded 0 filterscripts. [17:36:50] 1111, 1, 123456, 34567, 0, 1341234, 1234567 [17:36:50] ---------------------------------- [17:36:50] Blank Gamemode by your name here [17:36:50] ---------------------------------- [17:36:50] Number of vehicle models: 0
Но почему же тогда результат менялся в зависимости от местонахождения переменной в энуменаторе?
|
public OnGameModeInit() { testt[ext] = 1111; testt[ext1] = 1; testt[etc][0] = EOS; strins(testt[etc], "123456", 0); testt[etc1][0] = EOS; strins(testt[etc1], "1234", 0); testt[etc2][0] = EOS; strins(testt[etc2], "12345678", 0); testt[ext2] = 0; testt[ext3] = 1341234; printf("%d, %d, %s, %s, %d, %d, %s", testt[ext], testt[ext1], testt[etc], testt[etc1], testt[ext2], testt[ext3], testt[etc2]); return 1; }
enum test { ext, ext1, etc[7], etc1[5], ext2, ext3, etc2[9], }
[22:42:56] 1111, 1, 123456, 1234, 0, 1341234, 12345678
enum test { ext, ext1, etc[7], etc1[5], ext2, ext3, etc2[2], }
[22:44:12] 1111, 1, 123456, 1234, 0, 1341234, 12345678 [22:44:12] 345678
enum test { ext, ext1, etc[7], etc1[5], etc2[2], ext2, ext3, }
[22:48:25] 1111, 1, 123456, 1234, 0, 1341234, 12 [22:48:25] 5678
enum test { ext, ext1, etc[7], etc2[2], etc1[5], ext2, ext3, }
[17:36:50] 1111, 1, 123456, 34567, 0, 1341234, 1234567
#include <a_samp>
enum test
{
arr1[6],
val1,
val2,
arr2[6],
}
new var[test];
main() {
strins(var[arr1], "hello", 0);
strins(var[arr2], "world", 0);
var[val1] = 99;
var[val2] = 123456;
printf("var[arr1] = %s (%s)", var[arr1], "hello");
printf("var[val1] = %d (%d)", var[val1], 99);
printf("var[val2] = %d (%d)", var[val2], 123456);
printf("var[arr2] = %s (%s)", var[arr2], "world");
}
var[arr1] = hello (hello)
var[val1] = 99 (99)
var[val2] = 123456 (123456)
var[arr2] = world (world)
var[arr1] = hello (hello)
var[val1] = 99 (99)
var[val2] = 123456 (123456)
var[arr2] = world (world)
var[arr1] = hello (hello)
var[val1] = 99 (99)
var[val2] = 123456 (123456)
var[arr2] = woc@d (world)
var[arr1] = rld (hello)
var[val1] = 99 (99)
var[val2] = 123456 (123456)
var[arr2] = world (world)
Какая разница, значение переменной менялось в зависимости от местоположения в энуменаторе. И вроде бы тогда у меня был подключен fixes, сейчас да, не подключен, но суть одна, это явно не из-за баганной функции strins.
|
enum test
{
arr2[2],
arr1[6],
val1,
val2,
}
new var[test];
main() {
strcat(var[arr1], "hello", 6);
strcat(var[arr2], "world", 2);
var[val1] = 99;
var[val2] = 123456;
printf("var[arr1] = %s (%s)", var[arr1], "hello");
printf("var[val1] = %d (%d)", var[val1], 99);
printf("var[val2] = %d (%d)", var[val2], 123456);
printf("var[arr2] = %s (%s)", var[arr2], "world");
}
var[arr1] = hello (hello)
var[val1] = 99 (99)
var[val2] = 123456 (123456)
var[arr2] = w (world)