Advertisement
vasya092

Untitled

May 27th, 2022
441
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. stock InitialBoxPosition(playerid)
  2. {
  3.     new
  4.         Float:x,
  5.         Float:y,
  6.         Float:z,
  7.         Float:r;
  8.  
  9.    
  10.     new currentBuild = currentBuildId[playerid]
  11.  
  12.     GetPlayerFacingAngle(playerid, r);
  13.     GetPlayerPos(playerid, x,y,z);
  14.  
  15.     builds[currentBuild][buildPosx] = x + (0.7 * floatsin(-r, degrees));
  16.     builds[currentBuild][buildPosy] = y + (0.7 * floatcos(-r, degrees));
  17.     builds[currentBuild][buildPosz] = z-0.64;
  18.     for(new i=0;i<MAX_BUILDS;i++)
  19.     {
  20.         if(builds[i][buildtype] == BUILD_TYPE_BOX && i != currentBuild)
  21.         {
  22.             if(floatsqroot(floatpower(builds[i][buildPosx] - builds[currentBuild][buildPosx], 2) + floatpower(builds[i][buildPosy] -            builds[currentBuild][buildPosy], 2) + floatpower(builds[i][buildPosz] - builds[currentBuild][buildPosz]-0.64, 2)) < 0.81)
  23.             {
  24.                 builds[currentBuild][buildPosz] = z+0.03;
  25.                 break;
  26.             }
  27.         }
  28.     }
  29.     SetDynamicObjectPos(builds[currentBuild][buildings], builds[currentBuild][buildPosx], builds[currentBuild][buildPosy], builds[currentBuild][buildPosz]);
  30.     UpdateBuildsState(currentBuild);
  31.     SaveQuery(builds[currentBuild][buildPosx],builds[currentBuild][buildPosy],builds[currentBuild][buildPosz],builds[currentBuild][buildID])
  32.     Streamer_Update(playerid);
  33.     return 1;
  34. }
Advertisement
RAW Paste Data Copied
Advertisement