Fixed handle misuse in clientprefs plugin (
bug 5805, r=psychonic).
6 author = "AlliedModders LLC",
7 description = "Tests stack functions",
9 url = "http://www.sourcemod.net/"
12 public OnPluginStart()
14 RegServerCmd("test_stack", Test_Stack);
17 public Action:Test_Stack(args)
21 decl String:buffer[42];
26 stack = CreateStack(30);
27 PushStackCell(stack, 50);
28 PushStackArray(stack, test, 2);
29 PushStackArray(stack, test, 2);
30 PushStackString(stack, "space craaab");
31 PushStackCell(stack, 12);
33 PrintToServer("empty? %d", IsStackEmpty(stack));
36 PopStackString(stack, buffer, sizeof(buffer));
37 PrintToServer("popped: \"%s\"", buffer);
40 PrintToServer("values: %d, %d", test[0], test[1]);
41 PopStackArray(stack, test, 2);
42 PrintToServer("popped: %d, %d", test[0], test[1]);
43 PopStackCell(stack, test[0], 1);
44 PrintToServer("popped: x, %d", test[0]);
45 PopStackCell(stack, test[0]);
46 PrintToServer("popped: %d", test[0]);
48 PrintToServer("empty? %d", IsStackEmpty(stack));
52 return Plugin_Handled;