SA-MP Forums Archive
[Include] New SA-MP callbacks! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] New SA-MP callbacks! (/showthread.php?tid=490436)

Pages: 1 2 3 4 5 6 7 8 9


Re: New SA-MP callbacks! - Unknown1234 - 30.09.2014

Quote:
Originally Posted by GwENiko
Посмотреть сообщение
Wow, how come after adding Emmet's include, i receive many, many indentation warnings? lol

pawn Код:
\pawno\include\callback.inc(183) : warning 217: loose indentation
\pawno\include\callback.inc(296) : warning 217: loose indentation
\pawno\include\callback.inc(297) : warning 217: loose indentation
\pawno\include\callback.inc(324) : warning 217: loose indentation
\pawno\include\callback.inc(364) : warning 217: loose indentation
\pawno\include\callback.inc(382) : warning 217: loose indentation
\pawno\include\callback.inc(389) : warning 217: loose indentation
\pawno\include\callback.inc(410) : warning 217: loose indentation
\pawno\include\callback.inc(411) : warning 217: loose indentation
\pawno\include\callback.inc(449) : warning 217: loose indentation
\pawno\include\callback.inc(456) : warning 217: loose indentation
\pawno\include\callback.inc(458) : warning 217: loose indentation
\pawno\include\callback.inc(463) : warning 217: loose indentation
\pawno\include\callback.inc(481) : warning 217: loose indentation
\pawno\include\callback.inc(492) : warning 217: loose indentation
\pawno\include\callback.inc(513) : warning 217: loose indentation
\pawno\include\callback.inc(518) : warning 217: loose indentation
\pawno\include\callback.inc(568) : warning 217: loose indentation
\pawno\include\callback.inc(605) : warning 217: loose indentation
\pawno\include\callback.inc(628) : warning 217: loose indentation
\pawno\include\callback.inc(631) : warning 217: loose indentation
\pawno\include\callback.inc(643) : warning 217: loose indentation
\pawno\include\callback.inc(657) : warning 217: loose indentation
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


23 Warnings.
Although without it, i dont receive any warnings at all
just use
Код:
#pragma tabsize 0
after ur <a_samp> incl.


Re: New SA-MP callbacks! - GwENiko - 30.09.2014

Quote:
Originally Posted by Unknown1234
Посмотреть сообщение
just use
Код:
#pragma tabsize 0
after ur <a_samp> incl.
lmao nah.


Re: New SA-MP callbacks! - Emmet_ - 30.09.2014

I'm not getting those warnings, try downloading it from GitHub instead. Pastebin likes to fuck up indentation.


Re: New SA-MP callbacks! - GwENiko - 30.09.2014

Quote:
Originally Posted by Emmet_
Посмотреть сообщение
I'm not getting those warnings, try downloading it from GitHub instead. Pastebin likes to fuck up indentation.
Yea, thats why, i didnt even notice. But yea, its working good except OnPlayerAntiReload it causes players to desynchronize and show as AFK, happens to everyone, any idea how to fix it?


Re: New SA-MP callbacks! - Emmet_ - 30.09.2014

Quote:
Originally Posted by GwENiko
Посмотреть сообщение
Yea, thats why, i didnt even notice. But yea, its working good except OnPlayerAntiReload it causes players to desynchronize and show as AFK, happens to everyone, any idea how to fix it?
Fixed. Sorry about that lol. It was caused by an "array index out of bounds" error, since I didn't add enough slots to the array that holds the total shots.


Re: New SA-MP callbacks! - GwENiko - 30.09.2014

Quote:
Originally Posted by Emmet_
Посмотреть сообщение
Fixed. Sorry about that lol. It was caused by an "array index out of bounds" error, since I didn't add enough slots to the array that holds the total shots.
oh thats relieving then :P. is the fixed version download-able yet?


Re: New SA-MP callbacks! - Emmet_ - 30.09.2014

Quote:
Originally Posted by GwENiko
Посмотреть сообщение
oh thats relieving then :P. is the fixed version download-able yet?
Yeah, feel free to download it.


Re: New SA-MP callbacks! - GwENiko - 30.09.2014

Everything works as intended in my code now, hot release , thanks for the help aswell also repped you


Re: New SA-MP callbacks! - SWGamer - 01.10.2014

The Disable cursor callback doesn't work.
I REPPED you though for your awesome work.Keep it up and fix the bug please.I really need that call back.
Код:
D:\Ultimate Gaming Server\filterscripts\sd.pwn(75) : error 025: function heading differs from prototype
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.



Re: New SA-MP callbacks! - Emmet_ - 01.10.2014

Works fine for me. Try using this syntax:

pawn Код:
public OnPlayerDisableCursor(playerid, hovercolor)
{
    return 1;
}



Re: New SA-MP callbacks! - Evocator - 01.10.2014

OnPlayerStartBurning / IsPlayerBurning?
I've been thinking of a function capable of checking for these since ages, however i came up with nothing :]


Re: New SA-MP callbacks! - Abagail - 01.10.2014

Quote:
Originally Posted by Ralfie
Посмотреть сообщение
OnPlayerStartBurning / IsPlayerBurning?
I've been thinking of a function capable of checking for these since ages, however i came up with nothing :]
Could maybe be detected by checking if the player is slowly loosing health, - and near fire particles?


Re: New SA-MP callbacks! - Rudy_ - 02.10.2014

Quote:
Originally Posted by Ralfie
Посмотреть сообщение
OnPlayerStartBurning / IsPlayerBurning?
I've been thinking of a function capable of checking for these since ages, however i came up with nothing :]
Quote:
Originally Posted by Abagail
Посмотреть сообщение
Could maybe be detected by checking if the player is slowly loosing health, - and near fire particles?
Isn't the only way a player can burn is Explosion? and flamethrower?
they can both be detected
https://sampwiki.blast.hk/wiki/OnPlayerTakeDamage
If i'm wrong, Correct me? :S

& I don't know about Vehicle's explosions. If they burn you or they can be detected


Re: New SA-MP callbacks! - Emmet_ - 02.10.2014

"The weaponid will return 37 (flame thrower) from any fire sources (e.g. molotov, 18)"

I've actually never knew that! I've been using timers to detect this for a while.

I'll add this in the next update, which should be later on today or tomorrow. I'll also be adding a few useful callbacks.


Re: New SA-MP callbacks! - SWGamer - 02.10.2014

Thanks Emmet for the help.Anyway your example.pwn mislead me.
It said to put color instead of hovercolor.


Re: New SA-MP callbacks! - gurmani11 - 02.10.2014

Great work there


Re: New SA-MP callbacks! - Emmet_ - 02.10.2014

Added three new callbacks:

pawn Код:
public OnPlayerBurning(playerid, status)
{
    if (status)
    {
        // Started burning
    }
    else
    {
        // Stopped burning
    }
    return 1;
}

public OnPlayerAiming(playerid, weaponid, status)
{
    if (status)
    {
        // Started aiming
    }
    else
    {
        // Stopped aiming
    }
    return 1;
}

public OnPlayerTakePicture(playerid);
{
    return 1;
}
And these functions:

pawn Код:
stock IsPlayerBurning(playerid);
stock IsPlayerAiming(playerid);
"OnPlayerTakePicture" is called when a player takes a picture with a camera. I was bored so I figured why not add it. It could be useful for roleplay servers too, lol.

Quote:
Originally Posted by SWGamer
Посмотреть сообщение
Thanks Emmet for the help.Anyway your example.pwn mislead me.
It said to put color instead of hovercolor.
Yeah, sorry bout that. I don't usually update "example.pwn" when I update this include.


Re: New SA-MP callbacks! - PMH - 02.10.2014

can u add this callback (though i know its impossible )
pawn Код:
public OnPlayerGetStuntBonus(playerid, money)



Re: New SA-MP callbacks! - Emmet_ - 02.10.2014

It's a difficult challenge but all I have to do is check if stunt bonus is enabled and if the player is in a vehicle. If the player randomly earns money without the usage of GivePlayerMoney, then the function will be called.

I'm gonna try this


Re: New SA-MP callbacks! - Rudy_ - 02.10.2014

Nice, Shouldn't OnPlayerBurning be OnPlayerStartBurning?