G2A Many GEOs
SHARE
TWEET

Untitled

a guest Apr 3rd, 2020 140 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CMD:sethousepos(playerid, params[])
  2. {
  3.     if(GetPlayerAdminEx(playerid) != 6) return 1;
  4.  
  5.     extract params -> new house_id; else return SendClientMessage(playerid, 0xCECECEFF, "Используйте: /sethousepos [id дома]");
  6.  
  7.     if(!(0 <= house_id <= g_house_loaded - 1)) return SendClientMessage(playerid, 0x999999FF, "Данного дома не существует на сервере");
  8.  
  9.     GetPlayerPos(playerid, g_house[house_id][H_POS_X], g_house[house_id][H_POS_Y], g_house[house_id][H_POS_Z]);
  10.     GetPlayerFacingAngle(playerid, g_house[house_id][H_EXIT_ANGLE]);
  11.    
  12.     g_house[house_id][H_EXIT_ANGLE] += 180.0;
  13.    
  14.     g_house[house_id][H_EXIT_POS_X] = g_house[house_id][H_POS_X] + 2.5 * -floatsin(g_house[house_id][H_EXIT_ANGLE], degrees);
  15.     g_house[house_id][H_EXIT_POS_Y] = g_house[house_id][H_POS_Y] + 2.5 * floatcos(g_house[house_id][H_EXIT_ANGLE], degrees);
  16.  
  17.     new fmt_text[256];
  18.  
  19.     format
  20.     (
  21.         fmt_text, sizeof fmt_text,
  22.         "UPDATE houses SET x='%f', y='%f', z='%f', exit_x='%f', exit_y='%f', exit_z='%f', exit_angle='%f' WHERE id=%d",
  23.         GetHouseData(house_id, H_POS_X),
  24.         GetHouseData(house_id, H_POS_Y),
  25.         GetHouseData(house_id, H_POS_Z),
  26.         GetHouseData(house_id, H_EXIT_POS_X),
  27.         GetHouseData(house_id, H_EXIT_POS_Y),
  28.         GetHouseData(house_id, H_EXIT_POS_Z),
  29.         GetHouseData(house_id, H_EXIT_ANGLE),
  30.         GetHouseData(house_id, H_SQL_ID)
  31.     );
  32.  
  33.     mysql_query(mysql, fmt_text, false);
  34.  
  35.     format(fmt_text, sizeof fmt_text, "Вы успешно изменили координаты дома №%d", house_id);
  36.     SendClientMessage(playerid, 0x66CC33FF, fmt_text);
  37.    
  38.     SendClientMessage(playerid, 0xFFCD00FF, "Изменить координаты выхода: /setexitpos | Изменить координаты спавна авто: /setcarpos");
  39.  
  40.     return 1;
  41. }
RAW Paste Data
Ledger Nano X - The secure hardware wallet
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top