[Include] New SA-MP callbacks!
#21

Very Nice!
Reply
#22

Damn looks lovely Emmet! Another cool release from you. Loved the callbacks. It will more helpful for all the Roleplay servers. I will use them for sure!
pawn Код:
// Called when a player falls from a tall height.
forward OnPlayerFall(playerid, Float:height, Float:damage);

// Called when a player crashes their vehicle.
forward OnPlayerCrashVehicle(playerid, vehicleid);
Also i suggest something like this.

pawn Код:
// Called when a player crashes their vehicle.
forward OnPlayerCrashVehicle(playerid, vehicleid, Float:damage);
Where damage = damage done to the car in the crash.
Reply
#23

Thanks guys.

Quote:
Originally Posted by ******
Посмотреть сообщение
Except no-one ever says "PRESSED(keys) && HOLDING(keys)", plus all the macros should be in an include anyway.
Good point, I haven't really noticed those macros until now. I'll do some further testing later on.

Quote:
Originally Posted by Lordz™
Посмотреть сообщение
Another great release EMMAAT. I'm expecting this include to have more cool features and I can assure that it would get updated with useful callbacks.

Btw, the pausing system's timer is being called every 600ms and detects if OPU is called or not. From my experience, OPU might get paused when a player is entering a vehicle, or is at dead state. It would be good if OPU is set to true under OnPlayerStateChange too. Sorry if I'm wrong, but I've experienced such things with 0.3x R1.
Perhaps I should add a time check to the pause detection. Thanks for reporting!

Quote:
Originally Posted by Ballu Miaa
Посмотреть сообщение
Damn looks lovely Emmet! Another cool release from you. Loved the callbacks. It will more helpful for all the Roleplay servers. I will use them for sure!
pawn Код:
// Called when a player falls from a tall height.
forward OnPlayerFall(playerid, Float:height, Float:damage);

// Called when a player crashes their vehicle.
forward OnPlayerCrashVehicle(playerid, vehicleid);
Also i suggest something like this.

pawn Код:
// Called when a player crashes their vehicle.
forward OnPlayerCrashVehicle(playerid, vehicleid, Float:damage);
Where damage = damage done to the car in the crash.
Great suggestion! I'll add it right now.

Код:
Updates:
- Added "OnPlayerUseVending" - called when a player uses a vending machine.
- OnPlayerCrashVehicle now has a damage parameter ("Float:damage").
- Fixed the pause detector, it should be much more accurate now.
Reply
#24

Great release! nice one
Reply
#25

LOL, really bad time for the release. You should update the script to the new 0.3z RC4 natives. Bad luck but nice job though.
Reply
#26

Great work i use some of this callback Especialy For vehicle crashing
Reply
#27

This is some very nice shiet.
Reply
#28

Quote:
Originally Posted by Emmet_
Посмотреть сообщение
Thanks, everyone.

Код:
Updates:
- Added OnPlayerFPSChange(playerid, oldfps, newfps).
- Added a USE_OPTIMAL_MODE setting.
- Added GetPlayerFPS(playerid).
- Fixed a bug where OnPlayerCrashVehicle was sometimes called twice.
- Memory and performance improvements!
To use the new optimal mode setting, do this:

pawn Код:
#define USE_OPTIMAL_MODE
#include <callbacks>
Which uses a 600 ms timer instead of OnPlayerUpdate.
Those functions are the best. GetPlayerFPS should save me some time.
Reply
#29

Can you just give me the idea or example for using of OnPlayerFPSChange(playerid, oldfps, newfps)
This is so good include that i have no more idea
Reply
#30

pawn Код:
public OnPlayerFPSChange(playerid, oldfps, newfps)
{
    static
        str[24]
    ;
    format(str, 24, "~r~FPS:~w~ %d", newfps);
    PlayerTextDrawSetString(playerid, g_FPSTextdraw[playerid], str);
    return 1;
}
Taken from my gamemode.

Also:

pawn Код:
CMD:laggers(playerid, params[])
{
    static
        str[1024],
        name[MAX_PLAYER_NAME]
    ;
    foreach (new i : Player)
    {
        if (GetPlayerFPS(i) < 30)
        {
            GetPlayerName(i, name, sizeof(name));
            format(str, sizeof(str), "%s%s (%d FPS)\n", str, name, GetPlayerFPS(i));
        }
    }
    return ShowPlayerDialog(playerid, DIALOG_LAGGERS, DIALOG_STYLE_LIST, "List of Laggers", str, "Close", "");
}
Reply
#31

Amazing man!
Reply
#32

Thanks +rep for you
Reply
#33

YSI and Emmet_ callbacks

Код:
warning 235: public function lacks forward declaration (symbol "CB_OnPlayerUpdate")
Reply
#34

Wow, I like the /laggers command, I think i'm going to add that into my gamemode.
Reply
#35

Quote:
Originally Posted by Optimus_Sprite
Посмотреть сообщение
YSI and Emmet_ callbacks

Код:
warning 235: public function lacks forward declaration (symbol "CB_OnPlayerUpdate")
Fixed, thanks.

Quote:
Originally Posted by Luis-
Посмотреть сообщение
Wow, I like the /laggers command, I think i'm going to add that into my gamemode.
Feel free to! I'm planning on creating a textdraw menu for it, I'll release it shortly.
Reply
#36

Ah, that sounds awesome actually, cannot wait to see it
Reply
#37

IsPlayerNearVending might not detect some vending machines. There were a few threads with positions for vending machines and some vending machines were missing (the ones inside 24/7 stores). I tested this like a year ago with data from other threads and all of them had some vending machine positions missing.

Support for y_timers would also be nice.
Reply
#38

These are nice, good job.
Reply
#39

Thanks, everyone. The textdraw menu for lagging players is nearly complete, I just have to add a few touch ups!

Quote:
Originally Posted by im
Посмотреть сообщение
IsPlayerNearVending might not detect some vending machines. There were a few threads with positions for vending machines and some vending machines were missing (the ones inside 24/7 stores). I tested this like a year ago with data from other threads and all of them had some vending machine positions missing.

Support for y_timers would also be nice.
I agree, the vending machine coordinates array is missing a few machines. I've just traveled through interiors and around the world and typed /save at the machines.

I'll add y_timers support later on, thanks for the suggestion!
Reply
#40

one idea:

pawn Код:
native GetServerIP();
add that.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)