GetClientOfUserId
something that I still dont understand is the handling of userid. if I use for example GetClientOfUserId(i) and GetClientOfUserId(target) it does NOT return the userid displayed when you type "status" in console.
In SM documentation it says that GetClientOfUserId "Translates an userid index to the real player index". Could you quickly explain me what exactly it does? If I define i: Code:
new maxClients = GetMaxClients(); |
Re: GetClientOfUserId
That returns the client index. You are looking for GetClientUserId().
Also...As of SM 1.2 you can just use MaxClients. Theres no reason to use GetMaxClients() anymore. |
Re: GetClientOfUserId
ok thanks, but I can get the client name of "i" with:
GetClientName(i, playerName, sizeof(playerName)); where is the userid? btw: Maybe there is something that I completely ignore ;) |
Re: GetClientOfUserId
Im not exactly sure what you are trying to do. In your code, "i" would be the player index, so doing GetClientUserId(i) would return the client's userid.
|
Re: GetClientOfUserId
right thanks, the return can obviously not be print to chat:
PrintToChat(target, "That is the userid: %s", GetClientUserId(i)); |
Re: GetClientOfUserId
GetClientUserId(i) returns an index, so you need %d (an integer value), not %s (a string)
|
Re: GetClientOfUserId
omg thats it. Much thanks CrimsonGT!
|
Re: GetClientOfUserId
You're missing the last client, that should be <= not <
|
All times are GMT -4. The time now is 02:13. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.