Skripta koju koristim: Moja od 0
Detaljan opis problema: Znaci ova funkcija radi samo ako je targetid = 0 znaci samo radi na ID-u 0...ISto tako probao sam još nekoliko funkcija koje rade na isti princip ali opet radi samo na IDu 0...
Dio skripte: stock GetXYInFrontOfPoint(&Float:x, &Float:y, Float:angle, Float:distance) {
x += (distance * floatsin(-angle, degrees));
y += (distance * floatcos(-angle, degrees));
}
stock IsPlayerAimingAt(playerid, Float:x, Float:y, Float:z, Float:radius) {
new Float:camera_x,Float:camera_y,Float:camera_z,Float:vector_x,Float:vector_y,Float:vector_z;
GetPlayerCameraPos(playerid, camera_x, camera_y, camera_z);
GetPlayerCameraFrontVector(playerid, vector_x, vector_y, vector_z);
new Float:vertical, Float:horizontal;
switch (GetPlayerWeapon(playerid)) {
case 34,35,36: {
if (DistanceCameraTargetToLocation(camera_x, camera_y, camera_z, x, y, z, vector_x, vector_y, vector_z) < radius) return true;
return false;
}
case 30,31: {vertical = 4.0; horizontal = -1.6;}
case 33: {vertical = 2.7; horizontal = -1.0;}
default: {vertical = 6.0; horizontal = -2.2;}
}
new Float:angle = GetPointAngleToPoint(0, 0, floatsqroot(vector_x*vector_x+vector_y*vector_y), vector_z) - 270.0;
new Float:resize_x, Float:resize_y, Float:resize_z = floatsin(angle+vertical, degrees);
GetXYInFrontOfPoint(resize_x, resize_y, GetPointAngleToPoint(0, 0, vector_x, vector_y)+horizontal, floatcos(angle+vertical, degrees));
if (DistanceCameraTargetToLocation(camera_x, camera_y, camera_z, x, y, z, resize_x, resize_y, resize_z) < radius) return true;
return false;
}
stock IsPlayerAimingAtPlayer(playerid, targetplayerid) {
new Float:x, Float:y, Float:z;
GetPlayerPos(targetplayerid, x, y, z);
return IsPlayerAimingAt(playerid, x, y, z, 1.1);
}
formatiras u foreach
Hvala :D
Rješeno
lock , problem resen