IS4Code / PawnPlus

A SA-MP plugin enhancing the capabilities of the Pawn programming language
MIT License
103 stars 17 forks source link

Backward Compatibility #39

Closed fl0w3rs closed 4 years ago

fl0w3rs commented 4 years ago

Is the plugin backward compatible? I'm having problems with https://github.com/AGraber/pawn-plus-mysql which has version 1.0.0-pre4 installed in pawn.json.

IS4Code commented 4 years ago

All versions since 1.0.0 should be backwards compatible. What is the issue?

fl0w3rs commented 4 years ago

Now I have

mysql_query(mysql_connection_id, sprintf("SELECT * FROM accounts WHERE name = '%s'", PlayerName(playerid)), true);

Changing to

await mysql_aquery_s(mysql_connection_id, str_format("SELECT * FROM accounts WHERE name = '%s'", PlayerName(playerid)));

Spawn stops working If you put print in OnPlayerSpawn, then nothing is printed

public OnPlayerSpawn(playerid)
{
    TogglePlayerSpectating(playerid, 0);
    print("OnPlayerSpawn");

    SetPlayerSkin(playerid, player[playerid][player_skin]);
    SetPlayerPosEx(playerid, -2244.9309, -2187.7476, 36.7330);
    SetPlayerFacingAngle(playerid, 204.0);

    if(player[playerid][player_death]) {
        SetPlayerPosEx(playerid, player[playerid][player_deathpos][0], player[playerid][player_deathpos][1], player[playerid][player_deathpos][2]);
        SetPlayerVirtualWorld(playerid, player[playerid][player_deathvw]);
        SetPlayerInterior(playerid, player[playerid][player_deathint]);
        UseAnim(playerid,"PED","FLOOR_hit_f",4.1,0,1,1,1,0);
        player[playerid][player_death] = false;
    }
    return 1;
}

Idk how it works, but if you change mysql_aquery back to mysql_query, everything works without removing the plugin (because of this I came to the conclusion that the problem is in pp-mysql)

fl0w3rs commented 4 years ago

My plugins: mysql.so sscanf.so pawncmd.so streamer.so timerfix.so sampvoice.so PawnPlus.so (no crashdetect because sampvoice conflicts with it) Includes: does not work without fixes.inc either, this is the only include that touches SpawnPlayer image

ADRFranklin commented 4 years ago

This seems more like an issue with how you think you should use it, versus how you are actually using it.

The plugin is backwards compatible, and does work as intended, I think we would require more examples of your usage with the full details and also a walk through of what you expect it to do. It's possible where in your code, or a library you are using that it is now acting differently due to a change it what it expects, versus what it has been given.

In order to validate these claims, it would be better if you could re-create the issue in a fresh gamemode with only the most minimal amount of code / includes needed to reproduce it.

Also crashdetect does work with sampvoice, you just need to make sure it's loaded first.

fl0w3rs commented 4 years ago

What I wrote above is my only use in gm. There are no problems with obtaining data, just the character does not spawn.

Full code of public -> https://hastebin.com/ezosanipex.cs Then calls login dialog -> https://hastebin.com/ecuwotuyis.cpp After success login dialog calls UploadPlayerAccount -> https://hastebin.com/xezapanure.cpp (works correctly too, sends welcome message and calls UploadAdminAccount, but SpawnPlayer does not work, OnPlayerSpawn is not called)

fl0w3rs commented 4 years ago

This seems more like an issue with how you think you should use it, versus how you are actually using it.

The plugin is backwards compatible, and does work as intended, I think we would require more examples of your usage with the full details and also a walk through of what you expect it to do. It's possible where in your code, or a library you are using that it is now acting differently due to a change it what it expects, versus what it has been given.

In order to validate these claims, it would be better if you could re-create the issue in a fresh gamemode with only the most minimal amount of code / includes needed to reproduce it.

Also crashdetect does work with sampvoice, you just need to make sure it's loaded first.

By the way, thank you, I fixed crashdetect, but in the end it does not output anything related to my problem.

fl0w3rs commented 4 years ago

server_log.txt

ADRFranklin commented 4 years ago

@fl0w3rs just before you use await, add this above it task_yield(1);. This should be all you need to do now for it to work.

fl0w3rs commented 4 years ago

Now it works. Thank you