Quote:
Originally Posted by good_live
An enum is just a enumaration, which means it's assigning a string a number (Counting upwards from 0 as the word enumation implicates). In your exampel userid = 0, team = 1, class = 3 and so on. You don' need the enum. It just makes it easier to read the code.
The array is a way to store the informations (as you maybe know).
So to access a clients userid you could write
HTML Code:
userArray[client][userid]
or
HTML Code:
userArray[client][0]
that would be the same.
|
This is part of a plugin i'm working on:
Code:
public ScoutMenuHandler(Handle:menu, MenuAction:action, client, param2)
{
if (action == MenuAction_Select)
{
char info[32];
GetMenuItem(menu, param2, info, sizeof(info));
if (StrEqual(info, "1"))
{
if (userArray[userid][1][3][bot] == 2)
{
//do stuff (kick)
}
else
{
//do other stuff (print a message in chat)
}
}
}
else if (action == MenuAction_Cancel && param2 == MenuCancel_ExitBack)
{
Menu_Test1(client);
}
else if (action == MenuAction_End)
{
CloseHandle(menu);
}
}
I want to check if client with class "1" (Scout) and team 3 (Blu) has value 3 at "bot" column (Is a bot)
If he is a bot then kick him using the id on the first column.
As i said this is in highlander mode, so there will be only one per class.
How can i do this? Should i use a while command?