01.02.2014, 19:01
I love these Callbacks
CMD:pm(playerid, params[])
{
// skip the extra code
new toPlayer;
if( IsPlayerPaused( toPlayer ) ) return SendClientMessage( playerid, -1, "Player in pause" );
}
Checking job functions IsPlayerPaused. Example code:
pawn Код:
|
Updates: - Fixed a problem with IsPlayerPaused (thanks to Optimus_Sprite). - Added additional checks to only execute code if the callback exists. - The system now uses bit flags for optimal performance. - Fixed a few more bugs and glitches.
public OnPlayerCarJack(playerid, targetid, vehicleid)
{
return 1;
}
I used this include to make a command which would show all the paused people on my server when I use that command but it returns huge amounts of time.
for example if a player is paused for 10 seconds it would show "%s is paused for 107637 seconds", where only the first two digits are the real paused time for the player. |
new seconds = GetPlayerPausedTime(playerid) / 1000;
forward OnPlayerPacketLoss(playerid, Float:PacketLost);
static
TickPacketLoss[ MAX_PLAYERS ];
public OnPlayerUpdate(playerid)
{
if( ( gettime() - TickPacketLoss[ playerid ] < 1 ) && ( GetPlayerPacketLoss( playerid ) >= 1.0 ) && ( IsPlayerConnected( playerid ) ) ) //called everyone 1 second.
{
CallLocalFunction( "OnPlayerPacketLoss", "if", playerid, GetPlayerPacketLoss(playerid) );
}
TickPacketLoss[ playerid ] = gettime();
return true;
}
stock GetPlayerPacketLoss(playerid) return NetStats_PacketLossPercent(playerid), true;
native OnPlayerAnimationFinish(playerid, animname[]);
I was actually thinking about
pawn Код:
|
I've made forward OnPlayerDisableCursor(playerid, lastColour);
but forward OnPlayerDisableCursor(playerid, Text:textdrawid); would either require a client sided plugin (like what iPLEOMAX did for his textdraw creation tool) or a sa-mp update with the necessary updates. Continue to do what you are doing Emmet_! I hope you accounted for weapon skill / UsePlayerPedAnims() in OnPlayerAntiReload! |
I was actually thinking about
pawn Код:
|
public OnPlayerAnimationFinish(playerid, animlib[], animname[]) {
new string[64];
format(string, sizeof(string), "Library: %s, Name: %s", animlib, animname);
return SendClientMessage(playerid, 0xFFFFFFFF, string);
}