#define PRESSED(%0) \\
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (PRESSED(GOMB))
{
if(HaAzAdottHelyekenVan(playerid))
{
//mit csináljon
}
}
return 1;
}
forward HaAzAdottHelyekenVan(playerid);
public HaAzAdottHelyekenVan(playerid)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInRangeOfPoint(playerid, tavolsag, koordinata1, koordinata2, koordinata3)) return 1;
else if(IsPlayerInRangeOfPoint(playerid, tavolsag, koordinata1, koordinata2, koordinata3)) return 1;
else if(IsPlayerInRangeOfPoint(playerid, tavolsag, koordinata1, koordinata2, koordinata3)) return 1;
else if(IsPlayerInRangeOfPoint(playerid, tavolsag, koordinata1, koordinata2, koordinata3)) return 1;
else if(IsPlayerInRangeOfPoint(playerid, tavolsag, koordinata1, koordinata2, koordinata3)) return 1;
}
return 0;
}
Gombokat itt találod:
http://wiki.sa-mp.com/wiki/GetPlayerKeys#Key_List