10.11.2014, 00:39
(
Последний раз редактировалось ForT; 10.11.2014 в 12:19.
)
Anti AirBreak/Teleport
A pedido de um amigo, fiz essa include que detecta quando um player usa AirBreak ou Teleport!
Video de demonstraзгo:
[ame]www.youtube.com/watch?v=ODhcGtKKKpo[/ame]
Gamemode testado:
pawn Код:
#include <a_samp>
#include <AntiAirbreak>
#include <zcmd>
main()
{}
new Float:randomPos[][] =
{
{-2237.6675,2353.6357,4.9804}, // 1
{-2244.4297,2382.6162,5.0651}, // 2
{-2280.8123,2288.3540,4.9592}, // 3
{-2349.1038,2422.4600,7.3348}, // 4
{-2379.6294,2443.7397,10.1694}, // 5
{-2386.5432,2446.7439,10.1694}, // 6
{-2408.1724,2454.0754,13.0031}, // 7
{-2472.1128,2450.4846,17.3230}, // 8
{-2479.6860,2449.3577,17.3230}, // 9
{-2422.2366,2492.0024,13.1417}, // 10
{-2446.1724,2491.9753,15.3203}, // 11
{-2464.5906,2490.5576,16.8125}, // 12
{-2478.8467,2488.8369,18.2300}, // 13
{-2446.7429,2512.4402,15.7003}, // 14
{-2479.0059,2508.9224,17.7910}, // 15
{-2381.9663,2407.1270,8.8858}, // 16
{-2420.4670,2406.6948,13.0409}, // 17
{-2482.6694,2406.4666,17.1154}, // 18
{-2437.3914,2353.8271,4.9609}, // 19
{-2455.5942,2254.1738,4.9807}, // 20
{-2485.4236,2272.1384,4.9844}, // 21
{-2493.9551,2272.2332,4.9537}, // 22
{-2485.5320,2288.5393,4.9844}, // 23
{-2493.8901,2288.4854,4.9844}, // 24
{-2510.8262,2276.7490,4.9844}, // 25
{-2520.0254,2281.3076,4.9844}, // 26
{-2523.5359,2239.6621,5.3671}, // 27
{-2551.8118,2267.2979,5.4490}, // 28
{-2537.5444,2319.4932,4.9844}, // 29
{-2518.5354,2320.1204,4.9844}, // 30
{-2501.3713,2319.2898,4.9844}, // 31
{-2478.4834,2318.5718,4.9844}, // 32
{-2491.0913,2363.3721,10.2724}, // 33
{-2519.1113,2339.8892,4.9844}, // 34
{-2522.5203,2339.7744,4.9844}, // 35
{-2538.6680,2339.7317,4.9798}, // 36
{-2542.5051,2339.8647,4.9796}, // 37
{-2582.4805,2300.4995,7.0029}, // 38
{-2583.2078,2308.0552,7.0029}, // 39
{-2626.8638,2283.4148,8.3086}, // 40
{-2626.3899,2292.0630,8.3048}, // 41
{-2626.1743,2309.9878,8.3031}, // 42
{-2626.2063,2318.3826,8.3033}, // 43
{-2636.8171,2334.5730,8.4725}, // 44
{-2636.2891,2351.8054,8.5170}, // 45
{-2632.4487,2375.7893,9.0227}, // 46
{-2634.8933,2402.7507,11.2624}, // 47
{-2633.4346,2410.8716,13.9902}, // 48
{-2598.1265,2357.0999,9.8830}, // 49
{-2598.0171,2364.6636,9.8830} // 50
};
public OnPlayerConnect(playerid)
{
return 1;
}
public OnPlayerAirBreak(playerid){
SendClientMessage(playerid, 0xFF0000FF, " - AirBreak/Teleport detectado !");
return 1;
}
command(tele, playerid, params[]){
new
rdon = random(sizeof(randomPos))
;
SetPlayerPos(playerid, randomPos[rdon][0], randomPos[rdon][1], randomPos[rdon][2]);
return 1;
}
public OnPlayerSpawn(playerid)
{
SetPlayerInterior(playerid,0);
TogglePlayerClock(playerid,0);
return 1;
}
SetupPlayerForClassSelection(playerid)
{
SetPlayerInterior(playerid,14);
SetPlayerPos(playerid,258.4893,-41.4008,1002.0234);
SetPlayerFacingAngle(playerid, 270.0);
SetPlayerCameraPos(playerid,256.0815,-43.0475,1004.0234);
SetPlayerCameraLookAt(playerid,258.4893,-41.4008,1002.0234);
}
public OnPlayerRequestClass(playerid, classid)
{
SetupPlayerForClassSelection(playerid);
return 1;
}
public OnGameModeInit()
{
AddPlayerClass(265,1958.3783,1343.1572,15.3746,270.1425,0,0,0,0,-1,-1);
return 1;
}
Salve o arquivo na sua pasta de includes
Depois coloque no seu GameMode:
pawn Код:
//No topo
#include <AntiAirbreak>
//No fim
public OnPlayerAirBreak(playerid)
{
SendClientMessage(playerid, 0xFF0000FF, " - AirBreak/Teleport detectado !");
return 1;
}
Include - Foreach, By: ******
Download:
http://pastebin.com/LvXBJDHB