Advertisement
Johurt

[TEST] dynamic area

Feb 5th, 2016
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.90 KB | None | 0 0
  1. CMD:test(playerid, params[])
  2. {
  3.     new Float:vPos[8], Float:coo[4], Float:x, Float:y, Float:a, vehicleid;
  4.     if(sscanf(params, "d", vehicleid)) return SendClientMessage(playerid, -1, ": /test [id]");
  5.     GetCoordBootVehicle(vehicleid, x, y, a);
  6.     GetVehicleZAngle(vehicleid, a);
  7.     // priekis
  8.     vPos[0] = x;
  9.     vPos[1] = y;
  10.     // galas
  11.     vPos[2] = x + (1.0 * floatsin(-a, degrees));
  12.     vPos[3] = y + (1.0 * floatcos(-a, degrees));
  13.  
  14.     a += 90.0;
  15.     // į kairę
  16.     vPos[4] = x + (0.5 * floatsin(-a, degrees));
  17.     vPos[5] = y + (0.5 * floatcos(-a, degrees));
  18.     // į dešinę
  19.     vPos[6] = x - (0.5 * floatsin(-a, degrees));
  20.     vPos[7] = y - (0.5 * floatcos(-a, degrees));
  21.    
  22.     MakeToMeMinxMinyMaxxMaxy(vPos[0], vPos[2], vPos[4], vPos[6], vPos[1], vPos[3], vPos[5], vPos[7], coo[0], coo[1], coo[2], coo[3]);
  23.     if(PlayerInZone(playerid, coo[0], coo[1], coo[2], coo[3])) SendClientMessage(playerid, -1, "(y)");
  24.     return 1;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement