Sziasztok,
Ismét info órán vagyok, és unalmamban összedobtam egy kódot, ami megvizsgáltja, hogy a játékos kaja/pia automatát használ, vagy annak a közelében van-e.
(A koordináták wiki.sa-mp.com-ról vannak)
Anti élet hack-re alkalmas.
Példaszkript:
new Float:phealth[MAX_PLAYERS],
bool:sethealthing[MAX_PLAYERS] = false;
stock SetPlayerHealthEx(playerid, Float:hp)
{
sethealthing[playerid] = true;
SetPlayerHealth(playerid, hp);
sethealthing[playerid] = false;
return 1;
}
CMD:setmyhp100(playerid)
{
SetPlayerHealth(playerid, 100);
return 1;
}
CMD:setmyhp100ex(playerid)
{
SetPlayerHealthEx(playerid, 100);
return 1;
}
public OnPlayerUpdate(playerid)
{
new Float:healthh;
GetPlayerHealth(playerid,healthh);
if(healthh > phealth[playerid] && !IsPlayerUseVendingMachine(playerid) && sethealthing[playerid] == false)BanEx(playerid,\"Health Cheat\");
phealth[playerid] = healthh;
}
Ha a játékos életet csítel vagy beírja a setmyhp100 parancsot, akkor bant kap. A setmyhp100ex parancsnál nem kap bant, mivel a SetPlayerHealthEx funkciót használja.
Itt a kód:
new VendingMachines[][] =
{
{-14.70000000,1175.36000000,18.95000000},
{201.02000000,-107.62000000,0.90000000},
{662.43000000,-552.16000000,15.71000000},
{-76.03000000,1227.99000000,19.13000000},
{1154.73000000,-1460.89000000,15.16000000},
{1277.84000000,372.52000000,18.95000000},
{1398.84000000,2222.61000000,10.42000000},
{1520.15000000,1055.27000000,10.00000000},
{1634.11000000,-2237.53000000,12.89000000},
{1659.46000000,1722.86000000,10.22000000},
{1729.79000000,-1943.05000000,12.95000000},
{1789.21000000,-1369.27000000,15.16000000},
{1928.73000000,-1772.45000000,12.95000000},
{2060.12000000,-1897.64000000,12.93000000},
{2085.77000000,2071.36000000,10.45000000},
{2139.52000000,-1161.48000000,23.36000000},
{2153.23000000,-1016.15000000,62.23000000},
{2271.73000000,-76.46000000,25.96000000},
{2319.99000000,2532.85000000,10.22000000},
{2325.98000000,-1645.13000000,14.21000000},
{2352.18000000,-1357.16000000,23.77000000},
{2480.86000000,-1959.27000000,12.96000000},
{2503.14000000,1243.70000000,10.22000000},
{-253.74000000,2597.95000000,62.24000000},
{-253.74000000,2599.76000000,62.24000000},
{2647.70000000,1129.66000000,10.22000000},
{2845.73000000,1295.05000000,10.79000000},
{-862.83000000,1536.61000000,21.98000000},
{-1350.12000000,492.29000000,10.59000000},
{-1350.12000000,493.86000000,10.59000000},
{-1455.12000000,2591.66000000,55.23000000},
{-1980.79000000,142.66000000,27.07000000},
{-2005.65000000,-490.05000000,34.73000000},
{-2011.14000000,-398.34000000,34.73000000},
{-2034.46000000,-490.05000000,34.73000000},
{-2039.85000000,-398.34000000,34.73000000},
{-2063.27000000,-490.05000000,34.73000000},
{-2068.56000000,-398.34000000,34.73000000},
{-2092.09000000,-490.05000000,34.73000000},
{-2097.27000000,-398.34000000,34.73000000},
{-2118.62000000,-422.41000000,34.73000000},
{-2118.97000000,-423.65000000,34.73000000},
{-2229.19000000,286.41000000,34.70000000},
{-2420.18000000,985.95000000,44.30000000},
{-2420.22000000,984.58000000,44.30000000},
{2155.84000000,1607.88000000,1000.06000000},
{2155.91000000,1606.77000000,1000.05000000},
{2202.45000000,1617.01000000,1000.06000000},
{2209.24000000,1621.21000000,1000.06000000},
{2209.91000000,1607.20000000,1000.05000000},
{2222.20000000,1606.77000000,1000.05000000},
{2222.37000000,1602.64000000,1000.06000000},
{2225.20000000,-1153.42000000,1025.91000000},
{-15.10000000,-140.23000000,1003.63000000},
{-16.12000000,-91.64000000,1003.63000000},
{-16.53000000,-140.30000000,1003.63000000},
{-17.55000000,-91.71000000,1003.63000000},
{-19.04000000,-57.84000000,1003.63000000},
{-32.45000000,-186.70000000,1003.63000000},
{-33.88000000,-186.77000000,1003.63000000},
{330.68000000,178.50000000,1020.07000000},
{331.92000000,178.50000000,1020.07000000},
{-35.73000000,-140.23000000,1003.63000000},
{350.91000000,206.09000000,1008.48000000},
{-36.15000000,-57.88000000,1003.63000000},
{361.56000000,158.62000000,1008.48000000},
{371.59000000,178.45000000,1020.07000000},
{373.83000000,-178.14000000,1000.73000000},
{374.89000000,188.98000000,1008.48000000},
{379.04000000,-178.88000000,1000.73000000},
{495.97000000,-24.32000000,1000.73000000},
{500.56000000,-1.37000000,1000.73000000},
{501.83000000,-1.43000000,1000.73000000},
{2576.70000000,-1284.43000000,1061.09000000}
};
stock IsPlayerUseVendingMachine(playerid)
{
if(IsPlayerInRangeofVendingMachine(playerid,1.0))
{
new animlib[32];
new animname[32];
GetAnimationName(GetPlayerAnimationIndex(playerid),animlib,32,animname,32);
if((!strcmp(animlib,\"vending\",true)) && (!strcmp(animname,\"VEND_Drink2_P\",true) || !strcmp(animname,\"VEND_Drink_P\",true) || !strcmp(animname,\"vend_eat1_P\",true) || !strcmp(animname,\"VEND_Eat_P\",true) || !strcmp(animname,\"VEND_Use\",true) || !strcmp(animname,\"VEND_Use_pt2\",true)))return 1;
}
return 0;
}
stock IsPlayerInRangeOfVendingMachine(playerid,Float:range)
{
for(new i; i < sizeof(VendingMachines); i++)if(IsPlayerInRangeOfPoint(playerid, range,VendingMachines[0],VendingMachines[1],VendingMachines[2]))return 1;
return 0;
}