So I'm getting a number of a qboolean, which works fine:
g_Engine.Con_Printf("%d\n", GetPlayerUniqueID); // Print out my number / ID.
Then I get the number of it, now if I get a number shouldn't it be possible to do if ( GetPlayerUniqueID == number ) ? The reason is that it doesn't work.
This is my error: operand types are incompatible ("qboolean (*)(int iPlayer, char *playerID)" and "int")
This is the structure of the qboolean function:
qboolean (*GetPlayerUniqueID)(int iPlayer, char playerID);
I know booleans cannot return more than 0 and 1, but I don't really know what's going on if I can get the number of this function but I cannot check if it has a certain number. This is for/from a game.
in the left side GetPlayerUniqueID is a function that is converted to a pointer to function. You can not compare a pointer to function with an integer. And the compiler says you about such restriction. read the compiler messages. They are displayed specially for you.
I think you should use the following form
GetPlayerUniqueID( SomeInt, SomePointerToChar) == number
provided that return type of the function is an integer type.
So I tried what you said, now I debugged that line and I got a ID of 0:
char * playerID // Global, above all functions
// All under a looping function
if ( g_Engine.GetPlayerUniqueID( 0, playerID ) == 33535 ) // id
g_Engine.Con_Printf("%d\n", g_Engine.GetPlayerUniqueID(0, playerID));
// ID = 0
If I have (1, playerID) as parameters, my game will crash so it seems as 0 is the first right parameter but then something isn't right with playerID.
Also this prints my real ID:
// Gets a unique ID for the specified player. This is the same even if you see the player on a different server.
// iPlayer is an entity index, so client 0 would use iPlayer=1.
// Returns false if there is no player on the server in the specified slot.
There is a description from that structure, so I guess it's playerID that is wrong now, probably it prints 0 because it's not defined somewhere else. So that may mean I would need to hook the whole function into this function where I am?
Error: argument of type "char **" is incompatible with parameter of type
Also EDIT: I changed playerID to playerID when I now made (0, playerID), still it prints 0 as ID.
EDIT again, g_Engine gets the function, couldn't find anything usable to playerID. So I've no clue now... == number works but it cannot get the real number. I also tried to put playerID once again instead of playerID in (xxx) parameters, it worked if I changed char * playerID; to char playerID; but still prints 0 as ID.