SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 30/06/2015, 04:49 PM   #1
VenomMancer
Gangsta
 
VenomMancer's Avatar
 
Join Date: May 2013
Location: Indonesia (Manado)
Posts: 637
Reputation: 28
Red face Looking for anti Troll car


Hello guys.
In my server have player with troll cheat.
the cheat is make player who in vehicle will flying up.
Who know how to stop it ?

#sorryformybadenglish
VenomMancer is offline   Reply With Quote
Old 30/06/2015, 05:01 PM   #2
Suicidal.Banana
Big Clucker
 
Join Date: Jul 2007
Posts: 137
Reputation: 26
Default Re: Looking for anti Troll car

Ban the player.

In all seriousness, you prolly cant detect what player is doing it, because they're not doing it trough a route that SA-MP provides, so you have no way of knowing what playerid initiated movement on a vehicle.

Maybe you can get a bit more pleasing awnser in some of the anti-cheat thread's floating around, there might actually be a way to detect, personally, i dont know of any.

Oh and your English is fine, making your entire post bold is kinda useless though :P
Suicidal.Banana is offline   Reply With Quote
Old 30/06/2015, 06:20 PM   #3
Ritzy2K
High-roller
 
Ritzy2K's Avatar
 
Join Date: Jun 2014
Location: India
Posts: 1,548
Reputation: 170
Unhappy Re: Looking for anti Troll car

Its remote jacking.. I dont think you can script an anti cheat against it..ban em.
__________________
Ritzy2K is offline   Reply With Quote
Old 30/06/2015, 06:50 PM   #4
Suicidal.Banana
Big Clucker
 
Join Date: Jul 2007
Posts: 137
Reputation: 26
Default Re: Looking for anti Troll car

Hmm, remote jacking as in carjacking? where multiple players are in the driver seat of a vehicle?
Then you could actually detect it:

0] Make an array in which you can store player-vehicle pairs. (for example using playerid as key and vehicleid as value)
1] Make a function that loops trough all the connected players
2] In that function, check if they're in a vehicle, if they are, check if they are in the driver-seat
3] If they are in driver-seat, loop trough the array from step 0, check to make sure no other player is registered as driver
4] If no other player is registered as the driver of said vehicle, store the player-vehicle pair in the array
5] BUT, if there is another player registered as the driver of said vehicle, the new player is actually a cheating son of a beach

Do take into consideration things like quits, deaths etc, make sure you handle those events, so that your player-vehicle array pairs are always correct. (and you dont end up banning people who you think have cheated, while its actually down to old data in said array)
Suicidal.Banana is offline   Reply With Quote
Old 30/06/2015, 07:00 PM   #5
Abagail
High-roller
 
Join Date: Dec 2013
Location: GetPlayerPos(playerid, pos); Scripter/Mapper.
Posts: 3,141
Reputation: 445
Default Re: Looking for anti Troll car

The SA-MP data wouldn't report multiple drivers, I don't believe. But the troll modification doesn't call OnPlayerEnterVehicle for the vehicle, but it will show up as a state change, there is no need for any type of looping to detect the cheat.

pawn Code:
#include <a_samp>
new playerEnteringVehicle[MAX_PLAYERS];

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    playerEnteringVehicle[playerid] = vehicleid;
    return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
    {
        if(playerEnteringVehicle[playerid] == INVALID_VEHICLE_ID || playerEnteringVehicle[playerid] != GetPlayerVehicleID(playerid)) {
            // most likely warp hacked
            return 1;
        }
       
        playerEnteringVehicle[playerid] = INVALID_VEHICLE_ID;
        return 1;
    }
   
    return 1;
}

public OnPlayerDisconnect(playerid, reason) {
    playerEnteringVehicle[playerid] = INVALID_PLAYER_ID;
    return 1;
}

stock PutPlayerInVehicleEx(playerid, vehicleid, seatid)
{
    if(vehicleid != INVALID_VEHICLE_ID && seatid != 128)
    {
        playerEnteringVehicle[playerid] = vehicleid;
    }
   
    PutPlayerInVehicle(playerid, vehicleid, seatid);
   
    return 1;
}

#if defined _ALS_PutPlayerInVehicle
  #undef PutPlayerInVehicle
#else
#define _ALS_PutPlayerInVehicle
#endif
#define PutPlayerInVehicle PutPlayerInVehicleEx

This should work in detecting warp hackers.
Abagail 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
Looking for anti Troll Car , aimbot jesdynguyen Scripting Help 4 04/03/2019 09:04 AM
Anti-troll hacking Banditukas Scripting Help 7 17/10/2015 06:57 PM
Anti car troll TheWay Scripting Help 4 24/01/2015 07:38 AM
How to stop troll car , i need some anti code please jesdynguyen Scripting Help 7 12/05/2014 11:02 AM


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


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