Y_Commands Compiling Error -
SuperChock - 07.10.2011
When I compile my script, the following error appears:
user error: Non-unique master used.
Referring to the include y_master, line 1013:
pawn Код:
#if defined YSIM_DEFINED && !defined _YSIM_OVERRIDE && !defined YSIM_LIBRARY_OVERRIDE
#error Non-unique master used.
#endif
Help me please, and sorry for my bad english
Re: Y_Commands Compiling Error -
Jafet_Macario - 07.10.2011
Remove the included y_master.
Re: Y_Commands Compiling Error -
SuperChock - 08.10.2011
These 3 new errors arise:
Initialize From Groups in the include Y_Commands.
=(
Re: Y_Commands Compiling Error -
SuperChock - 08.10.2011
Three errors are same ;x
Re: Y_Commands Compiling Error -
SuperChock - 08.10.2011
Line 1101 -
\pawno\include\YSI\y_commands.inc -
undefined symbol: __InitializedFromGroups
Line 1812 -
\pawno\include\YSI\y_commands.inc -
undefined symbol: __InitializedFromGroups
Line 1935 -
\pawno\include\YSI\y_commands.inc -
undefined symbol: __InitializedFromGroups
Respective codes:
(search by "******, the error is here")
pawn Код:
#if YSIM_NOT_CLIENT
mhook OnPlayerConnect(playerid)
{
//#if YSIM_NOT_CLIENT
//YSI_g_sCommandDialog[playerid] = -1;
YSI_g_sPlayerProvider{playerid} = 0xFF;
NO_GROUPS() // ******, the error is here.
{
new
slot = Bit_Slot(playerid) + 1,
Bit:mask = Bit_Mask(playerid); //Bit:(1 << (playerid & (cellbits - 1)));
for (new i = 0; i != MAX_COMMANDS; ++i)
{
YSI_g_sCommands[i][E_COMMANDS_PLAYERS][slot] |= mask;
//PA+(YSI_g_sCommands[i][E_COMMANDS_PLAYERS], mask);
}
}
//#endif
// Groups will ALWAYS be called after this function - so this can reset
// player permissions however it likes with the group system then being
// able to override anything set in here.
return 1;
//ALS_CALL<PlayerConnect, i>(playerid)
}
#endif
pawn Код:
global Command_Add(string:f[],s)
{
P:2("Command_Add called: \"%s\", %i", f, s);
if (YSI_g_sCommandCount < MAX_COMMANDS && YSI_g_sCommandIndex != -1)
{
new
hash = Command_AddHashPacked(f, YSI_g_sCommands[YSI_g_sCommandIndex][E_COMMANDS_FUNCTION], 4),
provider = _:Command_DefaultProvider();
if (Command_IsSorted())
{
new
idx = Command_FindFastStrict(f[1], hash, provider);
if (idx != COMMAND_NOT_FOUND)
{
P:4("Command_Add: Command exists");
YSI_g_sCommands[idx][E_COMMANDS_MASTERS] |= 1 << s;
return 0;
}
if (!Command_HasCollisions())
{
// Check for an existing command with this hash.
if (Bintree_FindValue(YSI_g_sSearchTree, hash) != BINTREE_NOT_FOUND)
{
Command_SetCollisions();
}
}
// Command doesn't exist already - good!
Bintree_Add(YSI_g_sSearchTree, YSI_g_sCommandIndex, hash, YSI_g_sCommandIndex);
}
else
{
new
idx = Command_FindSlowStrict(f[1], provider);
if (idx != COMMAND_NOT_FOUND)
{
P:4("Command_Add: Command exists");
YSI_g_sCommands[idx][E_COMMANDS_MASTERS] |= 1 << s;
return 0;
}
}
YSI_g_sCommands[YSI_g_sCommandIndex][E_COMMANDS_FUNCTION][0] = COMMAND_FUNCTION_PREFIX;
//Bit_SetAll(YSI_g_sCommands[YSI_g_sCommandIndex][E_COMMANDS_PLAYERS], true, bits<MAX_PLAYERS>);
//Command_InitialiseFromGroups(YSI_g_sCommandIndex);
NO_GROUPS(YSI_g_sCommandIndex) // ******, the error is here.
{
PA_Init(YSI_g_sCommands[YSI_g_sCommandIndex][E_COMMANDS_PLAYERS], true);
}
// Swap these.
YSI_g_sCommands[YSI_g_sCommandIndex][E_COMMANDS_MASTERS] = 1 << s;
P:2("Command_Add: Command added in %d (%d)", YSI_g_sCommandIndex, hash);
hash = YSI_g_sCommandIndex;
// Set this command as usable in any script.
P:4("Command_Add: %08x%08x%08x%08x", YSI_g_sCommands[YSI_g_sCommandIndex][E_COMMANDS_FUNCTION][0], YSI_g_sCommands[YSI_g_sCommandIndex][E_COMMANDS_FUNCTION][1], YSI_g_sCommands[YSI_g_sCommandIndex][E_COMMANDS_FUNCTION][2], YSI_g_sCommands[YSI_g_sCommandIndex][E_COMMANDS_FUNCTION][3]);
YSI_g_sCommandIndex = YSI_g_sCommands[hash][E_COMMANDS_FUNC_POINTER];
YSI_g_sCommands[hash][E_COMMANDS_FUNC_POINTER] = hash | (provider << 24);
#if YSIM_HAS_MASTER
if (s == _@)
#endif
{
new
addr = funcidx(f) * 8 + AMX_HEADER_PUBLICS;
#emit LREF.S.pri addr
#emit STOR.S.pri addr
YSI_g_sCommands[hash][E_COMMANDS_AMX_ADDRESS] = addr;
}
#pragma tabsize 4
// Now some complex debug rubbish.
C:4(new str[32];strpack(str, f);printf("Command_Add: %08x%08x%08x%08x", str[0], str[1], str[2], str[3]););
++YSI_g_sCommandCount;
}
return 1;
/*else
{
// Not all hope is lost - check if this command name already exists.
if (Command_IsSorted())
{
new
pos = Command_FindFast(funcname[4], Command_FastHash(funcname[4]));
if (pos != COMMAND_NOT_FOUND)
{
// Found it already in the array.
return pos;
}
}
else
{
new
pos = Command_FindSlow(funcname[4]);
if (pos != COMMAND_NOT_FOUND)
{
// Command already exists.
return pos;
}
}
}
return COMMAND_NOT_FOUND;*/
}
and
pawn Код:
global Command_AddAlt(oidx, string:altname[])
{
P:2("Command_AddAlt called: %i, \"%s\"", oidx, altname);
if (!Command_IsValid(oidx))
{
return COMMAND_NOT_FOUND;
}
new
provider = _:Command_DefaultProvider();
if (YSI_g_sCommandCount < MAX_COMMANDS && YSI_g_sCommandIndex != -1)
{
new
hash = Command_AddHash(altname, YSI_g_sCommands[YSI_g_sCommandIndex][E_COMMANDS_FUNCTION], 0);
if (Command_IsSorted())
{
// Find the function this mirrors.
//oidx = Command_FindFast(function, Command_FastHash(function));
new
pos = Command_FindFastStrict(altname, hash, provider);
if (pos != COMMAND_NOT_FOUND)
{
if (Command_GetPointer(pos) != oidx)
{
// Same altname, different function.
return COMMAND_NOT_FOUND;
}
return pos;
}
// Command doesn't exist already - good!
Bintree_Add(YSI_g_sSearchTree, YSI_g_sCommandIndex, hash, YSI_g_sCommandIndex);
}
else
{
new
pos = Command_FindSlowStrict(altname, provider);
if (pos != COMMAND_NOT_FOUND)
{
if (Command_GetPointer(pos) != oidx)
{
// Same altname, different function.
return COMMAND_NOT_FOUND;
}
// Command already exists.
return pos;
}
}
YSI_g_sCommands[YSI_g_sCommandIndex][E_COMMANDS_FUNCTION][0] = COMMAND_FUNCTION_PREFIX;
//Bit_SetAll(YSI_g_sCommands[YSI_g_sCommandIndex][E_COMMANDS_PLAYERS], true, bits<MAX_PLAYERS>);
//Command_InitialiseFromGroups(YSI_g_sCommandIndex);
NO_GROUPS(YSI_g_sCommandIndex) // ******, the error is here.
{
PA_Init(YSI_g_sCommands[YSI_g_sCommandIndex][E_COMMANDS_PLAYERS], true);
}
++YSI_g_sCommandCount;
// This doesn't have real masters.
YSI_g_sCommands[YSI_g_sCommandIndex][E_COMMANDS_MASTERS] = -1;
hash = YSI_g_sCommandIndex;
YSI_g_sCommandIndex = YSI_g_sCommands[hash][E_COMMANDS_FUNC_POINTER];
YSI_g_sCommands[hash][E_COMMANDS_FUNC_POINTER] = oidx | (provider << 24);
return hash;
}
else
{
// Not all hope is lost - check if this command name already exists.
new
pos;
if (Command_IsSorted())
{
pos = Command_FindFastStrict(altname, Command_FastHash(altname), provider);
}
else
{
pos = Command_FindSlowStrict(altname, provider);
}
if (pos != COMMAND_NOT_FOUND)
{
// Found it already in the array. Check if the element it points to
// has the correct name so we know this is the correct pair, not
// just the correct single element. I.e. check that this is the
// correct original/altname combo, not the right altname on a
// different original name.
if (oidx == Command_GetPointer(pos))
{
return pos;
}
}
}
return COMMAND_NOT_FOUND;
}
Re: Y_Commands Compiling Error -
SuperChock - 08.10.2011
Yes, I downloaded their latest update, YSI 3.0 RC1.
Re: Y_Commands Compiling Error -
SuperChock - 08.10.2011
Oh, sorry ******. I decided to re-download your library, replace the files and everything worked normally. Thank you for your attention to the topic.
Sorry for my bad english.