03.04.2015, 19:02
i added stock "SetPosInFrontOfPlayer"
no problem with this i added
and i get warning in this stock , i was not geted warning before
this line
Full code
no problem with this i added
Код:
SetPPos(playerid,Float:X,Float:Y,Float:Z) return TeleportTime[playerid] = 5,SetPlayerPos(playerid,X,Y,Z); stock SetPosInFrontOfPlayer(playerid,giveplayerid,Float:distance) { new Float:x,Float:y,Float:z,Float:a; GetPlayerPos(playerid, x, y,z); GetPlayerFacingAngle(playerid, a); x += (distance * floatsin(-a, degrees)); y += (distance * floatcos(-a, degrees)); SetPPos(giveplayerid,x,y,z); SetPlayerFacingAngle(giveplayerid,a); return true; }
pawn Код:
Float:Distance
Full code
pawn Код:
stock GetClosestPlayer(const playerid) {
new
Float:Distance,
target = -1;
foreach(Player, i) {
if (playerid != i && playerVariables[i][pSpectating] == INVALID_PLAYER_ID && (target < 0 || Distance > GetDistanceBetweenPlayers(playerid, i))) {
target = i;
Distance = GetDistanceBetweenPlayers(playerid, i);
}
}
return target;
}