Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameters are not transmitted properly #17

Closed
nexquery opened this issue Feb 15, 2023 · 5 comments
Closed

Parameters are not transmitted properly #17

nexquery opened this issue Feb 15, 2023 · 5 comments

Comments

@nexquery
Copy link

I am using the v2.1.0 version of the plugin and when I send a value I get a different value.

Here is my code:

hook OnPlayerConnect(playerid)
{
    if(!IClient_Auth(playerid, strval(gToken)))
    {
        Oyuncu_Kick(playerid);
        return Y_HOOKS_BREAK_RETURN_1;
    }
    return 1;
}

stock Oyuncu_Kick(playerid)
{
    new ping = GetPlayerPing(playerid) + 150;
    SetPreciseTimer("Kicklendi", (ping > 500 ? 500 : ping), false, "d", playerid);
    printf("P-1: %d", playerid);
}

forward Kicklendi(playerid);
public Kicklendi(playerid)
{
    Kick(playerid);
    printf("P-2: %d", playerid);
}

Result:

[17:44:33] [join] N_1_7357308 has joined the server (0:127.0.0.1)
[17:44:33] P-1: 0
[17:44:33] P-2: 46448452

Version 2.0.2 does not seem to have such a problem.

Result:

[17:46:55] [join] N_1_7357308 has joined the server (0:127.0.0.1)
[17:46:55] P-1: 0
[17:46:55] [part] N_1_7357308 has left the server (0:2)
[17:46:55] P-2: 0
@nekjutsu
Copy link

nekjutsu commented Apr 25, 2024

This bug still exists in latest 3.0.0 release

@bmisiak
Copy link
Owner

bmisiak commented Jul 22, 2024

Should be fixed by https://github.com/bmisiak/samp-precise-timers/releases/tag/v3.1.0

Thanks for reporting! Let me know!

@nekjutsu
Copy link

nekjutsu commented Jul 23, 2024

Still not fixed, also i found an arrays bug

public OnGameModeInit()
{
  // Test basic (incorrect parameter values)
  SetPreciseTimer("TestBasic", 100, false, "iifs", 100, -200, 0.123456789, "qwerty");
  
  // Test array (server crash)
  new arr[5] = {11, 22, 33, 44, 55};
  SetPreciseTimer("TestArray", 100, false, "aA", arr, sizeof(arr));
  return 1;
}
forward TestBasic(p1, p2, Float: p3, p4[]);
public TestBasic(p1, p2, Float: p3, p4[])
{
    printf("[TestBasic] p1 %i, p2 %i, p3 %f, p4 %s", p1, p2, p3, p4);
    return 1;
}

forward TestArray(p1[], p1_size);
public TestArray(p1[], p1_size)
{
    for(new i = 0; i < p1_size; i++)
    {
        printf("[TestArray] p1[%i]=%i", i, p1[i]);
    }
    return 1;
}

Result

[TestBasic] p1 15833880, p2 15833876, p3 0.000000, p4 qwerty

@bmisiak
Copy link
Owner

bmisiak commented Jul 27, 2024

Ah! Yoinked 3.1.0. Tested your script on version 3.1.1 I just released.

Thank you for testing and reporting!

@nekjutsu
Copy link

Everything is fixed, including array crashes

Thank you!

@bmisiak bmisiak closed this as completed Jul 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants