LuxurY я ввел Код:
public GetDistanceBetweenPlayers(playerid,playerid2) //By Slick (Edited by Sacky)
{
new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
new Float:tmpdis;
GetPlayerPos(playerid,x1,y1,z1);
GetPlayerPos(playerid2,x2,y2,z2);
tmpdis = floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
return floatround(tmpdis);
}
и
Код:
public GetClosestPlayer(playerid) //By Slick
{
new x,Float:dis,Float:dis2,player;
new pteam[MAX_PLAYERS];
player = -1;
dis = 99999.99;
for (x=0;x<MAX_PLAYERS;x++){
if (x != playerid){
dis2 = GetDistanceBetweenPlayers(x,playerid);
if (dis2 < dis && dis2 != -1.00 && pteam[x] == pteam[playerid]){
dis = dis2;
player = x;
}}}
return player;
}
а мне выдает предупреждение:
E:\Games\GTA_San_Andreas\gamemodes\new.pwn(142) : warning 235: public function lacks forward declaration (symbol "GetDistanceBetweenPlayers")
E:\Games\GTA_San_Andreas\gamemodes\new.pwn(152) : warning 235: public function lacks forward declaration (symbol "GetClosestPlayer")
Как исправить?
Отредактировано Ramzes (2007-10-31 23:11:37)