12.07.2011, 19:19
The '//' are simply comments. Also, Jay's way should work, but I dont see why you need an 'else if' return statement underneath the public function.
If you simply want when the player is at those positions, simply create another public function.
For future references, use the [PAWN] tags instead of the [CODE]. This way, we can see the code much 'clearer' and can respond easily.
pawn Код:
public IsAtDealership(playerid)
{
if(IsPlayerConnected(playerid))
{
if(PlayerToPoint(20,playerid,883.2045,-1664.6119,13.0577) || PlayerToPoint(20,playerid,2155.4507,-1166.2189,23.3321) || PlayerToPoint(20,playerid,2126.8904,-1139.7179,24.7564) || PlayerToPoint(20,playerid,1667.0667,-1055.6960,23.3974) || PlayerToPoint(20,playerid,549.1564,-1282.5328,16.7654) || PlayerToPoint(20,playerid,1085.9401,-1754.1245,12.8987) || PlayerToPoint(20,playerid,1992.6484,-1278.7939,23.3309) || PlayerToPoint(20,playerid,1838.1348,-1864.8322,13.3828))
{
return 1;
}
}
return 0;
}
pawn Код:
forward YourFunction(playerid)
public YourFunction(playerid)
{
if(IsPlayerConnected(playerid))
{
if(PlayerToPoint(20,playerid,2057.9741,-1913.3403,13.0569) || PlayerToPoint(20,playerid,2516.9893,-1529.9097,23.0431) || PlayerToPoint(20,playerid,2425.1406,-1229.1522,24.4736) || (PlayerToPoint(20,playerid,1658.9684,-1020.9565,23.8984) || PlayerToPoint(20,playerid,1662.3169,-1120.3746,23.9063) || PlayerToPoint(20,playerid,2167.3503,-1801.1819,13.1062) || PlayerToPoint(20,playerid,1942.7716,-2136.1067,13.1914) || PlayerToPoint(20,playerid,1263.4960,-1813.7924,12.9131))
{
return 1;
}
}
return 0;
}