Tuning anticheat
#1

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?
Reply
#2

http://pastebin.com/cT8uc7PA
Reply
#3

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.
Reply
#4

Thank you very much!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)