Results 1 to 8 of 8

Thread: COD4 self setPower() problem

  1. #1
    Private
    Join Date
    May 2017
    Posts
    17
    Thanks
    2
    Thanked 2 Times in 2 Posts

    COD4 self setPower() problem

    Hi, I am having a problem setting power to a player for command usage, the problem is that only works for me every time.
    for example: I set the power for admins to(3), when they connect to the server they have the power set to (3) and cant use some commands that people with that power should can. (Its not my case because it works for me).
    Here are some pictures of me with all the power cases.
    power
    Click image for larger version. 

Name:	3a6c905137c714ee529621280f00205c.png 
Views:	80 
Size:	3.5 KB 
ID:	1353
    on connect
    Click image for larger version. 

Name:	ff6dd0222b65a731e47f46e20ca09f44.png 
Views:	79 
Size:	14.7 KB 
ID:	1354
    when is admin and its me power(100)
    Click image for larger version. 

Name:	c90c82a0defa7f2c8cfe23a99b5266ee.png 
Views:	86 
Size:	259.7 KB 
ID:	1355
    when is admin
    Click image for larger version. 

Name:	455adeefb2049eccce4822b68c225440.png 
Views:	79 
Size:	61.5 KB 
ID:	1356


    ps:Dont know why it doesnt work for other people.
    ps2:They appear to have the power to use some commands but they cant because lack of power¿)

  2. #2
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    I dont see any evidence of "not being able to use certain commands". Looks like admin with level 3 can use all the up-to level 3 commands to me.
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  3. #3
    Private
    Join Date
    May 2017
    Posts
    17
    Thanks
    2
    Thanked 2 Times in 2 Posts
    with that image i am showing that it works well at least for me, but if i give admin to another players they cant use them even with power (3).
    ill keep trying.

  4. #4
    Private
    Join Date
    May 2017
    Posts
    17
    Thanks
    2
    Thanked 2 Times in 2 Posts
    is so weird that only works for me, example: i have the same rank as this player and same power but he cant use the commands.
    Click image for larger version. 

Name:	f0f7b9472f3d579956b2bb047585bcff.png 
Views:	63 
Size:	30.1 KB 
ID:	1357
    ps:i also tried changing the others players power on live server with a command but i cant, but guess what i can change my power...
    what can i try? thank you

  5. #5
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,010
    Thanks
    2,102
    Thanked 1,083 Times in 753 Posts
    You can try to post all the relevant source code or debug it yourself (adding lovely print's)
    timescale 0.01

  6. #6
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,010
    Thanks
    2,102
    Thanked 1,083 Times in 753 Posts
    Searched some relevant stuff together:

    void PlayerCmd_SetPower(scr_entref_t arg)

    https://github.com/callofduty4x/CoD4...nctions.c#L344

    qboolean Cmd_AddCommandGeneric( const char *cmd_name, const char* helptext, xcommand_t function, qboolean warn, int power )

    https://github.com/callofduty4x/CoD4...src/cmd.c#L337

    int Cmd_GetInvokerPower();

    Seems to be statically compiled into the binary, so not available to debug... reason enough to debug the returned value for your different players

    static void Cmd_List_f( void )

    https://github.com/callofduty4x/CoD4...rc/cmd.c#L1149

    Here is something interesting: Cmd_GetInvokerPower() < cmd->minPower, meaning ppl with power 3 can only use commands with minPower from 1 to 2, while I would expect it to be "including", so from 1 to 3.

    Well, this is already way too much C aids. This kind of right management stuff should be done in a scripting language, for easy/fast explorative programming. I never worked with CoD4x, but probably there is a way to catch the player commands ingame and just handle the right management yourself? That will allow you to be much more fine grained aswell (e.g. use MySQL for user groups etc.). C should be used where it has to be used (and nowhere else).

    Also the script reference even states:

    Not recommended to use. The overall behaviour is not known. Don't set non admins above level 9
    timescale 0.01

  7. #7
    Private
    Join Date
    May 2017
    Posts
    17
    Thanks
    2
    Thanked 2 Times in 2 Posts
    thanks for taking time answering this this kung foo, i just turned them to power(1).
    So weird that before this change some people could use it and some not, thats unfortunate.

  8. #8
    Private
    Join Date
    May 2017
    Posts
    17
    Thanks
    2
    Thanked 2 Times in 2 Posts
    the problem here was, (you must use steam while playing cod4) <- i didnt know that at that moment

  9. The Following User Says Thank You to genez_x For This Useful Post:

    kung foo man (8th January 2018)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •