SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts

Reply
 
Thread Tools Display Modes
Old 13/07/2013, 01:40 PM   #1
bartekdvd
Big Clucker
 
Join Date: Jul 2011
Posts: 54
Reputation: 99
Default Anti-(Player)Crasher

pawn Code:
#define FILTERSCRIPT

#include <a_samp>
 
//Anti-(Player)Crasher  0.3x
//by bartekdvd
public OnPlayerUpdate(playerid)
{
    if (GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
    {
        new Float:vec[3];
        GetPlayerCameraFrontVector(playerid, vec[0], vec[1], vec[2]);
        new bool:possible_crasher = false;
        for (new i = 0; !possible_crasher && i < sizeof(vec); i++)
            if (floatabs(vec[i]) > 10.0)
                possible_crasher = true;
       
        if (possible_crasher)
            return 0; //do not send fake data, prevents crash
    }

    return 1;
}

Q: What is the issue?
A: The attacker sends modified aiming information like bad camera front vector or/and bad camera position. If attacker wants to crash his victim he needs to switch to some melee weapon and press secondary attack key.

Q: What is the range of attack?
A: If attacker is only streamed for some player he can crash him.

Q: Can you send me this crasher program?
A: Nope.

Probably most of you didn't know about this issue.

DOWNLOAD: http://pastebin.com/egd2RdYt

Last edited by bartekdvd; 11/08/2013 at 08:14 PM.
bartekdvd is offline   Reply With Quote
Old 13/07/2013, 03:19 PM   #2
ahmad95
Big Clucker
 
ahmad95's Avatar
 
Join Date: Dec 2012
Posts: 162
Reputation: -12
Default Re: Anti-(Player)Crasher

EDIT: Tried, yes truely random kick. gonna remove it.
__________________

Last edited by ahmad95; 14/07/2013 at 03:36 AM.
ahmad95 is offline   Reply With Quote
Old 15/07/2013, 07:15 PM   #3
bartekdvd
Big Clucker
 
Join Date: Jul 2011
Posts: 54
Reputation: 99
Default Re: Anti-(Player)Crasher

If someone could test it now whether it randomly kicks normal players or not I would be really grateful.
bartekdvd is offline   Reply With Quote
Old 15/07/2013, 07:36 PM   #4
iJumbo
High-roller
 
iJumbo's Avatar
 
Join Date: Sep 2009
Location: HEX 69 74 61 6C 79
Posts: 2,175
Reputation: 136
Default Re: Anti-(Player)Crasher

Try use a larger value
__________________

Need a VPS? Get it here!
Website designer & developer php, html, css, html5, javascript
iJumbo is offline   Reply With Quote
Old 15/07/2013, 10:30 PM   #5
Dopefull
Big Clucker
 
Dopefull's Avatar
 
Join Date: Mar 2013
Location: Denmark
Posts: 167
Reputation: 4
Default Re: Anti-(Player)Crasher

So you made a mod that starts with S***** which is not allowed to say on this forum and you are patching some of its features?
Dopefull is offline   Reply With Quote
Old 15/07/2013, 10:36 PM   #6
Konstantinos
Spam Machine
 
Konstantinos's Avatar
 
Join Date: Dec 2011
Posts: 11,844
Reputation: 1399
Default Re: Anti-(Player)Crasher

Quote:
Originally Posted by Dopefull View Post
So you made a mod that starts with S***** which is not allowed to say on this forum and you are patching some of its features?
Did you read the word "Anti" before the rest of the title? I don't think so.
__________________
Life is like riding a bicycle. To keep your balance, you must keep moving.

[Tutorial] How to use SQLite
[FilterScript] Tune System
Konstantinos is offline   Reply With Quote
Old 16/07/2013, 12:31 PM   #7
Dopefull
Big Clucker
 
Dopefull's Avatar
 
Join Date: Mar 2013
Location: Denmark
Posts: 167
Reputation: 4
Default Re: Anti-(Player)Crasher

Quote:
Originally Posted by _Zeus View Post
Did you read the word "Anti" before the rest of the title? I don't think so.
Did you read the last part of my message?

Code:
and you are patching some of its features?
I was referring to that he has made a crasher once ( go find that one for yourself ) and now he's patching it, just seems funny

On topic: seems as a good filterscript good job
Dopefull is offline   Reply With Quote
Old 11/08/2013, 11:51 AM   #8
Lorenc_
High-roller
 
Lorenc_'s Avatar
 
Join Date: Jan 2010
Location: Australia
Posts: 3,800
Reputation: 1160
Default Re: Anti-(Player)Crasher

God bless.
__________________
Join the best Cops And Robbers in SA-MP, today. svr.sfcnr.com:7777

Lorenc_ is offline   Reply With Quote
Old 11/08/2013, 12:15 PM   #9
IstuntmanI
High-roller
 
IstuntmanI's Avatar
 
Join Date: Mar 2009
Location: Romania
Posts: 1,801
Reputation: 375
Default Re: Anti-(Player)Crasher

I didn't knew about this problem...

Isn't this better:
pawn Code:
public OnPlayerUpdate(playerid)
{
    if (GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
    {
        new Float:vec[3];
        GetPlayerCameraFrontVector(playerid, vec[0], vec[1], vec[2]);
        for (new i = 0; i < sizeof(vec); i++)
            if (floatabs(vec[i]) > 10.0)
                return 0;
    }

    return 1;
}
(one less variable xD) ?
__________________


IstuntmanI is offline   Reply With Quote
Old 11/08/2013, 04:18 PM   #10
bartekdvd
Big Clucker
 
Join Date: Jul 2011
Posts: 54
Reputation: 99
Default Re: Anti-(Player)Crasher

Quote:
Originally Posted by IstuntmanI View Post
I didn't knew about this problem...

Isn't this better:
pawn Code:
public OnPlayerUpdate(playerid)
{
    if (GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
    {
        new Float:vec[3];
        GetPlayerCameraFrontVector(playerid, vec[0], vec[1], vec[2]);
        for (new i = 0; i < sizeof(vec); i++)
            if (floatabs(vec[i]) > 10.0)
                return 0;
    }

    return 1;
}
(one less variable xD) ?
Yes it is less code, but I've made this one more variable named "possible_crasher" in order to point out that it MAY be crasher not MUST be.

This code is now more like anti-corrupted-aim-sync-data-something.
With this you can't be 100% sure that it is crasher, because sa-mp client sends sometimes, with no reason, corrupted front camera vector, so the best thing you can do is stop sending that data to the other players.

Your players are 100% safe now. No more crash and no more kick.
bartekdvd is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Pedido] Anti-Crasher teteu99 PortuguÍs/Portuguese 3 08/06/2013 07:16 AM
Anti Crasher Help ME ofekw2 Scripting Help 13 01/02/2013 12:16 PM
[Pedido] Anti server crasher aldair8 PortuguÍs/Portuguese 1 19/11/2012 11:54 PM


All times are GMT. The time now is 11:41 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.