SA-MP Forums Archive
Tuning anticheat - 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: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Discussion (https://sampforum.blast.hk/forumdisplay.php?fid=84)
+---- Thread: Tuning anticheat (/showthread.php?tid=610443)



Tuning anticheat - TheMallard - 24.06.2016

Hello! We can create an array of prices for all tuning details, so we can put a check at OnVehicleMod, like:

PHP Code:
if(GetPlayerInterior(playerid) == 0) return 0;
if(!
IsValidComponent(componentid) return 0;
if(
GetPlayerMoney(playerid) < GetComponentPrice(componentid)) return 0
Where can I find GetComponentPrice function with singleplayer prices?


Re: Tuning anticheat - CodeStyle175 - 24.06.2016

http://pastebin.com/cT8uc7PA


Re: Tuning anticheat - Vince - 24.06.2016

Quote:
Originally Posted by CodeStyle175
View Post
Alright, an optimization challenge. I like it. Will post back.

EDIT: same script, different approach.

PHP Code:
stock GetComponentPrice(componentid)
{
    static const 
COMPONENT_PRICES[] = {
        
40055020025010015080500200500
        1000
220250100400500200500350300
        250
200150350501000480480770680
        37
370170120790150500690190390
        500
3901000500500510710670530810
        620
670530130210230520430620720
        530
180250430830850750250200550
        450
550450100010309801560162012001030
        1000
1230820156013507701001500150650
        450
100750350450350100062011401000
        940
7808303250161015407807807801610
        1540
, -1, -133403250213020502130780940
        780
94078086078011203340325033401650
        3380
3290159083080015001000800580470
        870
9801501501001004906008901000
        1090
8409101200103010309209305501050
        1050
950650550450850950850950970
        880
9909009501000900100090020502150
        2130
205021302040215020402095217520802200
        1200
10409401100
    
};
    
    new 
index componentid 1000;
    
    if(!(
<= index sizeof(COMPONENT_PRICES)))
        return -
1;
    
    return 
COMPONENT_PRICES[index];

Not tested. I can't be held liable for any pricing error, I took them directly from the other script.


Re: Tuning anticheat - TheMallard - 30.06.2016

Thank you very much!