05.06.2017, 16:16
(
Последний раз редактировалось AroseKhanNiazi; 05.06.2017 в 22:56.
Причина: fixed
)
I am trying to check if player in point of range of the dropped weapon;
This doesn't work.
I tried some debugging and I get odd results;
result:
Other info;
Код:
if(IsPlayerInRangeOfPoint(playerid,2.5,DropsInfo[i][wp_x][k],DropsInfo[i][wp_y][k],DropsInfo[i][wp_z][k])) { print("Player Is in range.");
I tried some debugging and I get odd results;
Код:
FUNCTION Drops_ReplaceIt(playerid) { new Float:x,Float:y,Float:z; GetPlayerPos(playerid,x,y,z); printf("Replace weapon called for %d",playerid); for(new i=0,j=GetPlayerPoolSize(); i<=j; i++) { if(!IsPlayerConnected(i)) continue; printf("Checking player %d's drops",i); for(new k=0; k<13; k++) { printf("Checking the info of Dropped (%b) %0.2f %0.2f %0.2f",DropsInfo[i][wp_Dropped][k],DropsInfo[i][wp_x][k],DropsInfo[i][wp_y][k],DropsInfo[i][wp_z][k]); if(DropsInfo[i][wp_Dropped][k]) { print("Drop is dropped."); printf("Player pos %0.2f %0.2f %0.2f",x,y,z); printf("Distance is %0.2f",GetPlayerDistanceFromPoint(playerid, DropsInfo[i][wp_x][k],DropsInfo[i][wp_y][k],DropsInfo[i][wp_z][k])); if(((x+2.5 >= DropsInfo[i][wp_x][k] && x+2.6 <= DropsInfo[i][wp_x][k]) || (x-2.5 >= DropsInfo[i][wp_x][k] && x-2.6 <= DropsInfo[i][wp_x][k])) && ((y+2.5 >= DropsInfo[i][wp_y][k] && y+2.6 <= DropsInfo[i][wp_y][k]) || (y-2.5 >= DropsInfo[i][wp_y][k] && y-2.6 <= DropsInfo[i][wp_y][k])) && ((z+2.5 >= DropsInfo[i][wp_z][k] && z+2.6 <= DropsInfo[i][wp_z][k]) || (z-2.5 >= DropsInfo[i][wp_x][k] && z-2.6 <= DropsInfo[i][wp_z][k]))) { printf("Fucking Shit works somehow"); } if(IsPlayerInRangeOfPoint(playerid,2.5,DropsInfo[i][wp_x][k],DropsInfo[i][wp_y][k],DropsInfo[i][wp_z][k])) { print("Player Is in range.");
Код:
Replace weapon called for 0 [18:01:10] Checking player 0's drops [18:01:10] Checking the info of Dropped (0) 0.00 0.00 0.00 [18:01:10] Checking the info of Dropped (0) 0.00 0.00 0.00 [18:01:10] Checking the info of Dropped (0) 0.00 0.00 0.00 [18:01:10] Checking the info of Dropped (0) 0.00 0.00 0.00 [18:01:10] Checking the info of Dropped (0) 0.00 0.00 0.00 [18:01:10] Checking the info of Dropped (0) 0.00 0.00 0.00 [18:01:10] Checking the info of Dropped (0) 0.00 0.00 0.00 [18:01:10] Checking the info of Dropped (0) 0.00 0.00 0.00 [18:01:10] Checking the info of Dropped (0) 0.00 0.00 0.00 [18:01:10] Checking the info of Dropped (0) 0.00 0.00 0.00 [18:01:10] Checking the info of Dropped (0) 0.00 0.00 0.00 [18:01:10] Checking the info of Dropped (0) 0.00 0.00 0.00 [18:01:10] Checking the info of Dropped (0) 0.00 0.00 0.00 [18:01:10] Checking player 1's drops [18:01:10] Checking the info of Dropped (0) 0.00 0.00 0.00 [18:01:10] Checking the info of Dropped (0) 0.00 0.00 0.00 [18:01:10] Checking the info of Dropped (0) 0.00 0.00 0.00 [18:01:10] Checking the info of Dropped (1) 2901.58 2097.20 10.82 [18:01:10] Drop is dropped. [18:01:10] Player pos 2901.48 2097.05 10.82 [18:01:10] Distance is 1970902656.00 [18:01:10] Checking the info of Dropped (0) 0.00 0.00 0.00 //....
Код:
enum wpdrops_enum { bool:wp_Dropped, wp_id, wp_weapon, wp_ammo, Float:wp_x, Float:wp_y, Float:wp_z, wp_slot }; new DropsInfo[MAX_PLAYERS][wpdrops_enum][13];