Facebook
From Big Hummingbird, 6 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 349
  1. COMMAND:masked(playerid, params[])
  2. {
  3.         if(!HasCrewFlag(playerid, CREW_FLAG_GM) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT)) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie posiadasz uprawnień do korzystania z tej komendy.");
  4.        
  5.         new list_players[256];
  6.  
  7.         foreach(new i: Player)
  8.         {
  9.         if(strfind(pInfo[i][player_name], "Nieznajomy", true) >= 0)
  10.                 {
  11.                         format(list_players, sizeof(list_players), "%sn%dt%s (%s)", list_players, i, pInfo[i][player_name], pGlobal[i][glo_name]);
  12.                 }
  13.     }
  14.         if(strlen(list_players))
  15.         {
  16.             ShowPlayerDialog(playerid, DIALOG_INFO, DIALOG_STYLE_LIST, "Wyniki wyszukiwania:", list_players, "Okej", "Zamknij");
  17.         }
  18.         else
  19.         {
  20.             SendGuiInformation(playerid, "Informacja", "Nie znaleziono żadnego zamaskowanego gracza.");
  21.         }
  22.     return 1;
  23. }
  24.  
  25. COMMAND:limits(playerid, params[])
  26. {
  27.         if(!HasCrewFlag(playerid, CREW_FLAG_GM) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT)) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie posiadasz uprawnień do korzystania z tej komendy.");
  28.         new list_limits[256];
  29.         format(list_limits, sizeof(list_limits), "Grupy:t%d/%dnBramy:t%d/%dnDrzwi:t%d/%dnStrefy:t%d/%dnProdukty:t%d/%dnItemy w grupach:t%d/%d", Iter_Count(Groups), MAX_GROUPS, Iter_Count(Gates), MAX_GATES, Iter_Count(Doors), MAX_DOORS, Iter_Count(Areas), MAX_AREAS, Iter_Count(Products), MAX_PRODUCTS, Iter_Count(Items), MAX_ITEMS);
  30.         ShowPlayerDialog(playerid, DIALOG_INFO, DIALOG_STYLE_TABLIST, "Limity serwerowe", list_limits, "OK", "");
  31.         return 1;
  32. }
  33.  
  34. COMMAND:animsprawdz(playerid, params[])
  35. {
  36.         if(!HasCrewFlag(playerid, CREW_FLAG_GM) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT)) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie posiadasz uprawnień do korzystania z tej komendy.");
  37.         new lib[32], name[32], Float:delta, loop, lockx, locky, freeze, time;
  38.         if( sscanf(params, "s[32]s[32]fddddd", lib, name, delta, loop, lockx, locky, freeze, time) )
  39.         {
  40.                 SendClientMessage(playerid, COLOR_GREY, "Tip: /animsprawdz [lib/nazwa/predkosc/loop/lockx/lockyy/freeze/time] ");
  41.                 return 1;
  42.         }
  43.         else
  44.         {
  45.                 ApplyAnimation(playerid, lib, name, delta, loop, lockx, locky, freeze, time, 1);
  46.         }
  47.         return 1;
  48. }
  49.  
  50. COMMAND:aprodukt(playerid, params[])
  51. {
  52.         if( !HasCrewFlag(playerid, CREW_FLAG_ITEMS) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie posiadasz uprawnień do korzystania z tej komendy.");
  53.         new sub_cmd[20], rest[64], uid, cmd_value;
  54.         if( sscanf(params, "s[32]S()[80]", sub_cmd, rest) )
  55.         {
  56.                 SendClientMessage(playerid, COLOR_GREY, "Tip: /aprodukt [reload/limit/resetlimit/extraid/value1/value2/typ/cena]");
  57.                 return 1;
  58.         }
  59.         else
  60.         {
  61.                 if( !strcmp(sub_cmd, "load") )
  62.                 {
  63.                         if(sscanf(rest, "d", uid)) return SendClientMessage(playerid, COLOR_GREY, "Tip: /aprodukt reload [UID]");
  64.                         new prod = LoadProduct(uid);
  65.                         SendClientMessage(playerid, COLOR_LIGHTER_RED, sprintf("Pomyślnie załadowano produkt %s (UID %d).", Product[prod][product_name], Product[prod][product_id]));
  66.                 }
  67.                 else if( !strcmp(sub_cmd, "reload") )
  68.                 {
  69.                         if(sscanf(rest, "d", uid)) return SendClientMessage(playerid, COLOR_GREY, "Tip: /aprodukt reload [UID]");
  70.                         new prod = ReloadProduct(uid);
  71.                         SendClientMessage(playerid, COLOR_LIGHTER_RED, sprintf("Pomyślnie przeładowano produkt %s (UID %d).", Product[prod][product_name], Product[prod][product_id]));
  72.                 }
  73.                 else if( !strcmp(sub_cmd, "limit") )
  74.                 {
  75.                         if(sscanf(rest, "dd", uid, cmd_value)) return SendClientMessage(playerid, COLOR_GREY, "Tip: /aprodukt limit [uid produktu] [limit]");
  76.                         new prodid = GetProductByUid(uid);
  77.                         if(prodid == - 1) return SendClientMessage(playerid, COLOR_GREY, "Tip: /aprodukt limit [uid produktu]");
  78.                         Product[prodid][product_limit] = cmd_value;
  79.                         mysql_query(mySQLconnection, sprintf("UPDATE ipb_products SET product_limit_count = %d WHERE product_uid = %d", cmd_value, Product[prodid][product_id]));
  80.                         SendClientMessage(playerid, COLOR_LIGHTER_RED, "Limit zamawiania został edytowany.");
  81.                 }
  82.                 else if( !strcmp(sub_cmd, "resetlimit") )
  83.                 {
  84.                         if(sscanf(rest, "d", uid)) return SendClientMessage(playerid, COLOR_GREY, "Tip: /aprodukt resetlimit [uid produktu]");
  85.                         new prodid = GetProductByUid(uid);
  86.                         if(prodid == - 1) return SendClientMessage(playerid, COLOR_GREY, "Tip: /aprodukt resetlimit [uid produktu]");
  87.                         Product[prodid][product_limit_used] = 0;
  88.                         mysql_query(mySQLconnection, sprintf("UPDATE ipb_products SET product_limit_used = 0 WHERE product_uid = %d", Product[prodid][product_id]));
  89.                         SendClientMessage(playerid, COLOR_LIGHTER_RED, "Zużycie limitu zostało zresetowane.");
  90.                 }
  91.                 else if( !strcmp(sub_cmd, "typ") )
  92.                 {
  93.                         if(sscanf(rest, "dd", uid, cmd_value)) return SendClientMessage(playerid, COLOR_GREY, "Tip: /aprodukt typ [uid produktu] [typ]");
  94.                         new prodid = GetProductByUid(uid);
  95.                         if(prodid == - 1) return SendClientMessage(playerid, COLOR_GREY, "Tip: /aprodukt typ [uid produktu]");
  96.                         Product[prodid][product_type] = cmd_value;
  97.                         mysql_query(mySQLconnection, sprintf("UPDATE ipb_products SET product_type = %d WHERE product_uid = %d", cmd_value, Product[prodid][product_id]));
  98.                         SendClientMessage(playerid, COLOR_LIGHTER_RED, "Typ produktu został edytowany.");
  99.                 }
  100.                 else if( !strcmp(sub_cmd, "value1") )
  101.                 {
  102.                         if(sscanf(rest, "dd", uid, cmd_value)) return SendClientMessage(playerid, COLOR_GREY, "Tip: /aprodukt value1 [uid produktu] [wartość]");
  103.                         new prodid = GetProductByUid(uid);
  104.                         if(prodid == - 1) return SendClientMessage(playerid, COLOR_GREY, "Tip: /aprodukt value1 [uid produktu]");
  105.                         Product[prodid][product_value1] = cmd_value;
  106.                         mysql_query(mySQLconnection, sprintf("UPDATE ipb_products SET product_value1 = %d WHERE product_uid = %d", cmd_value, Product[prodid][product_id]));
  107.                         SendClientMessage(playerid, COLOR_LIGHTER_RED, "Value1 produktu został edytowany.");
  108.                 }
  109.                 else if( !strcmp(sub_cmd, "value2") )
  110.                 {
  111.                         if(sscanf(rest, "dd", uid, cmd_value)) return SendClientMessage(playerid, COLOR_GREY, "Tip: /aprodukt value2 [uid produktu] [wartość]");
  112.                         new prodid = GetProductByUid(uid);
  113.                         if(prodid == - 1) return SendClientMessage(playerid, COLOR_GREY, "Tip: /aprodukt value2 [uid produktu]");
  114.                         Product[prodid][product_value2] = cmd_value;
  115.                         mysql_query(mySQLconnection, sprintf("UPDATE ipb_products SET product_value2 = %d WHERE product_uid = %d", cmd_value, Product[prodid][product_id]));
  116.                         SendClientMessage(playerid, COLOR_LIGHTER_RED, "Value2 produktu został edytowany.");
  117.                 }
  118.                 else if( !strcmp(sub_cmd, "cena") )
  119.                 {
  120.                         if(sscanf(rest, "dd", uid, cmd_value)) return SendClientMessage(playerid, COLOR_GREY, "Tip: /aprodukt cena [uid produktu] [cena]");
  121.                         new prodid = GetProductByUid(uid);
  122.                         if(prodid == - 1) return SendClientMessage(playerid, COLOR_GREY, "Tip: /aprodukt cena [uid produktu]");
  123.                         Product[prodid][product_price] = cmd_value;
  124.                         mysql_query(mySQLconnection, sprintf("UPDATE ipb_products SET product_price = %d WHERE product_uid = %d", cmd_value, Product[prodid][product_id]));
  125.                         SendClientMessage(playerid, COLOR_LIGHTER_RED, "Cena produktu została edytowana.");
  126.                 }
  127.                 else if( !strcmp(sub_cmd, "nazwa") )
  128.                 {
  129.                         new pname[80];
  130.                         if(sscanf(rest, "ds[80]", uid, pname)) return SendClientMessage(playerid, COLOR_GREY, "Tip: /aprodukt nazwa [uid produktu] [nazwa]");
  131.                         new prodid = GetProductByUid(uid);
  132.                         if(prodid == - 1) return SendClientMessage(playerid, COLOR_GREY, "Tip: /aprodukt nazwa [uid produktu]");
  133.                         if(strlen(pname) > 38) return SendClientMessage(playerid, COLOR_GREY, "Tip: /aprodukt nazwa [uid produktu] [nazwa]");
  134.                         sscanf(pname, "s[80]", Product[prodid][product_name]);
  135.                         mysql_real_escape_string(pname, pname, mySQLconnection, 80);
  136.                         mysql_query(mySQLconnection, sprintf("UPDATE ipb_products SET product_name = '%s' WHERE product_uid = %d", pname, Product[prodid][product_id]));
  137.                         SendClientMessage(playerid, COLOR_LIGHTER_RED, "Nazwa produktu została edytowana.");
  138.                 }
  139.                 else if( !strcmp(sub_cmd, "extraid") )
  140.                 {
  141.                         if(sscanf(rest, "dd", uid, cmd_value)) return SendClientMessage(playerid, COLOR_GREY, "Tip: /aprodukt extraid [uid produktu] [wartość]");
  142.                         new prodid = GetProductByUid(uid);
  143.                         if(prodid == - 1) return SendClientMessage(playerid, COLOR_GREY, "Tip: /aprodukt extraid [uid produktu]");
  144.                         Product[prodid][product_extra] = cmd_value;
  145.                         mysql_query(mySQLconnection, sprintf("UPDATE ipb_products SET product_extraid = %d WHERE product_uid = %d", cmd_value, Product[prodid][product_id]));
  146.                         SendClientMessage(playerid, COLOR_LIGHTER_RED, "Extraid produktu zostało edytowane.");
  147.                 }
  148.                 else if( !strcmp(sub_cmd, "usun") )
  149.                 {
  150.                         if(sscanf(rest, "d", uid)) return SendClientMessage(playerid, COLOR_GREY, "Tip: /aprodukt usun [uid produktu]");
  151.                         RemoveProduct(uid);
  152.                         SendClientMessage(playerid, COLOR_LIGHTER_RED, sprintf("Skasowano produkt o UID %d.", uid));
  153.                 }
  154.  
  155.         }
  156.         return 1;
  157. }
  158.  
  159. COMMAND:event(playerid, params[])
  160. {
  161.         if(!HasCrewFlag(playerid, CREW_FLAG_GM) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT)) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie posiadasz uprawnień do korzystania z tej komendy.");
  162.         new sub_cmd[32];
  163.         if( sscanf(params, "s[32]", sub_cmd) )
  164.         {
  165.                 SendClientMessage(playerid, COLOR_GREY, "Tip: /event [pozar]");
  166.                 return 1;
  167.         }
  168.         else
  169.         {
  170.                 if( !strcmp(sub_cmd, "pozar") )
  171.                 {
  172.                         if(Fire[fire_is_burning]) return SendGuiInformation(playerid, "Informacja", "Poprzedni pożar nie został jeszcze ugaszony.");
  173.                         if(!IsAnyFirefighterOnline()) return SendGuiInformation(playerid, "Informacja", "Brak strażaków na służbie.");
  174.  
  175.                         SetupFires();
  176.                         // defer spreadfire
  177.                         SendClientMessage(playerid, -1, "{ffffff}Uruchomiłeś event pożaru, strażacy zostali powiadomieni.");
  178.                 }
  179.         }
  180.         return 1;
  181. }
  182.  
  183. COMMAND:setnick(playerid, params[])
  184. {
  185.         if(!HasCrewFlag(playerid, CREW_FLAG_GM) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT)) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie posiadasz uprawnień do korzystania z tej komendy.");
  186.         new id, nickname[MAX_PLAYER_NAME+1];
  187.         if( sscanf(params, "ds[25]", id, nickname) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /setnick [id gracza] [nick]");
  188.         if( !IsPlayerConnected(id) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Gracza o podanym id nie ma na serwerze.");
  189.     if( !pInfo[id][player_logged] ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Gracz o podanym id nie jest zalogowany.");
  190.  
  191.     strcopy(pInfo[id][player_name], nickname, MAX_PLAYER_NAME+1);
  192.  
  193.         UpdatePlayerLabel(id);
  194.         return 1;
  195. }
  196.  
  197. COMMAND:spawn(playerid, params[])
  198. {
  199.         if(!HasCrewFlag(playerid, CREW_FLAG_GM) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT)) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie posiadasz uprawnień do korzystania z tej komendy.");
  200.         SetPlayerPos(playerid, 1481.0219, -1722.0011, 13.5469);
  201.         SetPlayerVirtualWorld(playerid, 0);
  202.         SetPlayerInterior(playerid, 0);
  203.         SendClientMessage(playerid, -1, "{ffffff}Zostales przeteleportowany na SPAWN.");
  204.         return 1;
  205. }
  206.  
  207. COMMAND:setstatus(playerid, params[])
  208. {
  209.     if(!HasCrewFlag(playerid, CREW_FLAG_GM) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT)) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie posiadasz uprawnień do korzystania z tej komendy.");
  210.     new targetid, status[32];
  211.     if( sscanf(params, "us[32]", targetid, status) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /setstatus [id gracza/czesc nicku] [treśc statusu]");
  212.     if( !IsPlayerConnected(targetid) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Gracza o podanym id nie ma na serwerze.");
  213.     if( !pInfo[targetid][player_logged] ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Gracz o podanym id nie jest zalogowany.");
  214.     if( strlen(status) > 32 ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /setstatus [id gracza/czesc nicku] [treśc statusu]");
  215.    
  216.         if( !strcmp(status, "0", true) )
  217.         {
  218.                 pInfo[targetid][player_extra_status] = EOS;
  219.                 SendClientMessage(playerid, COLOR_LIGHTER_RED, "Status został usunięty.");
  220.                 RemovePlayerStatus(targetid, PLAYER_STATUS_EXTRA);
  221.                 UpdatePlayerLabel(targetid);
  222.                 mysql_query(mySQLconnection, sprintf("UPDATE ipb_characters SET char_extra_status = '' WHERE char_uid = %d", pInfo[targetid][player_id]));
  223.                 return 1;
  224.         }
  225.     mysql_query(mySQLconnection, sprintf("UPDATE `ipb_characters` SET `char_extra_status` = '%s'  WHERE `char_uid` = %d", status, pInfo[targetid][player_id]));
  226.     sscanf(status, "s[32]", pInfo[targetid][player_extra_status]);
  227.    
  228.     SendFormattedClientMessage(targetid, COLOR_LIGHTER_RED, "Administrator %s ustawił Ci specjalny status - %s.", pInfo[playerid][player_name], status);
  229.     if( playerid != targetid ) SendFormattedClientMessage(playerid, COLOR_LIGHTER_RED, "Ustawiłeś graczowi %s (UID: %d, ID: %d) specjalny status - %s.", pInfo[targetid][player_name], pInfo[targetid][player_id], targetid, status);
  230.    
  231.     AddPlayerStatus(targetid, PLAYER_STATUS_EXTRA);
  232.     UpdatePlayerLabel(targetid);
  233.     return 1;
  234. }
  235.  
  236. COMMAND:banip(playerid, params[])
  237. {
  238.         if(!HasCrewFlag(playerid, CREW_FLAG_GM) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT)) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie posiadasz uprawnień do korzystania z tej komendy.");
  239.        
  240.         new pid;
  241.         if(sscanf(params, "us[256]", pid)) return SendClientMessage(playerid, COLOR_GREY, "Tip: /banip [id gracza/czesc nicku] [powód]");
  242.         Ban(pid);
  243.  
  244.         SendClientMessage(playerid, -1, sprintf("{ffffff}Zbanowałeś IP gracza o nicku: {b1cfe7}%s [GUID: %d]", pInfo[pid][player_name], pGlobal[pid][glo_id]));
  245.         return 1;
  246. }
  247.  
  248. COMMAND:jobrespawn(playerid, params[])
  249. {
  250.         if(!HasCrewFlag(playerid, CREW_FLAG_GM) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT)) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie posiadasz uprawnień do korzystania z tej komendy.");
  251.         new count;
  252.         foreach(new vid : Vehicles)
  253.         {
  254.                 if( Vehicle[vid][vehicle_owner_type] == VEHICLE_OWNER_TYPE_JOB )
  255.                 {
  256.                         if( Vehicle[vid][vehicle_occupants] > 0 ) continue;
  257.                        
  258.                         SetVehiclePos(vid, Vehicle[vid][vehicle_park][0], Vehicle[vid][vehicle_park][1], Vehicle[vid][vehicle_park][2]-0.3);
  259.                         SetVehicleZAngle(vid, Vehicle[vid][vehicle_park][3]);
  260.                         SetVehicleVirtualWorld(vid, Vehicle[vid][vehicle_park_world]);
  261.                         LinkVehicleToInterior(vid, Vehicle[vid][vehicle_park_interior]);
  262.                         SetVehicleHealth(vid, 1000);
  263.                         Vehicle[vid][vehicle_destroyed] = false;
  264.                         Vehicle[vid][vehicle_damage][0] = 0;
  265.                         Vehicle[vid][vehicle_damage][1] = 0;
  266.                         Vehicle[vid][vehicle_damage][2] = 0;
  267.                         Vehicle[vid][vehicle_damage][3] = 0;
  268.                         Vehicle[vid][vehicle_fuel_current] = 50;
  269.                        
  270.                         UpdateVehicleDamageStatus(vid, Vehicle[vid][vehicle_damage][0], Vehicle[vid][vehicle_damage][1], Vehicle[vid][vehicle_damage][2], Vehicle[vid][vehicle_damage][3]);
  271.                         mysql_query(mySQLconnection, sprintf("UPDATE `ipb_vehicles` SET `vehicle_health` = 1000 WHERE `vehicle_uid` = %d", Vehicle[vid][vehicle_uid]));
  272.                
  273.                         Vehicle[vid][vehicle_locked] = true;
  274.                         count++;
  275.                 }
  276.         }
  277.        
  278.         SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Zrespawnowano %d pojazdów z prac dorywczych.", count));
  279.         return 1;
  280. }
  281.  
  282. COMMAND:agmx(playerid, params[])
  283. {
  284.         if(!HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT)) return 1;
  285.  
  286.         SendClientMessageToAll(COLOR_LIGHTER_RED, "SAVAGE-RP: restart serwera za 10 sekund.");
  287.                
  288.         foreach(new playeri: Player)
  289.         {
  290.                 SavePlayer(playeri);
  291.         }
  292.  
  293.         defer RestartServer[10000]();
  294.         return 1;
  295. }
  296.  
  297. COMMAND:apoint(playerid, params[])
  298. {
  299.         if(!HasCrewFlag(playerid, CREW_FLAG_GM) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT)) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie posiadasz uprawnień do korzystania z tej komendy.");
  300.         new seta[256], sets[256],
  301.                 Float:pX, Float:pY, Float:pZ;
  302.         if(sscanf(params, "s[80]S()[80]", sets, seta)) return SendClientMessage(playerid, COLOR_GREY, "Tip: /apoint [save, tp]]");
  303.         if(!strcmp(sets, "save", true))
  304.         {
  305.                 GetPlayerPos(playerid, pX, pY, pZ);
  306.             SetPVarFloat(playerid,"al_posx", pX);
  307.             SetPVarFloat(playerid,"al_posy", pY);
  308.             SetPVarFloat(playerid,"al_posz", pZ);
  309.             if(GetPVarInt(playerid, "al_pos") == 1)
  310.                 {
  311.                         SendClientMessage(playerid, -1, sprintf("{ffffff}Nowa pozycja zapisana. {b1cfe7}[%f|%f|%f]", pX, pY, pZ));
  312.                 } else {
  313.                         SendClientMessage(playerid, -1, sprintf("{ffffff}Pozycja zapisana. {b1cfe7}[%f:%f:%f]", pX, pY, pZ));
  314.                 }
  315.                 SetPVarInt(playerid, "al_pos", 1);
  316.         }
  317.         if(!strcmp(sets, "tp", true))
  318.         {
  319.                 if(GetPVarInt(playerid, "al_pos") == 0)
  320.                 {
  321.                         SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie zapisałeś jeszcze żadnej pozycji.");
  322.                 } else {
  323.                         if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  324.                         {
  325.                                 SetVehiclePos(GetPlayerVehicleID(playerid), GetPVarFloat(playerid, "al_posx"), GetPVarFloat(playerid, "al_posy"), GetPVarFloat(playerid, "al_posz"));
  326.                         } else {
  327.                                 RP_PLUS_SetPlayerPos(playerid, GetPVarFloat(playerid, "al_posx"), GetPVarFloat(playerid, "al_posy"), GetPVarFloat(playerid, "al_posz"));
  328.                         }
  329.                         SendClientMessage(playerid, -1, "{ffffff}Teleportowałeś się do ostatnio zapisanej pozycji.");
  330.                 }
  331.         }
  332.         return 1;
  333. }
  334.  
  335. COMMAND:ado(playerid, params[])
  336. {
  337.         if(!HasCrewFlag(playerid, CREW_FLAG_GM) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie posiadasz uprawnień do korzystania z tej komendy.");
  338.         new text[128], str[128];
  339.         if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, COLOR_GREY, "Tip: /ado [tekst]");
  340.         format(str, sizeof(str), "** %s **", text);
  341.         SendClientMessageToAll(0x9B91ECFF, str);
  342.         return 1;
  343. }
  344.  
  345. COMMAND:astats(playerid, params[])
  346. {
  347.         new giveplayer_id;
  348.         if(HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT) || HasCrewFlag(playerid, CREW_FLAG_ADMIN) || HasCrewFlag(playerid, CREW_FLAG_GM))
  349.         {
  350.                 if(sscanf(params, "u", giveplayer_id))
  351.                 {
  352.                         SendClientMessage(playerid, COLOR_GREY, "Tip: /astats [id gracza/czesc nicku]");
  353.                         return 1;
  354.                 }
  355.  
  356.                 if(giveplayer_id == INVALID_PLAYER_ID)
  357.                 {
  358.                         SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Niepoprawne ID gracza.");
  359.                         return 1;
  360.                 }
  361.  
  362.                 if(!IsPlayerConnected(giveplayer_id))
  363.                 {
  364.                         SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie ma gracza o takim ID.");
  365.                         return 1;
  366.                 }
  367.                 ShowPlayerStats(playerid, giveplayer_id);
  368.                 return 1;
  369.         }
  370.         return 1;
  371. }
  372.  
  373. COMMAND:spec(playerid, params[])
  374. {
  375.         return cmd_rc(playerid, params);
  376. }
  377.  
  378. COMMAND:rc(playerid, params[])
  379. {
  380.     if(!HasCrewFlag(playerid, CREW_FLAG_GM) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT)) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie posiadasz uprawnień do korzystania z tej komendy.");
  381.     new id;
  382.  
  383.     if(!sscanf(params, "d", id))
  384.     {
  385.         if( !IsPlayerConnected(id) )
  386.         {
  387.                 SendClientMessage(playerid, COLOR_GREY, "Niepoprawne ID gracza.");
  388.                 return 1;
  389.         }
  390.  
  391.         if( pInfo[id][player_spec] != INVALID_PLAYER_ID )
  392.         {
  393.                 SendClientMessage(playerid, COLOR_GREY, "Ten gracz już kogoś obserwuje, przechodze do kolejnego ID.");
  394.                 return cmd_spec(playerid, sprintf("%d", Iter_Next(Player, id)));
  395.         }
  396.  
  397.             SetPlayerInterior(playerid, GetPlayerInterior(id));
  398.             SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(id));
  399.  
  400.             new string[340];
  401.  
  402.             format(string, sizeof(string), "~n~~w~Global: %s            Zdrowie: ~p~%0.1f               ~w~Portfel: ~g~%d               ~w~Godziny: ~y~%d               Armour: ~w~%0.1f~n~~n~~n~~n~~w~Uzywaj klawisza ~r~LALT lub ~r~SPACJA ~w~aby przeskakiwac miedzy graczami.~n~~r~LSHIFT ~w~odswieza specowanie danego gracza.", pGlobal[id][glo_name],pInfo[id][player_health], GetPlayerMoney(id), pInfo[id][player_hours], pInfo[id][player_armour]);
  403.                
  404.             TextDrawSetString(DashBoardPane2[playerid], string);
  405.                 TextDrawShowForPlayer(playerid, DashBoardPane2[playerid]);
  406.  
  407.             if(IsPlayerInAnyVehicle(id))
  408.             {
  409.             TogglePlayerSpectating(playerid, 1);
  410.             PlayerSpectateVehicle(playerid, GetPlayerVehicleID(id));
  411.             }
  412.             else
  413.             {
  414.             TogglePlayerSpectating(playerid, 1);
  415.             PlayerSpectatePlayer(playerid, id);
  416.             }
  417.  
  418.             pInfo[playerid][player_spec] = id;
  419.             pInfo[playerid][player_quit_vw] = GetPlayerVirtualWorld(playerid);
  420.         }
  421.         else
  422.         {
  423.                 if(pInfo[playerid][player_spec] != INVALID_PLAYER_ID)
  424.             {
  425.             TogglePlayerSpectating(playerid, 0);
  426.  
  427.                         TextDrawHideForPlayer(playerid, DashBoardPane2[playerid]);
  428.  
  429.             SetPlayerSkin(playerid, pInfo[playerid][player_skin]);
  430.             SetPlayerVirtualWorld(playerid, pInfo[playerid][player_quit_vw]);
  431.             pInfo[playerid][player_spec] = INVALID_PLAYER_ID;
  432.             }
  433.             else
  434.             {
  435.                 SendClientMessage(playerid, COLOR_GREY, "Tip: /rc [id gracza]");
  436.             }
  437.         }
  438.     return 1;
  439. }
  440.  
  441. COMMAND:apos(playerid, params[])
  442. {
  443.         if( !HasCrewFlag(playerid, CREW_FLAG_GM) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie posiadasz uprawnień do korzystania z tej komendy.");
  444.         new Float:x, Float:y, Float:z;
  445.     if(sscanf(params, "fff", x,y,z))
  446.         return SendClientMessage(playerid, COLOR_GREY, "Tip: /apos [x, y, z]");
  447.    
  448.     RP_PLUS_SetPlayerPos(playerid, x, y, z);
  449.         return 1;
  450. }
  451.  
  452. COMMAND:freeze(playerid, params[])
  453. {
  454.         if( !HasCrewFlag(playerid, CREW_FLAG_GM) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie posiadasz uprawnień do korzystania z tej komendy.");
  455.         new id;
  456.     if(sscanf(params, "u", id))
  457.         return SendClientMessage(playerid, COLOR_GREY, "Tip: /freeze [id]");
  458.    
  459.     if( !IsPlayerConnected(id) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Gracza o podanym id nie ma na serwerze.");
  460.  
  461.     if(pInfo[id][player_freezed]==false)
  462.     {
  463.             TogglePlayerControllable(id, false);    
  464.                 SendFormattedClientMessage(playerid, -1, "{ffffff}Zamroziłeś gracza {b1cfe7}%s (ID: %d, UID: %d){ffffff}.", pInfo[id][player_name], id, pInfo[id][player_id]);
  465.                 SendFormattedClientMessage(id, -1, "{ffffff}Administrator {b1cfe7}%s {ffffff}zamroził Cię.", pInfo[playerid][player_name]);
  466.                 pInfo[id][player_freezed]=true;
  467.         }
  468.         else
  469.         {
  470.             TogglePlayerControllable(id, true);    
  471.                 SendFormattedClientMessage(playerid, -1, "{ffffff}Odmroziłeś gracza {b1cfe7}%s (ID: %d, UID: %d){ffffff}.", pInfo[id][player_name], id, pInfo[id][player_id]);
  472.                 SendFormattedClientMessage(id, -1, "{ffffff}Administrator {b1cfe7}%s {ffffff}odmroził Cię.", pInfo[playerid][player_name]);
  473.                 pInfo[id][player_freezed]=false;
  474.         }
  475.         return 1;
  476. }
  477.  
  478. COMMAND:sethours(playerid, params[])
  479. {
  480.         if( !HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT) && !HasCrewFlag(playerid, CREW_FLAG_GM) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie posiadasz uprawnień do korzystania z tej komendy.");
  481.         new targetid, hrs;
  482.         if( sscanf(params, "ud", targetid, hrs) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /sethours [id gracza/czesc nicku] [ilość godzin]");
  483.         if( !IsPlayerConnected(targetid) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Gracza o podanym id nie ma na serwerze.");
  484.         if( !pInfo[targetid][player_logged] ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Gracz o podanym id nie jest zalogowany.");
  485.         if( hrs < 0 ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /sethours [id gracza/czesc nicku] [ilość godzin]");
  486.        
  487.         mysql_query(mySQLconnection, sprintf("UPDATE `ipb_characters` SET `char_hours` = %d  WHERE `char_uid` = %d", hrs, pInfo[targetid][player_id]));
  488.         pInfo[targetid][player_hours]=hrs;
  489.        
  490.         SendFormattedClientMessage(targetid, COLOR_LIGHTER_RED, "Administrator %s ustawił Ci %d godzin.", pInfo[playerid][player_name], hrs);
  491.         if( playerid != targetid ) SendFormattedClientMessage(playerid, COLOR_LIGHTER_RED, "Ustawiłeś graczowi %s (UID: %d, ID: %d) %d godzin.", pInfo[targetid][player_name], pInfo[targetid][player_id], targetid, hrs);
  492.        
  493.         return 1;
  494. }
  495.  
  496. COMMAND:slap(playerid, params[])
  497. {
  498.         if( !HasCrewFlag(playerid, CREW_FLAG_GM) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie posiadasz uprawnień do korzystania z tej komendy.");
  499.         new id, Float: PPos[3];
  500.     if(sscanf(params, "u", id))
  501.         return SendClientMessage(playerid, COLOR_GREY, "Tip: /slap [id gracza/czesc nicku]");
  502.    
  503.     if( !IsPlayerConnected(id) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Gracza o podanym id nie ma na serwerze.");
  504.     GetPlayerPos(id, PPos[0], PPos[1], PPos[2]);
  505.     RP_PLUS_SetPlayerPos(id, PPos[0], PPos[1], PPos[2]+4);
  506.    
  507.         SendFormattedClientMessage(playerid, -1, "{ffffff}Slapnąłeś {b1cfe7}%s (ID: %d, UID: %d).", pInfo[id][player_name], id, pInfo[id][player_id]);
  508.         return 1;
  509. }
  510.  
  511. COMMAND:givecash(playerid, params[])
  512. {
  513.     if( !HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie posiadasz uprawnień do korzystania z tej komendy.");
  514.    
  515.     new targetid, skin, reason[64];
  516.     if( sscanf(params, "uds[64]", targetid, skin, reason) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /givecash [id gracza/czesc nicku] [ilość] [powód]");
  517.     if( !IsPlayerConnected(targetid) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Gracza o podanym id nie ma na serwerze.");
  518.     if( !pInfo[targetid][player_logged] ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Gracz o podanym id nie jest zalogowany.");
  519.  
  520.     Warn(targetid, playerid, sprintf("$%d -> %s(%d) from personbank: %s(%d). Reason: %s", skin, pInfo[targetid][player_name], pInfo[targetid][player_id], pInfo[playerid][player_name], pInfo[playerid][player_id], reason));
  521.     GivePlayerMoney(targetid, skin);
  522.     SendFormattedClientMessage(playerid, -1, "{ffffff}Dodałeś graczowi {b1cfe7}%s (UID: %d, ID: %d) {ffffff}forse: {b1cfe7}%d.", pInfo[targetid][player_name], pInfo[targetid][player_id], targetid, skin);
  523.    
  524.     return 1;
  525. }
  526.  
  527. COMMAND:netw(playerid, params[])
  528. {
  529.     if( !HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie posiadasz uprawnień do korzystania z tej komendy.");
  530.    
  531.     new targetid, playa, skin, reason[64];
  532.     if( sscanf(params, "uds[64]", targetid, playa, skin, reason) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /majatek [id gracza/czesc nicku od ktorego odbierac hajs] [id gracza do ktorego ma trafic] [ilość dodanego/zabranego majatku] [powód]");
  533.     if( !IsPlayerConnected(targetid) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Gracza o podanym id nie ma na serwerze.");
  534.     if( !pInfo[targetid][player_logged] ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Gracz o podanym id nie jest zalogowany.");
  535.  
  536.     Warn(playa, playerid, sprintf("$%d from personbank: %s(%d). Reason: %s", skin, pInfo[targetid][player_name], pInfo[targetid][player_id], pInfo[playerid][player_name], pInfo[playerid][player_id], reason));
  537.         Warn(targetid, playerid, sprintf("$%d ->  from personbank: %s(%d). Reason: %s", skin, pInfo[targetid][player_name], pInfo[targetid][player_id], pInfo[playerid][player_name], pInfo[playerid][player_id], reason));
  538.     GivePlayerMoney(targetid, skin);
  539.     SendFormattedClientMessage(playerid, -1, "{ffffff}Dodałeś graczowi {b1cfe7}%s (UID: %d, ID: %d) {ffffff}forse: {b1cfe7}%d.", pInfo[targetid][player_name], pInfo[targetid][player_id], targetid, skin);
  540.    
  541.     return 1;
  542. }
  543.  
  544.  
  545. COMMAND:ban(playerid, params[])
  546. {
  547.         if( !HasCrewFlag(playerid, CREW_FLAG_GM) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie posiadasz uprawnień do korzystania z tej komendy.");
  548.         new playa,text[128];
  549.         if(sscanf(params, "us[128]", playa, text)) return SendClientMessage(playerid, COLOR_GREY, "Tip: /ban [id/czesc nicku] [powód]");
  550.         if(!IsPlayerConnected(playa)||playa==playerid) return SendClientMessage(playerid, COLOR_GREY, "Tip: Niepoprawne ID gracza.");
  551.         if(strlen(text)<1 || strlen(text)>47) return SendClientMessage(playerid, COLOR_GREY, "Tip: Zbyt dlugi powód kary, max 47 znaków.");
  552.  
  553.         EscapePL(text);
  554.        
  555.         BanAc(playa, playerid, text);
  556.  
  557.         SendFormattedClientMessage(playa, COLOR_LIGHTER_RED, "Administrator %s zbanował Twoje konto z powodem: %s.", gInfo[playerid][global_name], text);
  558.         Kick(playa);
  559.         return 1;
  560. }
  561.  
  562. COMMAND:newowner(playerid, params[])
  563. {
  564.         if( !HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie posiadasz uprawnień do korzystania z tej komendy.");
  565.         new playa,text[128];
  566.         if(sscanf(params, "us[128]", playa, text)) return SendClientMessage(playerid, COLOR_GREY, "Tip: /newowner [id/czesc nicku] [powód]");
  567.         if(!IsPlayerConnected(playa)) return SendClientMessage(playerid, COLOR_GREY, "Tip: Niepoprawne ID gracza.");
  568.         if(strlen(text)<1 || strlen(text)>47) return SendClientMessage(playerid, COLOR_GREY, "Tip: Zbyt dlugi powód kary, max 47 znaków.");
  569.  
  570.         EscapePL(text);
  571.         mysql_query(mySQLconnection, sprintf("UPDATE `ipb_characters` SET `char_active` = 1 WHERE `char_uid` = %d", pInfo[playerid][player_id]));
  572.         SendFormattedClientMessage(playa, COLOR_LIGHTER_RED, "Administrator %s zablokował Twoje konto z powodem: %s. Twoja postać na ten czas została zablokowana, a majątek wyzerowany.", gInfo[playerid][global_name], text);
  573.         pInfo[playerid][player_money] = 0;
  574.         nowner(playa, playerid, text);
  575.         Kick(playa);
  576.         return 1;
  577. }
  578.  
  579. COMMAND:wycisz(playerid, params[])
  580. {
  581.         if( !HasCrewFlag(playerid, CREW_FLAG_GM) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie posiadasz uprawnień do korzystania z tej komendy.");
  582.         new playa,text[128];
  583.         if(sscanf(params, "us[128]", playa, text)) return SendClientMessage(playerid, COLOR_GREY, "Tip: /mute [id/czesc nicku] [powód]");
  584.         if(!IsPlayerConnected(playa)||playa==playerid) return SendClientMessage(playerid, COLOR_GREY, "Tip: Niepoprawne ID gracza.");
  585.         if(strlen(text)<1 || strlen(text)>47) return SendClientMessage(playerid, COLOR_GREY, "Tip: Zbyt dlugi powód kary, max 47 znaków.");
  586.  
  587.         EscapePL(text);
  588.        
  589.         SendFormattedClientMessage(playa, COLOR_LIGHTER_RED, "Administrator %s zablokował Ci opcję pisania na chacie z powodem: %s.", gInfo[playerid][global_name], text);
  590.         if(pInfo[playerid][player_muted] >= 1)
  591.         {
  592.                 pInfo[playerid][player_muted] = 0;
  593.         }
  594.        
  595.         else
  596.         {
  597.                 pInfo[playerid][player_muted] = 1;
  598.         }
  599.         SendClientMessage(playerid, COLOR_LIGHTER_RED, "Zablokowałeś graczowi %s możliwość pisania. Pamiętaj, aby po interwencji mu je odblokować!");
  600.         return 1;
  601. }
  602.  
  603. COMMAND:aban(playerid, params[])
  604. {
  605.         if( !HasCrewFlag(playerid, CREW_FLAG_GM) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie posiadasz uprawnień do korzystania z tej komendy.");
  606.         new playa,text[128];
  607.         if(sscanf(params, "us[128]", playa, text)) return SendClientMessage(playerid, COLOR_GREY, "Tip: /aban [id/czesc nicku] [powód]");
  608.         if(!IsPlayerConnected(playa)||playa==playerid) return SendClientMessage(playerid, COLOR_GREY, "Tip: Niepoprawne ID gracza.");
  609.         if(strlen(text)<1 || strlen(text)>47) return SendClientMessage(playerid, COLOR_GREY, "Tip: Zbyt dlugi powód kary, max 47 znaków.");
  610.  
  611.         EscapePL(text);
  612.        
  613.         BanAc(playa, playerid, text);
  614.  
  615.         SendFormattedClientMessage(playa, COLOR_LIGHTER_RED, "Administrator %s zbanował Twoje konto z powodem: %s.", gInfo[playerid][global_name], text);
  616.         Kick(playa);
  617.         return 1;
  618. }
  619.  
  620.  
  621.  
  622. COMMAND:block(playerid, params[])
  623. {
  624.         if( !HasCrewFlag(playerid, CREW_FLAG_GM) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie posiadasz uprawnień do korzystania z tej komendy.");
  625.         new sub_cmd[20], rest[64], playa, text[128], time;
  626.         if( sscanf(params, "s[32]S()[80]", sub_cmd, rest) )
  627.         {
  628.                 SendClientMessage(playerid, COLOR_GREY, "Tip: /block [char/run/dmg/veh/ooc]");
  629.                 return 1;
  630.         }
  631.         else
  632.         {
  633.                 if( !strcmp(sub_cmd, "char") )
  634.                 {
  635.                         if(sscanf(rest, "us[128]", playa, text)) return SendClientMessage(playerid, COLOR_GREY, "Tip: /block char [id gracza/czesc nicku] [powód]");
  636.                         if(!IsPlayerConnected(playa)||playa==playerid) return SendClientMessage(playerid, COLOR_GREY, "Tip: Niepoprawne ID gracza.");
  637.                         if(strlen(text)<1||strlen(text)>47) return SendClientMessage(playerid, COLOR_GREY, "Tip: Niepoprawny powód kary - min 1, max 47 znaków.");
  638.  
  639.                         Block(playa, playerid, text);
  640.                 }
  641.                 else if( !strcmp(sub_cmd, "ooc") )
  642.                 {
  643.                         if(sscanf(rest, "uds[128]", playa, time, text)) return SendClientMessage(playerid, COLOR_GREY, "Tip: /block ooc [id gracza/czesc nicku] [ilość dni] [powód]");
  644.                         if(!IsPlayerConnected(playa)||playa==playerid) return SendClientMessage(playerid, COLOR_GREY, "Tip: Niepoprawne ID gracza.");
  645.                         if(strlen(text)<1||strlen(text)>47) return SendClientMessage(playerid, COLOR_GREY, "Tip: Niepoprawny powód kary - min 1, max 47 znaków.");
  646.  
  647.                         BlockOoc(playa, playerid, time, text);
  648.                 }
  649.                 else if( !strcmp(sub_cmd, "run") )
  650.                 {
  651.                         if(sscanf(rest, "uds[128]", playa, time, text)) return SendClientMessage(playerid, COLOR_GREY, "Tip: /block run [id gracza/czesc nicku] [ilość dni] [powód]");
  652.                         if(!IsPlayerConnected(playa)||playa==playerid) return SendClientMessage(playerid, COLOR_GREY, "Tip: Niepoprawne ID gracza.");
  653.                         if(strlen(text)<1||strlen(text)>47) return SendClientMessage(playerid, COLOR_GREY, "Tip: Niepoprawny powód kary - min 1, max 47 znaków.");
  654.  
  655.                         BlockRun(playa, playerid, time, text);
  656.                 }
  657.                 else if( !strcmp(sub_cmd, "dmg") )
  658.                 {
  659.                         if(sscanf(rest, "uds[128]", playa, time, text)) return SendClientMessage(playerid, COLOR_GREY, "Tip: /block dmg [id gracza/czesc nicku] [ilość dni] [powód]");
  660.                         if(!IsPlayerConnected(playa)||playa==playerid) return SendClientMessage(playerid, COLOR_GREY, "Tip: Niepoprawne ID gracza.");
  661.                         if(strlen(text)<1||strlen(text)>47) return SendClientMessage(playerid, COLOR_GREY, "Tip: Niepoprawny powód kary - min 1, max 47 znaków.");
  662.  
  663.                         BlockDmg(playa, playerid, time, text);
  664.                 }
  665.                 else if( !strcmp(sub_cmd, "veh") )
  666.                 {
  667.                         if(sscanf(rest, "uds[128]", playa, time, text)) return SendClientMessage(playerid, COLOR_GREY, "Tip: /block veh [id gracza/czesc nicku] [ilość dni] [powód]");
  668.                         if(!IsPlayerConnected(playa)||playa==playerid) return SendClientMessage(playerid, COLOR_GREY, "Tip: Niepoprawne ID gracza.");
  669.                         if(strlen(text)<1||strlen(text)>47) return SendClientMessage(playerid, COLOR_GREY, "Tip: Niepoprawny powód kary - min 1, max 47 znaków.");
  670.  
  671.                         BlockVeh(playa, playerid, time, text);
  672.                         new Float:x, Float:y, Float:z;
  673.                         GetPlayerPos(playa, x, y, z);
  674.                         SetPlayerPos(playa, x, y, z+10.0);
  675.                 }
  676.         }
  677.         return 1;
  678. }
  679.  
  680. COMMAND:fck(playerid, params[])
  681. {
  682.         if( !HasCrewFlag(playerid, CREW_FLAG_GM) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie posiadasz uprawnień do korzystania z tej komendy.");
  683.         new playa, text[128];
  684.        
  685.         if(sscanf(params, "us[128]", playa, text)) return SendClientMessage(playerid, COLOR_GREY, "Tip: /fck [id gracza/część nicku] [powód]");
  686.         if(!IsPlayerConnected(playa)||playa==playerid) return SendClientMessage(playerid, COLOR_GREY, "Tip: Niepoprawne ID gracza.");
  687.         if(strlen(text)<1||strlen(text)>47) return SendClientMessage(playerid, COLOR_GREY, "Tip: Niepoprawny powód kary - min 1, max 47 znaków.");
  688.  
  689.         CharacterKill(playa, playerid, text);
  690.  
  691.         return 1;
  692. }
  693.  
  694. COMMAND:aj(playerid, params[])
  695. {
  696.         if( !HasCrewFlag(playerid, CREW_FLAG_GM) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie posiadasz uprawnień do korzystania z tej komendy.");
  697.         new playa,text[128],time;
  698.         if(sscanf(params, "uds[128]", playa, time, text)) return SendClientMessage(playerid, COLOR_GREY, "Tip: /aj [id gracza/czesc nicku] [czas] [powód]");
  699.         if(!IsPlayerConnected(playa)||playa==playerid) return SendClientMessage(playerid, COLOR_GREY, "Tip: Niepoprawne ID gracza.");
  700.         if(strlen(text)<1||strlen(text)>47) return SendClientMessage(playerid, COLOR_GREY, "Tip: Niepoprawny powód kary - min 1, max 47 znaków.");
  701.         if(time>1000) return SendClientMessage(playerid, COLOR_GREY, "Tip: Maksymalny czas AJ to 1000 minut.");
  702.  
  703.         AdminJail(playa, playerid, text, time);
  704.         return 1;
  705. }
  706.  
  707. COMMAND:kick(playerid, params[])
  708. {
  709.         if( !HasCrewFlag(playerid, CREW_FLAG_GM) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie posiadasz uprawnień do korzystania z tej komendy.");
  710.         new playa,text[128];
  711.         if(sscanf(params, "us[128]", playa, text)) return SendClientMessage(playerid, COLOR_GREY, "Tip: /kick [id gracza/czesc nicku] [powód]");
  712.         if(!IsPlayerConnected(playa)||playa==playerid) return SendClientMessage(playerid, COLOR_GREY, "Tip: Niepoprawne ID gracza.");
  713.         if(strlen(text)<1||strlen(text)>47) return SendClientMessage(playerid, COLOR_GREY, "Tip: Niepoprawny powód kary - min 1, max 47 znaków.");
  714.  
  715.         KickAc(playa, playerid, text);
  716.         return 1;
  717. }
  718.  
  719.  
  720. COMMAND:akick(playerid, params[])
  721. {
  722.         if( !HasCrewFlag(playerid, CREW_FLAG_GM) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie posiadasz uprawnień do korzystania z tej komendy.");
  723.         new playa,text[128];
  724.         if(sscanf(params, "us[128]", playa, text)) return SendClientMessage(playerid, COLOR_GREY, "Tip: /akick [id gracza/czesc nicku] [powód]");
  725.         if(!IsPlayerConnected(playa)||playa==playerid) return SendClientMessage(playerid, COLOR_GREY, "Tip: Niepoprawne ID gracza.");
  726.         if(strlen(text)<1||strlen(text)>47) return SendClientMessage(playerid, COLOR_GREY, "Tip: Niepoprawny powód kary - min 1, max 47 znaków.");
  727.  
  728.         KickAc(playa, playerid, text);
  729.         return 1;
  730. }
  731.  
  732. COMMAND:zmiana(playerid, params[])
  733. {
  734.         if( !HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie posiadasz uprawnień do korzystania z tej komendy.");
  735.         new text[290];
  736.         if( sscanf(params, "s[290]", text) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /zmiana [tekst]");
  737.         new h,m,s;      gettime(h,m,s);
  738.         new msg[64];
  739.         format(msg, sizeof(msg), "[%d:%d:%d]", h, m, s);
  740.         SendClientMessageToAll(-1, "{b6fff7}Dodaliśmy nowe zmiany! Swoją opinię na ich temat możesz wyrazić na forum w przeznaczonym do tego dziale!n");
  741.         new allmsg[350];
  742.         format(allmsg, sizeof(allmsg), "{b6fff7}* %s %s", msg, text);
  743.        
  744.         format(text, sizeof(text), "[[ %s: %s ]]", pInfo[playerid][player_name], BeautifyString(text));
  745.         foreach(new p : Player)
  746.         {
  747.                 if( !pInfo[p][player_logged] ) continue;
  748.                 SendClientMessage(p, -1, allmsg);
  749.         }
  750.         return 1;
  751. }
  752.  
  753. COMMAND:warn(playerid, params[])
  754. {
  755.         if( !HasCrewFlag(playerid, CREW_FLAG_GM) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie posiadasz uprawnień do korzystania z tej komendy.");
  756.         new playa,text[256];
  757.         if(sscanf(params, "us[128]", playa, text)) return SendClientMessage(playerid, COLOR_GREY, "Tip: /warn [id gracza/czesc nicku] [powód]");
  758.         if(strlen(text)<1||strlen(text)>47) return SendClientMessage(playerid, COLOR_GREY, "Tip: Niepoprawny powód kary - min 1, max 47 znaków.");
  759.  
  760.         Warn(playa, playerid, text);
  761.         return 1;
  762. }
  763.  
  764. COMMAND:gs(playerid, params[])
  765. {
  766.         if( !HasCrewFlag(playerid, CREW_FLAG_GM) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie posiadasz uprawnień do korzystania z tej komendy.");
  767.         new playa,text[256], score;
  768.         if(sscanf(params, "uds[128]", playa, score, text)) return SendClientMessage(playerid, COLOR_GREY, "Tip: /gs [id gracza/czesc nicku] [ilość] [powód]");
  769.         if(strlen(text)<1||strlen(text)>47) return SendClientMessage(playerid, COLOR_GREY, "Tip: Niepoprawny powód kary - min 1, max 47 znaków.");
  770.  
  771.         Score(playa, playerid, score, text);
  772.         return 1;
  773. }
  774.  
  775. COMMAND:ab(playerid, params[])
  776. {
  777.         return cmd_abus(playerid, params);
  778. }
  779.  
  780. COMMAND:abus(playerid, params[])
  781. {
  782.         if( !HasCrewFlag(playerid, CREW_FLAG_EDITOR) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie posiadasz uprawnień do korzystania z tej komendy.");
  783.  
  784.         new type[32], varchar[32], string[128];
  785.         if(sscanf(params, "s[32]S()[32]", type, varchar))
  786.         {
  787.                 SendClientMessage(playerid, COLOR_GREY, "Tip: /abus [stworz], [nazwa], [pozycja], [usun]");
  788.             return 1;
  789.         }
  790.         if(!strcmp(type, "stworz", true))
  791.         {
  792.                 new busstop_name[32];
  793.                 if(sscanf(varchar, "s[32]", busstop_name))
  794.                 {
  795.                     SendClientMessage(playerid, COLOR_GREY, "Tip: /abus stworz [nazwa przystanku]");
  796.                     return 1;
  797.                 }
  798.                 new Float:PosX, Float:PosY, Float:PosZ;
  799.                 GetPlayerPos(playerid, PosX, PosY, PosZ);
  800.                
  801.                 new busstop_id = CreateBusStop(busstop_name, PosX, PosY, PosZ + 0.25);
  802.                
  803.                 format(string, sizeof(string), "Stworzono nowy przystanek.nNazwa: %s (SampID: %d, UID: %d).", busstop_name, busstop_id, BusStopData[busstop_id][bUID]);
  804.                 ShowPlayerDialog(playerid, DIALOG_INFO, DIALOG_STYLE_MSGBOX, "Informacja", string, "Okej", "");
  805.                 return 1;
  806.         }
  807.         if(!strcmp(type, "nazwa", true))
  808.         {
  809.             new busstop_id, busstop_name[32];
  810.             if(sscanf(varchar, "ds[32]", busstop_id, busstop_name))
  811.             {
  812.                 SendClientMessage(playerid, COLOR_GREY, "Tip: /abus nazwa [ID przystanku] [nowa nazwa]");
  813.                 return 1;
  814.             }
  815.             if(!BusStopData[busstop_id][bUID])
  816.             {
  817.                 SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Wprowadzono nieprawidlowe ID przystanku.");
  818.                 return 1;
  819.             }
  820.                 strmid(BusStopData[busstop_id][bName], busstop_name, 0, strlen(busstop_name), 32);
  821.  
  822.                 SaveBusStop(busstop_id);
  823.  
  824.                 format(string, sizeof(string), "Przystanek %d:n%s.", busstop_id, busstop_name);
  825.                 UpdateDynamic3DTextLabelText(Text3D:BusStopData[busstop_id][bNameTag], LABEL_DESCRIPTION, string);
  826.  
  827.                 format(string, sizeof(string), "Nazwa przystanku (SampID: %d, UID: %d) została zmieniona.nNowa nazwa przystanku: %s.", busstop_id, BusStopData[busstop_id][bUID], busstop_name);
  828.                 ShowPlayerDialog(playerid, DIALOG_INFO, DIALOG_STYLE_MSGBOX, "Informacja", string, "Okej", "");
  829.             return 1;
  830.         }
  831.         if(!strcmp(type, "pozycja", true))
  832.         {
  833.             new busstop_id;
  834.             if(sscanf(varchar, "d", busstop_id))
  835.             {
  836.                 SendClientMessage(playerid, COLOR_GREY, "Tip: /abus pozycja [ID przystanku]");
  837.                 return 1;
  838.             }
  839.             if(!BusStopData[busstop_id][bUID])
  840.             {
  841.                 SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Wprowadzono nieprawidlowe ID przystanku.");
  842.                 return 1;
  843.             }
  844.                 new Float:PosX, Float:PosY, Float:PosZ;
  845.                 GetPlayerPos(playerid, PosX, PosY, PosZ);
  846.                
  847.                 BusStopData[busstop_id][bPosX] = PosX;
  848.                 BusStopData[busstop_id][bPosY] = PosY;
  849.                 BusStopData[busstop_id][bPosZ] = PosZ + 0.25;
  850.                
  851.                 SaveBusStop(busstop_id);
  852.                
  853.                 Delete3DTextLabel(Text3D:BusStopData[busstop_id][bNameTag]);
  854.                 BusStopData[busstop_id][bNameTag] = Create3DTextLabel(string, LABEL_DESCRIPTION, BusStopData[busstop_id][bPosX], BusStopData[busstop_id][bPosY], BusStopData[busstop_id][bPosZ], 15.0, 0, 1);
  855.  
  856.                 format(string, sizeof(string), "Pozycja przystanku (SampID: %d, UID: %d) została zmieniona.", busstop_id, BusStopData[busstop_id][bUID]);
  857.                 ShowPlayerDialog(playerid, DIALOG_INFO, DIALOG_STYLE_MSGBOX, "Informacja", string, "Okej", "");
  858.                 return 1;
  859.         }
  860.         if(!strcmp(type, "usun", true))
  861.         {
  862.             new busstop_id;
  863.             if(sscanf(varchar, "d", busstop_id))
  864.             {
  865.                 SendClientMessage(playerid, COLOR_GREY, "Tip: /abus usun [ID przystanku]");
  866.                 return 1;
  867.             }
  868.             if(!BusStopData[busstop_id][bUID])
  869.             {
  870.                 SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Wprowadzono nieprawidlowe ID przystanku.");
  871.                 return 1;
  872.             }
  873.         format(string, sizeof(string), "Przystanek (SampID: %d, UID: %d) zostal usuniety.", busstop_id, BusStopData[busstop_id][bUID]);
  874.  
  875.             DeleteBusStop(busstop_id);
  876.  
  877.             ShowPlayerDialog(playerid, DIALOG_INFO, DIALOG_STYLE_MSGBOX, "Informacja", string, "Okej", "");
  878.             return 1;
  879.         }
  880.         return 1;
  881. }
  882.  
  883. COMMAND:pflags(playerid, params[])
  884. {
  885.         if( !HasCrewFlag(playerid, CREW_FLAG_GM) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie posiadasz uprawnień do korzystania z tej komendy.");
  886.        
  887.         new targetid;
  888.         if( sscanf(params, "u", targetid) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /pflags [id gracza/czesc nicku]");
  889.        
  890.         if( !IsPlayerConnected(targetid) || !pInfo[targetid][player_logged] ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Gracza o podanym id nie ma na serwerze.");
  891.        
  892.         DynamicGui_Init(playerid);
  893.         DynamicGui_SetDialogValue(playerid, targetid);
  894.         new str[256];
  895.        
  896.         format(str, sizeof(str), "%s%s01tBMXn", str, ((PlayerHasFlag(targetid, PLAYER_FLAG_BMX)) ? (HEX_COLOR_LIGHTER_GREEN) : (HEX_COLOR_LIGHTER_RED)));
  897.         DynamicGui_AddRow(playerid, PLAYER_FLAG_BMX);
  898.        
  899.         format(str, sizeof(str), "%s%s02tZamawianien", str, ((PlayerHasFlag(targetid, PLAYER_FLAG_ORDER)) ? (HEX_COLOR_LIGHTER_GREEN) : (HEX_COLOR_LIGHTER_RED)));
  900.         DynamicGui_AddRow(playerid, PLAYER_FLAG_ORDER);
  901.  
  902.         format(str, sizeof(str), "%s%s03tUpr burmistrzan", str, ((PlayerHasFlag(targetid, PLAYER_FLAG_PRESIDENT)) ? (HEX_COLOR_LIGHTER_GREEN) : (HEX_COLOR_LIGHTER_RED)));
  903.         DynamicGui_AddRow(playerid, PLAYER_FLAG_PRESIDENT);
  904.        
  905.         ShowPlayerDialog(playerid, DIALOG_GIVE_FLAG, DIALOG_STYLE_LIST, sprintf("Flagi postaci %s [Global: %d, UID: %d, ID: %d]", pInfo[targetid][player_name], gInfo[targetid][global_id], pInfo[targetid][player_id], targetid), str, "Wybierz", "Zamknij");
  906.         return 1;
  907. }
  908.  
  909. COMMAND:aflags(playerid, params[])
  910. {
  911.         if( !HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie posiadasz uprawnień do korzystania z tej komendy.");
  912.        
  913.         new targetid;
  914.         if( sscanf(params, "u", targetid) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /aflags [id gracza/czesc nicku]");
  915.        
  916.         if( !IsPlayerConnected(targetid) || !pInfo[targetid][player_logged] ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Gracza o podanym id nie ma na serwerze.");
  917.        
  918.         DynamicGui_Init(playerid);
  919.         DynamicGui_SetDialogValue(playerid, targetid);
  920.         new str[500];
  921.        
  922.         format(str, sizeof(str), "%s%s01tRanga GameMasteran", str, ((HasCrewFlag(targetid, CREW_FLAG_GM)) ? (HEX_COLOR_LIGHTER_GREEN) : (HEX_COLOR_LIGHTER_RED)));
  923.         DynamicGui_AddRow(playerid, CREW_FLAG_GM);
  924.        
  925.         format(str, sizeof(str), "%s%s02tRanga Supporteran", str, ((HasCrewFlag(targetid, CREW_FLAG_ADMIN)) ? (HEX_COLOR_LIGHTER_GREEN) : (HEX_COLOR_LIGHTER_RED)));
  926.         DynamicGui_AddRow(playerid, CREW_FLAG_ADMIN);
  927.        
  928.         format(str, sizeof(str), "%s%s03tRanga Admina (czerwony)n", str, ((HasCrewFlag(targetid, CREW_FLAG_ADMIN_ROOT)) ? (HEX_COLOR_LIGHTER_GREEN) : (HEX_COLOR_LIGHTER_RED)));
  929.         DynamicGui_AddRow(playerid, CREW_FLAG_ADMIN_ROOT);
  930.        
  931.         format(str, sizeof(str), "%s%s04tZarzadzanie drzwiamin", str, ((HasCrewFlag(targetid, CREW_FLAG_DOORS)) ? (HEX_COLOR_LIGHTER_GREEN) : (HEX_COLOR_LIGHTER_RED)));
  932.         DynamicGui_AddRow(playerid, CREW_FLAG_DOORS);
  933.        
  934.         format(str, sizeof(str), "%s%s05tZarzadzanie pojazdamin", str, ((HasCrewFlag(targetid, CREW_FLAG_VEHICLES)) ? (HEX_COLOR_LIGHTER_GREEN) : (HEX_COLOR_LIGHTER_RED)));
  935.         DynamicGui_AddRow(playerid, CREW_FLAG_VEHICLES);
  936.        
  937.         format(str, sizeof(str), "%s%s06tZarzadzanie grupamin", str, ((HasCrewFlag(targetid, CREW_FLAG_GROUPS)) ? (HEX_COLOR_LIGHTER_GREEN) : (HEX_COLOR_LIGHTER_RED)));
  938.         DynamicGui_AddRow(playerid, CREW_FLAG_GROUPS);
  939.        
  940.         format(str, sizeof(str), "%s%s07tZarzadzanie strefamin", str, ((HasCrewFlag(targetid, CREW_FLAG_AREAS)) ? (HEX_COLOR_LIGHTER_GREEN) : (HEX_COLOR_LIGHTER_RED)));
  941.         DynamicGui_AddRow(playerid, CREW_FLAG_AREAS);
  942.        
  943.         format(str, sizeof(str), "%s%s08tZarzadzanie obiektami i 3dtextamin", str, ((HasCrewFlag(targetid, CREW_FLAG_EDITOR)) ? (HEX_COLOR_LIGHTER_GREEN) : (HEX_COLOR_LIGHTER_RED)));
  944.         DynamicGui_AddRow(playerid, CREW_FLAG_EDITOR);
  945.        
  946.         format(str, sizeof(str), "%s%s09tZarzadzanie przedmiotamin", str, ((HasCrewFlag(targetid, CREW_FLAG_ITEMS)) ? (HEX_COLOR_LIGHTER_GREEN) : (HEX_COLOR_LIGHTER_RED)));
  947.         DynamicGui_AddRow(playerid, CREW_FLAG_ITEMS);
  948.        
  949.         ShowPlayerDialog(playerid, DIALOG_GIVE_CREW, DIALOG_STYLE_LIST, sprintf("Flagi ekipy postaci %s [Global: %d, UID: %d, ID: %d]", pInfo[targetid][player_name], gInfo[targetid][global_id], pInfo[targetid][player_id], targetid), str, "Wybierz", "Zamknij");
  950.         return 1;
  951. }
  952.  
  953. COMMAND:aduty(playerid, params[])
  954. {
  955.         if( !HasCrewFlag(playerid, CREW_FLAG_GM) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie posiadasz uprawnień do korzystania z tej komendy.");
  956.        
  957.         if( pInfo[playerid][player_admin_duty] )
  958.         {
  959.                 strcopy(pInfo[playerid][player_name], pInfo[playerid][player_duty_tmp], MAX_PLAYER_NAME+1);
  960.                 pInfo[playerid][player_duty_tmp][0] = EOS;
  961.                
  962.                 pInfo[playerid][player_admin_duty] = false;
  963.                 UpdatePlayerLabel(playerid);
  964.                
  965.                 new duty_time = gettime() - pInfo[playerid][player_admin_duty_start] - pInfo[playerid][player_admin_duty_afk_time];
  966.                 GameTextForPlayer(playerid, "ZSZEDLES ZE SLUZBY ADMINISTRACJI.", 5000, 3);
  967.                 SendClientMessage(playerid, 0xD7A064FF, sprintf("Czas przebyty na służbie: %d min %d sek.", floatround(duty_time/60, floatround_floor), duty_time%60));
  968.                
  969.                 mysql_query(mySQLconnection, sprintf("INSERT INTO `ipb_game_sessions` (session_uid, session_type, session_extraid, session_owner, session_start, session_end) VALUES (null, %d, %d, %d, %d, %d)", SESSION_TYPE_ADMIN_DUTY, 0, pInfo[playerid][player_id], pInfo[playerid][player_admin_duty_start], (gettime() - pInfo[playerid][player_admin_duty_afk_time])));
  970.                
  971.                 pInfo[playerid][player_admin_duty_afk_time] = 0;
  972.                 pInfo[playerid][player_admin_duty_start] = 0;
  973.         }
  974.         else
  975.         {
  976.                 if( GetPlayerUsedItem(playerid, ITEM_TYPE_MASKA) > -1 ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie możesz wejść na aduty z założoną maską.");
  977.                 new name[MAX_PLAYER_NAME+1];
  978.                 GetPlayerName(playerid, name, sizeof(name));
  979.  
  980.                 strcopy(pInfo[playerid][player_duty_tmp], name, MAX_PLAYER_NAME+1);
  981.                 strcopy(pInfo[playerid][player_name], pGlobal[playerid][glo_name], MAX_PLAYER_NAME+1);
  982.                 EscapePL(pInfo[playerid][player_name]);
  983.                
  984.                 pInfo[playerid][player_admin_duty] = true;
  985.                
  986.                 UpdatePlayerLabel(playerid);
  987.                
  988.                 pInfo[playerid][player_admin_duty_start] = gettime();
  989.  
  990.                 if( HasCrewFlag(playerid, CREW_FLAG_ITEMS) )
  991.                 {
  992.                         pInfo[playerid][player_capacity] = 50000;
  993.                 }
  994.                
  995.                 GameTextForPlayer(playerid, "WSZEDLES NA SLUZBE ADMINISTRACJI.", 5000, 3);
  996.         }
  997.        
  998.         return 1;
  999. }
  1000.  
  1001. COMMAND:duty(playerid, params[])
  1002. {
  1003.         if( !HasCrewFlag(playerid, CREW_FLAG_GM) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie masz uprawnień do korzystania z tej komendy.");
  1004.         SendClientMessage(playerid, COLOR_GREY, "Tip: /aduty");
  1005.         return 0;
  1006. }
  1007.  
  1008. COMMAND:atime(playerid, params[])
  1009. {
  1010.         if( !HasCrewFlag(playerid, CREW_FLAG_GM) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie masz uprawnień do korzystania z tej komendy.");
  1011.         new time;
  1012.         if( sscanf(params, "d", time) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /atime [godzina]");
  1013.         SetWorldTime(time);
  1014.         return 1;
  1015. }
  1016.  
  1017. COMMAND:aweather(playerid, params[])
  1018. {
  1019.         if( !HasCrewFlag(playerid, CREW_FLAG_GM) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie masz uprawnień do korzystania z tej komendy.");
  1020.         new weather;
  1021.         if( sscanf(params, "d", weather) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /aweather [id pogody]");
  1022.        
  1023.         foreach(new pid: Player)
  1024.         {
  1025.                 if(GetPlayerVirtualWorld(playerid) != 0) continue;
  1026.                 SetPlayerWeather(pid, weather);
  1027.         }
  1028.         WorldWeather = weather;
  1029.         return 1;
  1030. }
  1031.  
  1032. COMMAND:setskin(playerid, params[])
  1033. {
  1034.         if( !HasCrewFlag(playerid, CREW_FLAG_GM) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie masz uprawnień do korzystania z tej komendy.");
  1035.         new targetid, skin;
  1036.         if( sscanf(params, "ud", targetid, skin) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /setskin [id gracza/czesc nicku] [skin]");
  1037.         if( !IsPlayerConnected(targetid) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Gracza o podanym id nie ma na serwerze.");
  1038.         if( !pInfo[targetid][player_logged] ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Gracz o podanym id nie jest zalogowany.");
  1039.        
  1040.         SetPlayerSkin(targetid, skin);
  1041.         pInfo[targetid][player_skin]= skin;
  1042.         mysql_query(mySQLconnection, sprintf("UPDATE `ipb_characters` SET `char_skin` = %d WHERE `char_uid` = %d", skin, pInfo[targetid][player_id]));
  1043.         SendFormattedClientMessage(targetid, COLOR_LIGHTER_RED, "Administrator %s ustawił Ci skin %d.", pInfo[playerid][player_name], skin);
  1044.         if( playerid != targetid ) SendFormattedClientMessage(playerid, COLOR_LIGHTER_RED, "Ustawiłeś graczowi %s (UID: %d, ID: %d) skin %d.", pInfo[targetid][player_name], pInfo[targetid][player_id], targetid, skin);
  1045.        
  1046.         return 1;
  1047. }
  1048.  
  1049. COMMAND:acto(playerid, params[])
  1050. {
  1051.         if( !HasCrewFlag(playerid, CREW_FLAG_GM) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie posiadasz uprawnień do korzystania z tej komendy.");
  1052.        
  1053.         new cmdParam;
  1054.         if( sscanf(params, "d", cmdParam) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /acto [id aktora]");
  1055.  
  1056.         new
  1057.                 Float:x,
  1058.                 Float:y,
  1059.                 Float:z;
  1060.         GetActorPos(cmdParam, x, y, z);
  1061.        
  1062.         RP_PLUS_SetPlayerPos(playerid, x, y, z);
  1063.         SetPlayerVirtualWorld(playerid, GetActorVirtualWorld(cmdParam));
  1064.        
  1065.         FreezePlayer(playerid, 2000);
  1066.        
  1067.         SendFormattedClientMessage(playerid, -1, "{ffffff}Przeteleportowałeś sie do aktora o {b1cfe7}ID: %d.", cmdParam);
  1068.  
  1069.         return 1;
  1070. }
  1071.  
  1072. COMMAND:res(playerid, params[])
  1073. {
  1074.         if( !HasCrewFlag(playerid, CREW_FLAG_GM) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie posiadasz uprawnień do korzystania z tej komendy.");
  1075.        
  1076.         new cmdParam;
  1077.         if( sscanf(params, "u", cmdParam) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /res [id gracza/czesc nicku]");
  1078.         if( (!IsPlayerConnected(cmdParam) || !pInfo[cmdParam][player_logged]) ) return SendClientMessage(playerid, COLOR_GREY, "Ten gracz nie jest zalogowany.");
  1079.  
  1080.         if(pInfo[cmdParam][player_spawn_type] == SPAWN_TYPE_GLOBAL)
  1081.         {
  1082.                 new spawn;
  1083.                 spawn = Iter_Random(GlobalSpawns);     
  1084.                 SetPlayerPos(cmdParam,  GlobalSpawn[spawn][gspawn_pos][0], GlobalSpawn[spawn][gspawn_pos][1], GlobalSpawn[spawn][gspawn_pos][2]);      
  1085.         }
  1086.         else if(pInfo[cmdParam][player_spawn_type] == SPAWN_TYPE_GLOBAL_SC)
  1087.         {
  1088.                 new spawn;
  1089.                 spawn = Iter_Random(ScSpawns);
  1090.                 SetPlayerPos(cmdParam,  GlobalSpawn[spawn][gspawn_pos][0], GlobalSpawn[spawn][gspawn_pos][1], GlobalSpawn[spawn][gspawn_pos][2]);      
  1091.         }
  1092.         else if(pInfo[cmdParam][player_spawn_type] == SPAWN_TYPE_HOUSE)
  1093.         {
  1094.                 new spawn = pInfo[cmdParam][player_spawn];
  1095.                 new d_id = GetDoorByUid(spawn);
  1096.                 if(d_id != -1)
  1097.                 {
  1098.                         SetPlayerPos(cmdParam, Door[d_id][door_spawn_pos][0], Door[d_id][door_spawn_pos][1], Door[d_id][door_spawn_pos][2]);
  1099.                         SetPlayerVirtualWorld(cmdParam, Door[d_id][door_spawn_vw]);
  1100.                         SetPlayerInterior(cmdParam, Door[d_id][door_spawn_int]);
  1101.                 }
  1102.         }
  1103.         else if(pInfo[cmdParam][player_spawn_type] == SPAWN_TYPE_HOTEL)
  1104.         {
  1105.                 new spawn = pInfo[cmdParam][player_spawn];
  1106.                 new d_id = GetDoorByUid(spawn);
  1107.                 if(d_id != -1)
  1108.                 {
  1109.                         SetPlayerPos(cmdParam, Door[d_id][door_spawn_pos][0], Door[d_id][door_spawn_pos][1], Door[d_id][door_spawn_pos][2]);
  1110.                         SetPlayerVirtualWorld(cmdParam, Door[d_id][door_spawn_vw]);
  1111.                         SetPlayerInterior(cmdParam, Door[d_id][door_spawn_int]);
  1112.                 }
  1113.         }
  1114.  
  1115.         FreezePlayer(cmdParam, 2000);
  1116.  
  1117.         SendFormattedClientMessage(playerid, -1, "{ffffff}Zrestowałeś gracza {b1cfe7}%s (ID: %d, UID: %d).", pInfo[cmdParam][player_name], cmdParam, pInfo[cmdParam][player_id]);
  1118.         return 1;
  1119. }
  1120.  
  1121. COMMAND:goto(playerid, params[])
  1122. {
  1123.         return cmd_to(playerid, params);
  1124. }
  1125.  
  1126. COMMAND:to(playerid, params[])
  1127. {
  1128.         if( !HasCrewFlag(playerid, CREW_FLAG_GM) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie posiadasz uprawnień do korzystania z tej komendy.");
  1129.        
  1130.         new cmdParam;
  1131.         if( sscanf(params, "u", cmdParam) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /to [id gracza/część nicku]");
  1132.         if( (!IsPlayerConnected(cmdParam) || !pInfo[cmdParam][player_logged]) ) return SendClientMessage(playerid, COLOR_GREY, "Ten gracz nie jest zalogowany.");
  1133.  
  1134.         new
  1135.                 Float:x,
  1136.                 Float:y,
  1137.                 Float:z;
  1138.         GetPlayerPos(cmdParam, x, y, z);
  1139.        
  1140.         RP_PLUS_SetPlayerPos(playerid, x, y, z);
  1141.         SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(cmdParam));
  1142.         SetPlayerInterior(playerid, GetPlayerInterior(cmdParam));
  1143.        
  1144.         FreezePlayer(playerid, 2000);
  1145.        
  1146.  
  1147.  
  1148.         return 1;
  1149. }
  1150.  
  1151. COMMAND:gethere(playerid, params[])
  1152. {
  1153.         return cmd_tm(playerid, params);
  1154. }
  1155.  
  1156. COMMAND:takecash(playerid, params[])
  1157. {
  1158.         if( !HasCrewFlag(playerid, CREW_FLAG_GM) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie posiadasz uprawnień do korzystania z tej komendy.");
  1159.        
  1160.         new cmdParam, cash;
  1161.         if( sscanf(params, "ud", cmdParam, cash) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /takecash [id gracza/część nicku] [kwota]0");
  1162.         if( (!IsPlayerConnected(cmdParam) || !pInfo[cmdParam][player_logged]) ) return SendClientMessage(playerid, COLOR_GREY, "Ten gracz nie jest zalogowany.");
  1163.  
  1164.         GivePlayerMoney(cmdParam, -cash);
  1165.        
  1166.         SendFormattedClientMessage(cmdParam, -1, "{ffffff}Administrator {b1cfe7}%s {ffffff}zabrał Ci {b1cfe7}$%d.", pInfo[playerid][player_name], cash);
  1167.         SendFormattedClientMessage(playerid, -1, "{ffffff}Zabrałeś {b1cfe7}$%d {ffffff}graczowi {b1cfe7}%s (ID: %d, UID: %d){ffffff}.", cash, pInfo[cmdParam][player_name], cmdParam, pInfo[cmdParam][player_id]);
  1168.  
  1169.         return 1;
  1170. }
  1171.  
  1172. COMMAND:tm(playerid, params[])
  1173. {
  1174.         if( !HasCrewFlag(playerid, CREW_FLAG_GM) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie posiadasz uprawnień do korzystania z tej komendy.");
  1175.        
  1176.         new cmdParam;
  1177.         if( sscanf(params, "u", cmdParam) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /tm [id gracza/część nicku]");
  1178.         if( (!IsPlayerConnected(cmdParam) || !pInfo[cmdParam][player_logged]) ) return SendClientMessage(playerid, COLOR_GREY, "Ten gracz nie jest zalogowany.");
  1179.  
  1180.         new
  1181.                 Float:x,
  1182.                 Float:y,
  1183.                 Float:z;
  1184.         GetPlayerPos(playerid, x, y, z);
  1185.        
  1186.         RP_PLUS_SetPlayerPos(cmdParam, x, y, z);
  1187.         SetPlayerVirtualWorld(cmdParam, GetPlayerVirtualWorld(playerid));
  1188.         SetPlayerInterior(cmdParam, GetPlayerInterior(playerid));
  1189.        
  1190.         FreezePlayer(cmdParam, 2000);
  1191.        
  1192.         SendFormattedClientMessage(cmdParam, -1, "{ffffff}Administrator {b1cfe7}%s {ffffff}przeteleportował Cie do siebie.", pInfo[playerid][player_name]);
  1193.  
  1194.         return 1;
  1195. }
  1196.  
  1197. COMMAND:tp(playerid, params[])
  1198. {
  1199.         if( !HasCrewFlag(playerid, CREW_FLAG_GM) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie posiadasz uprawnień do korzystania z tej komendy.");
  1200.        
  1201.         new cmdParam[2];
  1202.         if( sscanf(params, "a<i>[2]", cmdParam) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /tp [kogo] [do kogo]");
  1203.         if( (!IsPlayerConnected(cmdParam[0]) || !pInfo[cmdParam[0]][player_logged]) || (!IsPlayerConnected(cmdParam[1]) || !pInfo[cmdParam[1]][player_logged]) ) return SendClientMessage(playerid, COLOR_GREY, "Jeden z graczy nie jest zalogowany.");
  1204.        
  1205.         new
  1206.                 Float:x,
  1207.                 Float:y,
  1208.                 Float:z;
  1209.         GetPlayerPos(cmdParam[1], x, y, z);
  1210.        
  1211.         RP_PLUS_SetPlayerPos(cmdParam[0], x, y, z);
  1212.         SetPlayerVirtualWorld(cmdParam[0], GetPlayerVirtualWorld(cmdParam[1]));
  1213.         SetPlayerInterior(cmdParam[0], GetPlayerInterior(cmdParam[1]));
  1214.        
  1215.         FreezePlayer(cmdParam[0], 2500);
  1216.                                
  1217.  
  1218.         SendFormattedClientMessage(cmdParam[0], -1, "{b1cfe7}%s {ffffff}przeteleportował Cie do gracza {b1cfe7}%s (ID: %d, UID: %d){ffffff}.", pInfo[playerid][player_name], pInfo[cmdParam[1]][player_name], cmdParam[1], pInfo[cmdParam[1]][player_id]);
  1219.  
  1220.         return 1;
  1221. }
  1222.  
  1223. COMMAND:aspawn(playerid, params[])
  1224. {
  1225.         if( !HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie posiadasz uprawnień do korzystania z tej komendy.");
  1226.        
  1227.         new sub_cmd[40], param[150];
  1228.         if( sscanf(params, "s[40] S()[150]", sub_cmd, param) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /aspawn [stworz/usun]");
  1229.        
  1230.         if( !strcmp(sub_cmd, "stworz", false) )
  1231.         {
  1232.                 new type;
  1233.                 if( sscanf(param, "d", type) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /aspawn stworz [typ]");
  1234.  
  1235.                 if(type <1 || type > 2) return SendClientMessage(playerid, COLOR_GREY, "Typy spawnów: 1(Market), 2(Idlewood)");
  1236.  
  1237.                 new Float:pPos[4];
  1238.                
  1239.                 GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
  1240.                 GetPlayerFacingAngle(playerid, pPos[3]);
  1241.                
  1242.                 mysql_query(mySQLconnection, sprintf("INSERT INTO `ipb_gspawns` (gspawn_uid, gspawn_posx, gspawn_posy, gspawn_posz, gspawn_posa, gspawn_type) VALUES (null, %f, %f, %f, %f, %d)", pPos[0], pPos[1], pPos[2], pPos[3], type));
  1243.                
  1244.                 new id = cache_insert_id();
  1245.                 new i;
  1246.  
  1247.                 if(type == SPAWN_TYPE_GLOBAL)
  1248.                 {
  1249.                         i = Iter_Free(GlobalSpawns);
  1250.                 }
  1251.                 else
  1252.                 {
  1253.                         i = Iter_Free(ScSpawns);
  1254.                 }
  1255.  
  1256.                 GlobalSpawn[i][gspawn_id] = id;
  1257.                 GlobalSpawn[i][gspawn_pos][0] = pPos[0];
  1258.                 GlobalSpawn[i][gspawn_pos][1] = pPos[1];
  1259.                 GlobalSpawn[i][gspawn_pos][2] = pPos[2];
  1260.                 GlobalSpawn[i][gspawn_pos][3] = pPos[3];
  1261.                
  1262.                 if(type == SPAWN_TYPE_GLOBAL)
  1263.                 {
  1264.                         Iter_Add(GlobalSpawns, i);
  1265.                         SendFormattedClientMessage(playerid, -1, "{ffffff}Dodano nowy globalny spawn (Market) {b1cfe7}(ID: %d).", i);
  1266.                 }
  1267.                 else
  1268.                 {
  1269.                         Iter_Add(ScSpawns, i);
  1270.                         SendFormattedClientMessage(playerid, -1, "{ffffff}Dodano nowy globalny spawn (South Central) {b1cfe7}(ID: %d).", i);
  1271.                 }
  1272.         }
  1273.         else if( !strcmp(sub_cmd, "usun") )
  1274.         {
  1275.                 new id;
  1276.                 if( sscanf(param, "d", id) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /aspawn usun [id spawnu]");
  1277.                 if( id < 0 || id >= MAX_GLOBAL_SPAWNS ) return SendClientMessage(playerid, COLOR_GREY, "Niepoprawne id spawnu.");
  1278.                 if( !Iter_Contains(GlobalSpawns, id) ) return SendClientMessage(playerid, COLOR_GREY, "Niepoprawne id spawnu.");
  1279.                
  1280.                 mysql_query(mySQLconnection, sprintf("DELETE FROM `ipb_gspawns` WHERE `gspawn_uid` = %d", GlobalSpawn[id][gspawn_id]));
  1281.                
  1282.                 for(new z=0; e_global_spawns:z != e_global_spawns; z++)
  1283.                 {
  1284.                         GlobalSpawn[id][e_global_spawns:z] = 0;
  1285.                 }
  1286.                
  1287.                 Iter_Remove(GlobalSpawns, id);
  1288.                
  1289.                 SendFormattedClientMessage(playerid, -1, "{ffffff}Usunięto globalny spawn {b1cfe7}(ID: %d).", id);
  1290.         }
  1291.         else return SendClientMessage(playerid, COLOR_GREY, "Tip: /aspawn [stworz/usun]");
  1292.        
  1293.         return 1;
  1294. }
  1295.  
  1296. COMMAND:glob(playerid, params[])
  1297. {
  1298.         if( !HasCrewFlag(playerid, CREW_FLAG_ADMIN) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT) && !HasCrewFlag(playerid, CREW_FLAG_GM) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie posiadasz uprawnień do korzystania z tej komendy.");
  1299.        
  1300.         new text[290];
  1301.         if( sscanf(params, "s[290]", text) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /glob [tekst]");
  1302.        
  1303.         format(text, sizeof(text), "[[ %s: %s ]]", pInfo[playerid][player_name], BeautifyString(text));
  1304.         foreach(new p : Player)
  1305.         {
  1306.                 if( !pInfo[p][player_logged] ) continue;
  1307.                 SendClientMessage(p, 0xEFE7ADFF, text);
  1308.         }
  1309.        
  1310.         return 1;
  1311. }
  1312.  
  1313. COMMAND:ac(playerid, params[])
  1314. {
  1315.         if( !HasCrewFlag(playerid, CREW_FLAG_GM) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie masz uprawnień do korzystania z tej komendy.");
  1316.         if( isnull(params) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /ac [tekst]");
  1317.        
  1318.         new text[200];
  1319.         if( HasCrewFlag(playerid, CREW_FLAG_GM) ) format(text, sizeof(text), "{ffffff}(( [AC][GM] %s%s{ffffff}: %s ))", HEX_COLOR_CREW_GM, pInfo[playerid][player_name], params);
  1320.         if( HasCrewFlag(playerid, CREW_FLAG_ADMIN) ) format(text, sizeof(text), "{ffffff}(( [AC][SUPPORT] %s%s{ffffff}: %s ))", HEX_COLOR_CREW_ADMIN, pInfo[playerid][player_name], params);
  1321.         if( HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT) ) format(text, sizeof(text), "{ffffff}(( [AC][ZARZAD] %s%s{ffffff}: %s ))", HEX_COLOR_CREW_ADMIN_ROOT, pInfo[playerid][player_name], params);
  1322.        
  1323.         foreach(new p : Player)
  1324.         {
  1325.                 if( !pInfo[p][player_logged] ) continue;
  1326.                 if( !HasCrewFlag(p, CREW_FLAG_GM) && !HasCrewFlag(p, CREW_FLAG_ADMIN) && !HasCrewFlag(p, CREW_FLAG_ADMIN_ROOT) ) continue;
  1327.                
  1328.                 SendClientMessage(p, 0xEFE7ADFF, text);
  1329.         }
  1330.        
  1331.         return 1;
  1332. }
  1333.  
  1334.  
  1335.  
  1336. COMMAND:zac(playerid, params[])
  1337. {
  1338.         if( !HasCrewFlag(playerid, CREW_FLAG_GM) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Do tego chatu ma dostęp tylko zarząd.");
  1339.         if( isnull(params) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /zac [tekst]");
  1340.        
  1341.         new text[200];
  1342.         if( HasCrewFlag(playerid, CREW_FLAG_GM) ) format(text, sizeof(text), "{ffffff}(( [Zarzad] %s%s{ffffff}: %s ))", HEX_COLOR_CREW_GM, pInfo[playerid][player_name], params);
  1343.        
  1344.         foreach(new p : Player)
  1345.         {
  1346.                 if( !pInfo[p][player_logged] ) continue;
  1347.                 if( !HasCrewFlag(p, CREW_FLAG_ADMIN_ROOT) ) continue;
  1348.                
  1349.                 SendClientMessage(p, 0xEFE7ADFF, text);
  1350.         }
  1351.        
  1352.         return 1;
  1353. }
  1354.  
  1355.  
  1356.  
  1357. COMMAND:hp(playerid, params[])
  1358. {
  1359.         if( !HasCrewFlag(playerid, CREW_FLAG_GM) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie masz uprawnień do korzystania z tej komendy.");
  1360.         new targetid, health;
  1361.         if( sscanf(params, "ud", targetid, health) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /hp [id gracza/czesc nicku] [hp]");
  1362.         if( !IsPlayerConnected(targetid) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Gracz o podanym id nie jest podłączony.");
  1363.         if( !pInfo[targetid][player_logged] ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Gracz o podanym id nie jest zalogowany.");
  1364.         if( health < 0 ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /hp [id gracza] [hp]");
  1365.        
  1366.         SetPlayerHealth(targetid, health);
  1367.         SendFormattedClientMessage(targetid, COLOR_LIGHTER_RED, "Administrator %s ustawił Ci %d hp.", pInfo[playerid][player_name], health);
  1368.         if( playerid != targetid ) SendFormattedClientMessage(playerid, COLOR_LIGHTER_RED, "Ustawiłeś graczowi %s (UID: %d, ID: %d) %d zycia.", pInfo[targetid][player_name], pInfo[targetid][player_id], targetid, health);
  1369.        
  1370.         return 1;
  1371. }
  1372.  
  1373. COMMAND:ad(playerid, params[])
  1374. {
  1375.         return cmd_adrzwi(playerid, params);
  1376. }
  1377.  
  1378. COMMAND:adrzwi(playerid, params[])
  1379. {
  1380.         if( !HasCrewFlag(playerid, CREW_FLAG_DOORS) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie posiadasz uprawnień do korzystania z tej komendy.");
  1381.        
  1382.         new sub_cmd[40], param[150];
  1383.         if( sscanf(params, "s[40] S()[150]", sub_cmd, param) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ad)rzwi [stworz/usun/pickup/czynsz/mieszkanie/mapicon/goto/przypisz/interior/wejscie/exitvw/objects/przeladuj]");
  1384.        
  1385.        
  1386.         if( !strcmp(sub_cmd, "stworz", false) )
  1387.         {
  1388.                 new name[50];
  1389.                 if( sscanf(param, "s[50]", name) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ad)rzwi stworz [nazwa]");
  1390.                
  1391.                 new Float:pPos[4];
  1392.                
  1393.                 GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
  1394.                 GetPlayerFacingAngle(playerid, pPos[3]);
  1395.                 mysql_real_escape_string(name, name);
  1396.  
  1397.                 new str[400];
  1398.                 strcat(str, "INSERT INTO ipb_doors (door_uid, door_owner, door_ownertype, door_name, door_type, door_pickupid, door_enterx, door_entery, door_enterz, door_entera, door_entervw, door_enterint, door_exitx, door_exity, door_exitz, door_exita) ");
  1399.                 strcat(str, sprintf("VALUES (null, 0, 0, '%s', 1, 1239, %f, %f, %f, %f, %d, %d, %f, %f, %f, %f)", name, pPos[0], pPos[1], pPos[2], pPos[3], GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), pPos[0], pPos[1], pPos[2], pPos[3]));
  1400.                
  1401.                 mysql_query(mySQLconnection, str);
  1402.                 new uid = cache_insert_id();
  1403.                
  1404.                 new did = LoadDoor(sprintf("WHERE `door_uid` = %d", uid), true);
  1405.  
  1406.                 SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Drzwi zostały utworzone. [UID: %d, ID: %d]", uid, did));
  1407.         }
  1408.         else if( !strcmp(sub_cmd, "dom", false) )
  1409.         {
  1410.                 new d_id;
  1411.                 if( sscanf(param, "d", d_id) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ad)rzwi dom [id drzwi]");
  1412.                 if( !Iter_Contains(Doors, d_id) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ad)rzwi dom [id drzwi]");
  1413.  
  1414.                 if(Door[d_id][door_buyable] == 0)
  1415.                 {
  1416.                         SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Włączyłeś funkcje kupna tych drzwi.");
  1417.                         Door[d_id][door_buyable]=1;
  1418.                         mysql_query(mySQLconnection, sprintf("UPDATE `ipb_doors` SET `door_buyable` = 1 WHERE `door_uid` = %d", Door[d_id][door_uid]));
  1419.                 }
  1420.                 else
  1421.                 {
  1422.                         SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Wyłączyłes drzwi z funkcji kupna.");
  1423.                         Door[d_id][door_buyable]=0;
  1424.                         mysql_query(mySQLconnection, sprintf("UPDATE `ipb_doors` SET `door_buyable` = 0 WHERE `door_uid` = %d", Door[d_id][door_uid]));
  1425.                 }
  1426.         }
  1427.         else if( !strcmp(sub_cmd, "id", false) )
  1428.         {
  1429.                 new d_uid;
  1430.                 if( sscanf(param, "d", d_uid) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ad)rzwi id [uid drzwi]");
  1431.                 new d_id = GetDoorByUid(d_uid);
  1432.                 if(d_id == -1) return SendGuiInformation(playerid, "Informacja", "Takie drzwi nie istnieją.");
  1433.                 SendClientMessage(playerid, -1, sprintf("{ffffff}SAMPid drzwi o {b1cfe7}UID %d {ffffff}to:{b1cfe7} %d", d_uid, d_id));
  1434.         }
  1435.         else if( !strcmp(sub_cmd, "cena", false) )
  1436.         {
  1437.                 new d_id, czynsz;
  1438.                 if( sscanf(param, "dd", d_id, czynsz) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ad)rzwi cena [id drzwi] [kwota]");      
  1439.                 if( !Iter_Contains(Doors, d_id) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ad)rzwi cena [id drzwi] [kwota]");
  1440.  
  1441.                 if(Door[d_id][door_buyable] == 1)
  1442.                 {
  1443.                         Door[d_id][door_price]=czynsz;
  1444.                         SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nowa cena została ustalona.");
  1445.                         mysql_query(mySQLconnection, sprintf("UPDATE `ipb_doors` SET `door_price` = %d WHERE `door_uid` = %d", czynsz, Door[d_id][door_uid]));
  1446.  
  1447.                 }
  1448.                 else
  1449.                 {
  1450.                         SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie mozesz ustalic ceny dla domu ktory nie ma wlaczonej funkcji kupna.");
  1451.                 }
  1452.         }
  1453.         else if( !strcmp(sub_cmd, "mieszkanie", false) )
  1454.         {
  1455.                 new d_id;
  1456.                 if( sscanf(param, "d", d_id) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ad)rzwi mieszkanie [id drzwi]"); 
  1457.                 if( !Iter_Contains(Doors, d_id) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ad)rzwi mieszkanie [id drzwi]");
  1458.  
  1459.                 if(Door[d_id][door_rentable] == 0)
  1460.                 {
  1461.                         SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Włączyłeś funkcje wynajęcia tych drzwi.");
  1462.                         Door[d_id][door_rentable]=1;
  1463.                         mysql_query(mySQLconnection, sprintf("UPDATE `ipb_doors` SET `door_rentable` = 1 WHERE `door_uid` = %d", Door[d_id][door_uid]));
  1464.                 }
  1465.                 else
  1466.                 {
  1467.                         SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Wyłączłeś drzwi z funkcji wynajęcia.");
  1468.                         Door[d_id][door_rentable]=0;
  1469.                         mysql_query(mySQLconnection, sprintf("UPDATE `ipb_doors` SET `door_rentable` = 0 WHERE `door_uid` = %d", Door[d_id][door_uid]));
  1470.                 }
  1471.         }
  1472.         else if( !strcmp(sub_cmd, "czynsz", false) )
  1473.         {
  1474.                 new d_id, czynsz;
  1475.                 if( sscanf(param, "dd", d_id, czynsz) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ad)rzwi czynsz [id drzwi] [kwota]");    
  1476.                 if( !Iter_Contains(Doors, d_id) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ad)rzwi czynsz [id drzwi] [kwota]");
  1477.  
  1478.                 if(Door[d_id][door_rentable] == 1)
  1479.                 {
  1480.                         Door[d_id][door_rent]=czynsz;
  1481.                         SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nowy czynsz został ustalony.");
  1482.                         mysql_query(mySQLconnection, sprintf("UPDATE `ipb_doors` SET `door_rent` = %d WHERE `door_uid` = %d", czynsz, Door[d_id][door_uid]));
  1483.  
  1484.                 }
  1485.                 else
  1486.                 {
  1487.                         SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie możesz ustalić czynszu dla mieszkania które nie ma włącznej funkcji wynajęcia.");
  1488.                 }
  1489.         }
  1490.         else if( !strcmp(sub_cmd, "usun", false) )
  1491.         {
  1492.                 new d_id;
  1493.                 if( sscanf(param, "d", d_id) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ad)rzwi usun [id drzwi]");       
  1494.                 if( !Iter_Contains(Doors, d_id) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ad)rzwi usun [id drzwi]");
  1495.  
  1496.                 mysql_query(mySQLconnection, sprintf("UPDATE ipb_characters SET char_spawn = 0, char_spawn_type = 1 WHERE char_spawn_type = %d AND char_spawn = %d", pInfo[playerid][player_spawn_type] == SPAWN_TYPE_HOUSE, Door[d_id][door_uid]));
  1497.                
  1498.                 SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Usunięto drzwi o UID %d.", Door[d_id][door_uid]));
  1499.                 printf("[ADMIN] %s (UID %d) skasował drzwi UID %d. (%s)", pInfo[playerid][player_name], pInfo[playerid][player_id], Door[d_id][door_uid], Door[d_id][door_name]);
  1500.                 DeleteDoor(d_id);
  1501.         }
  1502.         else if( !strcmp(sub_cmd, "pickup") )
  1503.         {
  1504.                 new d_id;
  1505.                 if( sscanf(param, "d", d_id) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ad)rzwi pickup [id drzwi]");     
  1506.                 if( !Iter_Contains(Doors, d_id) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ad)rzwi pickup [id drzwi]");
  1507.                
  1508.                 new str[512];
  1509.                
  1510.                 DynamicGui_Init(playerid);
  1511.                 DynamicGui_SetDialogValue(playerid, d_id);
  1512.                
  1513.                 format(str, sizeof(str), "%s01tSerce (1240)n", str);
  1514.                 DynamicGui_AddRow(playerid, 0, 1240);
  1515.                
  1516.                 format(str, sizeof(str), "%s02tKamizelka (1242)n", str);
  1517.                 DynamicGui_AddRow(playerid, 0, 1242);
  1518.                
  1519.                 format(str, sizeof(str), "%s03tLiterka 'i' (1239)n", str);
  1520.                 DynamicGui_AddRow(playerid, 0, 1239);
  1521.                
  1522.                 format(str, sizeof(str), "%s04tNiebieski domek (1272)n", str);
  1523.                 DynamicGui_AddRow(playerid, 0, 1272);
  1524.                
  1525.                 format(str, sizeof(str), "%s05tZielony domek (1273)n", str);
  1526.                 DynamicGui_AddRow(playerid, 0, 1273);
  1527.                
  1528.                 format(str, sizeof(str), "%s06tPlik gotówki (1212)n", str);
  1529.                 DynamicGui_AddRow(playerid, 0, 1212);
  1530.                
  1531.                 format(str, sizeof(str), "%s07tPigulka (1241)n", str);
  1532.                 DynamicGui_AddRow(playerid, 0, 1241);
  1533.                
  1534.                 format(str, sizeof(str), "%s08tOdznaka (1247)n", str);
  1535.                 DynamicGui_AddRow(playerid, 0, 1247);
  1536.                
  1537.                 format(str, sizeof(str), "%s09tDolar (1274)n", str);
  1538.                 DynamicGui_AddRow(playerid, 0, 1274);
  1539.                
  1540.                 format(str, sizeof(str), "%s10tNiebieska koszulka (1275)n", str);
  1541.                 DynamicGui_AddRow(playerid, 0, 1275);
  1542.  
  1543.                 format(str, sizeof(str), "%s11tSztanga (3072)n", str);
  1544.                 DynamicGui_AddRow(playerid, 0, 3072);
  1545.  
  1546.                 format(str, sizeof(str), "%s12tLudzik (1314)n", str);
  1547.                 DynamicGui_AddRow(playerid, 0, 1314);
  1548.                
  1549.                 format(str, sizeof(str), "%s13tTabliczka Sell (19470)n", str);
  1550.                 DynamicGui_AddRow(playerid, 0, 19470);
  1551.  
  1552.                 format(str, sizeof(str), "%s14tMłotek (18635)n", str);
  1553.                 DynamicGui_AddRow(playerid, 0, 18635);
  1554.  
  1555.                 format(str, sizeof(str), "%s15tPłyta Radia (1961)n", str);
  1556.                 DynamicGui_AddRow(playerid, 0, 1961);
  1557.  
  1558.                 format(str, sizeof(str), "%s16tCzerwony domek (19522)n", str);
  1559.                 DynamicGui_AddRow(playerid, 0, 19522);
  1560.  
  1561.                 format(str, sizeof(str), "%s17tŻółty domek (19524)n", str);
  1562.                 DynamicGui_AddRow(playerid, 0, 19524);
  1563.  
  1564.                 format(str, sizeof(str), "%s18tWalizka (19624)n", str);
  1565.                 DynamicGui_AddRow(playerid, 0, 19624);
  1566.  
  1567.                 format(str, sizeof(str), "%s19tDyskietka (1277)n", str);
  1568.                 DynamicGui_AddRow(playerid, 0, 1277);
  1569.  
  1570.                 ShowPlayerDialog(playerid, DIALOG_ADRZWI_PICKUP, DIALOG_STYLE_LIST, sprintf("Drzwi %d (%s; SampID: %d)", Door[d_id][door_uid], Door[d_id][door_name], d_id), str, "Wybierz", "Zamknij");
  1571.         }
  1572.         else if( !strcmp(sub_cmd, "mapicon") )
  1573.         {
  1574.                 new d_id, model;
  1575.                 if( sscanf(param, "dd", d_id, model) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ad)rzwi mapicon [id drzwi] [model map ikony(-1 aby usunac)]");   
  1576.                 if( !Iter_Contains(Doors, d_id) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ad)rzwi pickup [model map ikony(-1 aby usunac)]");
  1577.                
  1578.                 mysql_query(mySQLconnection, sprintf("UPDATE `ipb_doors` SET `door_mapmodel` = %d WHERE `door_uid` = %d", model, Door[d_id][door_uid]));
  1579.                        
  1580.                 new uid = Door[d_id][door_uid];
  1581.                 DeleteDoor(d_id, false);
  1582.                
  1583.                 new did = LoadDoor(sprintf("WHERE `door_uid` = %d", uid), true);
  1584.                 SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Ikona mapy drzwi została pomyślnie zmieniona! [ICON: %d, UID: %d, ID: %d]", model, uid, did));
  1585.         }
  1586.         else if( !strcmp(sub_cmd, "goto") )
  1587.         {
  1588.                 new d_id;
  1589.                 if( sscanf(param, "d", d_id) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ad)rzwi goto [id drzwi]");       
  1590.                 if( !Iter_Contains(Doors, d_id) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ad)rzwi goto [id drzwi]");
  1591.                
  1592.                 FreezePlayer(playerid, 2500);
  1593.                                
  1594.                 RP_PLUS_SetPlayerPos(playerid, Door[d_id][door_pos][0], Door[d_id][door_pos][1], Door[d_id][door_pos][2]);
  1595.                 SetPlayerFacingAngle(playerid, Door[d_id][door_pos][3]);
  1596.                
  1597.                 SetCameraBehindPlayer(playerid);
  1598.                
  1599.                 SetPlayerVirtualWorld(playerid, Door[d_id][door_vw]);
  1600.                 SetPlayerInterior(playerid, Door[d_id][door_int]);
  1601.                
  1602.                 SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Teleportowałeś sie do drzwi [UID: %d, ID: %d].", Door[d_id][door_uid], d_id));
  1603.         }
  1604.         else if( !strcmp(sub_cmd, "przypisz") )
  1605.         {
  1606.                 new d_id, action[32], who;
  1607.                 if( sscanf(param, "ds[32]d", d_id, action, who) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ad)rzwi przypisz [id drzwi] [grupa/gracz/globalne] [uid grupy/id gracza(nie uid)]");
  1608.                 if( !Iter_Contains(Doors, d_id) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ad)rzwi przypisz [id drzwi] [grupa/gracz] [uid grupy/id gracza(nie uid)]");
  1609.                
  1610.                 if( !strcmp(action, "grupa") )
  1611.                 {
  1612.                         new gid = GetGroupByUid(who);
  1613.                         if( gid == -1 ) return SendClientMessage(playerid, COLOR_GREY, "Grupa o podanym uid nie istnieje.");
  1614.                        
  1615.                         mysql_query(mySQLconnection, sprintf("UPDATE `ipb_doors` SET `door_ownertype` = %d, `door_owner` = %d WHERE `door_uid` = %d", DOOR_OWNER_TYPE_GROUP, who, Door[d_id][door_uid]));
  1616.                        
  1617.                         Door[d_id][door_owner_type] = DOOR_OWNER_TYPE_GROUP;
  1618.                         Door[d_id][door_owner] = who;
  1619.                        
  1620.                         SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Pomyślnie zmieniłeś wlasciciela drzwi [UID: %d, ID: %d] na grupe %s [UID: %d, ID: %d].", Door[d_id][door_uid], d_id, Group[gid][group_name], Group[gid][group_uid], gid));
  1621.                 }
  1622.                 else if( !strcmp(action, "gracz") )
  1623.                 {
  1624.                         if( !IsPlayerConnected(who) ) return SendClientMessage(playerid, COLOR_GREY, "Gracz o podanym id nie jest podłączony.");
  1625.                        
  1626.                         mysql_query(mySQLconnection, sprintf("UPDATE `ipb_doors` SET `door_ownertype` = %d, `door_owner` = %d WHERE `door_uid` = %d", DOOR_OWNER_TYPE_PLAYER, pInfo[who][player_id], Door[d_id][door_uid]));
  1627.                        
  1628.                         Door[d_id][door_owner_type] = DOOR_OWNER_TYPE_PLAYER;
  1629.                         Door[d_id][door_owner] = pInfo[who][player_id];
  1630.                        
  1631.                         SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Pomyślnie zmieniłeś wlasciciela drzwi [UID: %d, ID: %d] na gracza %s [UID: %d, ID: %d].", Door[d_id][door_uid], d_id, pInfo[who][player_name], pInfo[who][player_id], who));
  1632.                 }
  1633.                 else if( !strcmp(action, "globalne") )
  1634.                 {
  1635.                         mysql_query(mySQLconnection, sprintf("UPDATE `ipb_doors` SET `door_ownertype` = %d, `door_owner` = 0 WHERE `door_uid` = %d", DOOR_OWNER_TYPE_GLOBAL, Door[d_id][door_uid]));
  1636.                        
  1637.                         Door[d_id][door_owner_type] = DOOR_OWNER_TYPE_GLOBAL;
  1638.                         Door[d_id][door_owner] = 0;
  1639.                        
  1640.                         SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Pomyślnie zmieniłeś wlasciciela drzwi [UID: %d, ID: %d] na globalnego.", Door[d_id][door_uid], d_id));
  1641.                 }
  1642.                 else return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ad)rzwi przypisz [id drzwi] [grupa/postac] [uid grupy/id gracza(nie uid)]");       
  1643.         }
  1644.         else if( !strcmp(sub_cmd, "interior") )
  1645.         {
  1646.                 new d_id;
  1647.                 if( sscanf(param, "d", d_id) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ad)rzwi interior [id drzwi]");   
  1648.                 if( !Iter_Contains(Doors, d_id) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ad)rzwi interior [id drzwi]");
  1649.                
  1650.                 DoorsDefaultInteriorsList(playerid, d_id);
  1651.         }
  1652.         else if( !strcmp(sub_cmd, "wejscie") )
  1653.         {
  1654.                 new d_id;
  1655.                 if( sscanf(param, "d", d_id) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ad)rzwi wejscie [id drzwi]");    
  1656.                 if( !Iter_Contains(Doors, d_id) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ad)rzwi wejscie [id drzwi]");
  1657.                
  1658.                 GetPlayerPos(playerid, Door[d_id][door_pos][0], Door[d_id][door_pos][1], Door[d_id][door_pos][2]);
  1659.                 GetPlayerFacingAngle(playerid, Door[d_id][door_pos][3]);
  1660.                
  1661.                 mysql_query(mySQLconnection, sprintf("UPDATE `ipb_doors` SET `door_enterx` = %f, `door_entery` = %f, `door_enterz` = %f, `door_entera` = %f, door_entervw = %d WHERE `door_uid` = %d", Door[d_id][door_pos][0], Door[d_id][door_pos][1], Door[d_id][door_pos][2], Door[d_id][door_pos][3], GetPlayerVirtualWorld(playerid), Door[d_id][door_uid]));            
  1662.                
  1663.                 new uid = Door[d_id][door_uid];
  1664.                 DeleteDoor(d_id, false);
  1665.                
  1666.                 new did = LoadDoor(sprintf("WHERE `door_uid` = %d", uid), true);
  1667.                
  1668.                 SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Pozycja zewnetrznych drzwi została pomyślnie zmieniona [UID: %d, ID: %d].", Door[d_id][door_uid], did));
  1669.         }
  1670.         else if( !strcmp(sub_cmd, "wyjscie") )
  1671.         {
  1672.                 new d_id;
  1673.                 if( sscanf(param, "d", d_id) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ad)rzwi wyjscie [id drzwi]");    
  1674.                 if( !Iter_Contains(Doors, d_id) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ad)rzwi wyjscie [id drzwi]");
  1675.                
  1676.                 GetPlayerPos(playerid, Door[d_id][door_spawn_pos][0], Door[d_id][door_spawn_pos][1], Door[d_id][door_spawn_pos][2]);
  1677.                 GetPlayerFacingAngle(playerid, Door[d_id][door_spawn_pos][3]);
  1678.                
  1679.                 mysql_query(mySQLconnection, sprintf("UPDATE `ipb_doors` SET `door_exitx` = %f, `door_exity` = %f, `door_exitz` = %f, `door_exita` = %f WHERE `door_uid` = %d", Door[d_id][door_spawn_pos][0], Door[d_id][door_spawn_pos][1], Door[d_id][door_spawn_pos][2], Door[d_id][door_spawn_pos][3], Door[d_id][door_uid]));            
  1680.                
  1681.                 new uid = Door[d_id][door_uid];
  1682.                 DeleteDoor(d_id, false);
  1683.                
  1684.                 new did = LoadDoor(sprintf("WHERE `door_uid` = %d", uid), true);
  1685.                
  1686.                 SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Pozycja wewnetrznych drzwi została pomyślnie zmieniona [UID: %d, ID: %d].", Door[d_id][door_uid], did));
  1687.         }
  1688.         else if( !strcmp(sub_cmd, "objects") )
  1689.         {
  1690.                 new d_id, limit;
  1691.                 if( sscanf(param, "dd", d_id, limit) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ad)rzwi objects [id drzwi] [limit obiektów]");  
  1692.                 if( !Iter_Contains(Doors, d_id) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ad)rzwi objects [id drzwi] [limit obiektów]");
  1693.                 if( limit < 0 ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ad)rzwi objects [id drzwi] [limit obiektów]");
  1694.                
  1695.                 mysql_query(mySQLconnection, sprintf("UPDATE `ipb_doors` SET `door_objects` = %d WHERE `door_uid` = %d", limit, Door[d_id][door_uid]));
  1696.                        
  1697.                 Door[d_id][door_objects_limit] = limit;
  1698.                
  1699.                 SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Pomyślnie Zmieniłeś limit obiektów drzwi [LIMIT: %d, UID: %d, ID: %d].", limit, Door[d_id][door_uid], d_id));      
  1700.         }
  1701.         else if( !strcmp(sub_cmd, "przeladuj") )
  1702.         {
  1703.                 Code_ExTimer_Begin(DoorsReload);
  1704.                 for(new d_id;d_id<MAX_DOORS;d_id++)
  1705.                 {
  1706.                         if( Iter_Contains(Doors, d_id) ) DeleteDoor(d_id, false);
  1707.                 }
  1708.                
  1709.                 new count = LoadDoor();
  1710.  
  1711.                 SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Pomyślnie przeładowałeś wszystkie drzwi [ilość: %d, Czas: %d ms].", count, Code_ExTimer_End(DoorsReload)));      
  1712.         }
  1713.         else if( !strcmp(sub_cmd, "exitvw") )
  1714.         {
  1715.                 new d_id, vw;
  1716.                 if( sscanf(param, "dd", d_id, vw) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ad)rzwi exitvw [id drzwi] [vw]");   
  1717.                 if( !Iter_Contains(Doors, d_id) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ad)rzwi exitvw [id drzwi] [vw]");
  1718.                 if( vw < 0 ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ad)rzwi exitvw [id drzwi] [vw]");
  1719.                
  1720.                 mysql_query(mySQLconnection, sprintf("UPDATE `ipb_doors` SET `door_exitvw` = %d WHERE `door_uid` = %d", vw, Door[d_id][door_uid]));
  1721.                
  1722.                 new uid = Door[d_id][door_uid];
  1723.                 DeleteDoor(d_id, false);
  1724.                
  1725.                 new did = LoadDoor(sprintf("WHERE `door_uid` = %d", uid), true);
  1726.                
  1727.                 SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Pomyślnie Zmieniłeś wewnetrzny virtual world drzwi [EXITVW: %d, UID: %d, ID: %d]", vw, Door[did][door_uid], did));
  1728.         }
  1729.         else return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ad)rzwi [stworz/usun/pickup/mapicon/goto/przypisz/interior/wejscie/exitvw/objects/przeladuj]");
  1730.         return 1;
  1731. }
  1732.  
  1733. COMMAND:strefa(playerid, params[])
  1734. {      
  1735.         new sub_cmd[40], param[150];
  1736.         if( sscanf(params, "s[40] S()[150]", sub_cmd, param) )
  1737.         {
  1738.                 if( !HasCrewFlag(playerid, CREW_FLAG_AREAS) )
  1739.                 {
  1740.                         SendClientMessage(playerid, COLOR_GREY, "Tip: /strefa [audio]");
  1741.                 }
  1742.                 else
  1743.                 {
  1744.                         SendClientMessage(playerid, COLOR_GREY, "Tip: /strefa [stworz/usun/przypisz/podglad/obiekty/flagi/goto]");
  1745.                 }
  1746.                 return 1;
  1747.         }
  1748.        
  1749.         if( !strcmp(sub_cmd, "stworz") )
  1750.         {
  1751.                 if( !HasCrewFlag(playerid, CREW_FLAG_AREAS) ) return SendGuiInformation(playerid, "Informacja", "Brak uprawnień do użycia tej komendy.");
  1752.                 if( pInfo[playerid][player_lookup_area] ) return SendClientMessage(playerid, COLOR_GREY, "Aktualnie podglądasz jakąś strefę, musisz najpierw wylączyć te opcje.");
  1753.                 if( pInfo[playerid][player_creating_area] )
  1754.                 {
  1755.                         if( pInfo[playerid][player_carea_type] == AREA_SHAPE_SQUARE )
  1756.                         {
  1757.                                 if( pInfo[playerid][player_carea_point2][0] == 0.0 && pInfo[playerid][player_carea_point2][1] == 0.0 && pInfo[playerid][player_carea_point2][2] == 0.0 ) return ShowPlayerDialog(playerid, DIALOG_INFO, DIALOG_STYLE_MSGBOX, "Informacja", "Aby stworzyć prostokątną strefę musisz wyznaczyć jej dwa punkty tworzące przekątną.", "OK", "");   
  1758.                        
  1759.                                 new str[400];
  1760.                                 strcat(str, "INSERT INTO `ipb_areas` (area_uid, area_shape, area_type, area_ownertype, area_owner, area_objects, area_vw, area_size, area_point1, area_point2) ");
  1761.                                 strcat(str, sprintf("VALUES(null, %d, %d, %d, 0, 0, %d, 0.0, '%f|%f|%f', '%f|%f|%f')", AREA_SHAPE_SQUARE, AREA_TYPE_NORMAL, AREA_OWNER_TYPE_GLOBAL, GetPlayerVirtualWorld(playerid), pInfo[playerid][player_carea_point1][0], pInfo[playerid][player_carea_point1][1], pInfo[playerid][player_carea_point1][2], pInfo[playerid][player_carea_point2][0], pInfo[playerid][player_carea_point2][1], pInfo[playerid][player_carea_point2][2]));
  1762.                                 mysql_query(mySQLconnection, str);
  1763.                                
  1764.                                 new uid = cache_insert_id();
  1765.                                 new a_id = LoadArea(sprintf("WHERE `area_uid` = %d", uid), true);
  1766.                                
  1767.                                 pInfo[playerid][player_carea_point1][0] = 0.0;
  1768.                                 pInfo[playerid][player_carea_point1][1] = 0.0;
  1769.                                 pInfo[playerid][player_carea_point1][2] = 0.0;
  1770.                                
  1771.                                 pInfo[playerid][player_carea_point2][0] = 0.0;
  1772.                                 pInfo[playerid][player_carea_point2][1] = 0.0;
  1773.                                 pInfo[playerid][player_carea_point2][2] = 0.0;
  1774.                                
  1775.                                 if( IsValidDynamic3DTextLabel(pInfo[playerid][player_carea_label][0]) ) DestroyDynamic3DTextLabel(pInfo[playerid][player_carea_label][0]);
  1776.                                 if( IsValidDynamic3DTextLabel(pInfo[playerid][player_carea_label][1]) ) DestroyDynamic3DTextLabel(pInfo[playerid][player_carea_label][1]);
  1777.                                
  1778.                                 GangZoneDestroy(pInfo[playerid][player_carea_zone]);
  1779.                                
  1780.                                 pInfo[playerid][player_creating_area] = false;
  1781.                                 SendPlayerInformation(playerid, "", 0);
  1782.                                
  1783.                                 ShowPlayerDialog(playerid, DIALOG_INFO, DIALOG_STYLE_MSGBOX, "Informacja", sprintf("Pomyślnie stworzyłeś prostokątną strefę [UID: %d, ID: %d].", uid, a_id), "OK", "");
  1784.                         }
  1785.                         else if( pInfo[playerid][player_carea_type] == AREA_SHAPE_CIRCLE )
  1786.                         {
  1787.                                 if( pInfo[playerid][player_carea_point1][0] == 0.0 && pInfo[playerid][player_carea_point1][1] == 0.0 && pInfo[playerid][player_carea_point1][2] == 0.0 ) return ShowPlayerDialog(playerid, DIALOG_INFO, DIALOG_STYLE_MSGBOX, "Informacja", "Aby stworzyæ sferycznÂą strefę musisz wyznaczyæ punkt srodka sfery.", "OK", "");  
  1788.                        
  1789.                                 new str[400];
  1790.                                 strcat(str, "INSERT INTO `ipb_areas` (area_uid, area_shape, area_type, area_ownertype, area_owner, area_objects, area_vw, area_size, area_point1, area_point2) ");
  1791.                                 strcat(str, sprintf("VALUES(null, %d, %d, %d, 0, 0, %d, %f, '%f|%f|%f', '')", AREA_SHAPE_CIRCLE, AREA_TYPE_NORMAL, AREA_OWNER_TYPE_GLOBAL, GetPlayerVirtualWorld(playerid), pInfo[playerid][player_carea_size], pInfo[playerid][player_carea_point1][0], pInfo[playerid][player_carea_point1][1], pInfo[playerid][player_carea_point1][2]));
  1792.                                 mysql_query(mySQLconnection, str);
  1793.                        
  1794.                                 new uid = cache_insert_id();
  1795.                                 new a_id = LoadArea(sprintf("WHERE `area_uid` = %d", uid), true);
  1796.                                
  1797.                                 pInfo[playerid][player_carea_point1][0] = 0.0;
  1798.                                 pInfo[playerid][player_carea_point1][1] = 0.0;
  1799.                                 pInfo[playerid][player_carea_point1][2] = 0.0;
  1800.                                
  1801.                                 pInfo[playerid][player_carea_point2][0] = 0.0;
  1802.                                 pInfo[playerid][player_carea_point2][1] = 0.0;
  1803.                                 pInfo[playerid][player_carea_point2][2] = 0.0;
  1804.                                
  1805.                                 if( IsValidDynamic3DTextLabel(pInfo[playerid][player_carea_label][0]) ) DestroyDynamic3DTextLabel(pInfo[playerid][player_carea_label][0]);
  1806.                                 if( IsValidDynamic3DTextLabel(pInfo[playerid][player_carea_label][1]) ) DestroyDynamic3DTextLabel(pInfo[playerid][player_carea_label][1]);
  1807.                                
  1808.                                 GangZoneDestroy(pInfo[playerid][player_carea_zone]);
  1809.                                
  1810.                                 pInfo[playerid][player_creating_area] = false;
  1811.                                 SendPlayerInformation(playerid, "", 0);
  1812.                                
  1813.                                 ShowPlayerDialog(playerid, DIALOG_INFO, DIALOG_STYLE_MSGBOX, "Informacja", sprintf("Pomyślnie stworzyłeś sferyczna strefę [UID: %d, ID: %d].", uid, a_id), "OK", "");
  1814.                         }
  1815.                        
  1816.                        
  1817.                         return 1;
  1818.                 }
  1819.                
  1820.                 new type[32], Float:size;
  1821.                 if( sscanf(param, "s[32]F(0.0)", type, size) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /strefa stworz [sfera/prostokat]");
  1822.                
  1823.                 if( !strcmp(type, "sfera") )
  1824.                 {
  1825.                         if( size == 0.0 ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /strefa stworz sfera [wielkosc]");
  1826.                        
  1827.                         pInfo[playerid][player_carea_size] = size;
  1828.                         pInfo[playerid][player_carea_type] = AREA_SHAPE_CIRCLE;
  1829.                         pInfo[playerid][player_creating_area] = true;
  1830.                         SendPlayerInformation(playerid, "Aby dodac punkt strefy wcisnij ~r~RMB~w~ lub ~r~LMB ~w~aby usunac ostatnio dodany punkt. ~n~Aby anulowac tworzenie strefy wcisnij ~g~LALT + SPACE~w~.~n~~n~~y~Aby stworzyc strefę uzyj ponownie /strefa stworz.", 30000);
  1831.                 }
  1832.                 else if( !strcmp(type, "prostokat") )
  1833.                 {
  1834.                         pInfo[playerid][player_carea_type] = AREA_SHAPE_SQUARE;
  1835.                         pInfo[playerid][player_creating_area] = true;
  1836.                         SendPlayerInformation(playerid, "Aby dodac punkt strefy wcisnij ~r~RMB~w~ lub ~r~LMB ~w~aby usunac ostatnio dodany punkt. ~n~Aby anulowac tworzenie strefy wcisnij ~g~LALT + SPACE~w~.~n~~n~~y~Aby stworzyc strefę uzyj /strefa stworz.", 30000);
  1837.                 }
  1838.                 else return SendClientMessage(playerid, COLOR_GREY, "Tip: /strefa stworz [sfera/prostokat]");
  1839.         }
  1840.         else if( !strcmp(sub_cmd, "audio") )
  1841.         {
  1842.                 new audio_stream[100], a_id;
  1843.                 if( sscanf(param, "s[100]d", audio_stream, a_id) )
  1844.                 {
  1845.                         SendClientMessage(playerid, COLOR_GREY, "Tip: /strefa audio [id strefy] [link]");
  1846.                         SendClientMessage(playerid, COLOR_GREY, "Tip: Wpisz znak pauzy aby usunąć stream audio ze strefy.");
  1847.                         return 1;
  1848.                 }
  1849.                 if(!CanPlayerEditArea(playerid, a_id)) return SendGuiInformation(playerid, "Informacja", "Brak uprawnień do zarządzania tą strefą.");
  1850.                 sscanf(audio_stream, "s[100]", Area[a_id][area_audio]);
  1851.                 SendGuiInformation(playerid, "Informacja", "Strumień audio został pomyślnie ustawiony.");
  1852.         }
  1853.         else if( !strcmp(sub_cmd, "usun") )
  1854.         {
  1855.                 if( !HasCrewFlag(playerid, CREW_FLAG_AREAS) ) return SendGuiInformation(playerid, "Informacja", "Brak uprawnień do użycia tej komendy.");
  1856.                 new a_id;
  1857.                 if( sscanf(param, "d", a_id) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /strefa usun [id strefy]");
  1858.                 if( !Iter_Contains(Areas, a_id) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /strefa usun [id strefy]");
  1859.                 if( Area[a_id][area_type] != AREA_TYPE_NORMAL ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /strefa usun [id strefy]");
  1860.                
  1861.                 foreach(new p : Player)
  1862.                 {
  1863.                         if( IsPlayerInDynamicArea(playerid, a_id) )
  1864.                         {
  1865.                                 TextDrawHideForPlayer(playerid, AreaInfo[playerid]);
  1866.                         }
  1867.                 }
  1868.                
  1869.                 ShowPlayerDialog(playerid, DIALOG_INFO, DIALOG_STYLE_MSGBOX, "Informacja", sprintf("Pomyślnie usunąłeś strefę [UID: %d, ID: %d].", Area[a_id][area_uid], a_id), "OK", "");
  1870.                
  1871.                 DeleteArea(a_id);
  1872.         }
  1873.         else if( !strcmp(sub_cmd, "przypisz") )
  1874.         {
  1875.                 if( !HasCrewFlag(playerid, CREW_FLAG_AREAS) ) return SendGuiInformation(playerid, "Informacja", "Brak uprawnień do użycia tej komendy.");
  1876.                 new a_id, action[32], who;
  1877.                 if( sscanf(param, "ds[32]d", a_id, action, who) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /strefa przypisz [id strefy] [grupa/postac/globalna] [uid grupy/id gracza(nie uid)]");
  1878.                 if( !Iter_Contains(Areas, a_id) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /strefa przypisz [id strefy] [grupa/postac/globalna] [uid grupy/id gracza(nie uid)]");
  1879.                 if( Area[a_id][area_type] != AREA_TYPE_NORMAL ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /strefa przypisz [id strefy] [grupa/postac/globalna] [uid grupy/id gracza(nie uid)]");
  1880.                
  1881.                 if( !strcmp(action, "grupa") )
  1882.                 {
  1883.                         new gid = GetGroupByUid(who);
  1884.                         if( gid == -1 ) return SendClientMessage(playerid, COLOR_GREY, "Grupa o podanym uid nie istnieje.");
  1885.                        
  1886.                         mysql_query(mySQLconnection, sprintf("UPDATE `ipb_areas` SET `area_ownertype` = %d, `area_owner` = %d WHERE `area_uid` = %d", AREA_OWNER_TYPE_GROUP, who, Area[a_id][area_uid]));
  1887.                        
  1888.                         Area[a_id][area_owner_type] = AREA_OWNER_TYPE_GROUP;
  1889.                         Area[a_id][area_owner] = who;
  1890.                        
  1891.                         ShowPlayerDialog(playerid, DIALOG_INFO, DIALOG_STYLE_MSGBOX, "Informacja", sprintf("Pomyślnie zmieniłeś wlasciciela strefy [UID: %d, ID: %d] na grupe %s [UID: %d, ID: %d].", Area[a_id][area_uid], a_id, Group[gid][group_name], Group[gid][group_uid], gid), "OK", "");
  1892.                 }
  1893.                 else if( !strcmp(action, "postac") )
  1894.                 {
  1895.                         if( !IsPlayerConnected(who) ) return SendClientMessage(playerid, COLOR_GREY, "Gracz o podanym id nie jest podłączony.");
  1896.                        
  1897.                         mysql_query(mySQLconnection, sprintf("UPDATE `ipb_areas` SET `area_ownertype` = %d, `area_owner` = %d WHERE `area_uid` = %d", AREA_OWNER_TYPE_PLAYER, pInfo[who][player_id], Area[a_id][area_uid]));
  1898.                        
  1899.                         Area[a_id][area_owner_type] = AREA_OWNER_TYPE_PLAYER;
  1900.                         Area[a_id][area_owner] = pInfo[who][player_id];
  1901.                        
  1902.                         ShowPlayerDialog(playerid, DIALOG_INFO, DIALOG_STYLE_MSGBOX, "Informacja", sprintf("Pomyślnie zmieniłeś wlasciciela strefy [UID: %d, ID: %d] na gracza %s [UID: %d, ID: %d].", Area[a_id][area_uid], a_id, pInfo[who][player_name], pInfo[who][player_id], who), "OK", "");
  1903.                 }
  1904.                 else if( !strcmp(action, "globalne") )
  1905.                 {
  1906.                         mysql_query(mySQLconnection, sprintf("UPDATE `ipb_areas` SET `area_ownertype` = %d, `area_owner` = 0 WHERE `area_uid` = %d", AREA_OWNER_TYPE_GLOBAL, Area[a_id][area_uid]));
  1907.                        
  1908.                         Area[a_id][area_owner_type] = AREA_OWNER_TYPE_GLOBAL;
  1909.                         Area[a_id][area_owner] = 0;
  1910.                        
  1911.                         ShowPlayerDialog(playerid, DIALOG_INFO, DIALOG_STYLE_MSGBOX, "Informacja", sprintf("Pomyślnie zmieniłeś wlasciciela strefy [UID: %d, ID: %d] na globalnego.", Area[a_id][area_uid], a_id), "OK", "");
  1912.                 }
  1913.                 else return SendClientMessage(playerid, COLOR_GREY, "Tip: /strefa przypisz [id drzwi] [grupa/postac] [uid grupy/id gracza(nie uid)]"); 
  1914.         }
  1915.         else if( !strcmp(sub_cmd, "goto") )
  1916.         {
  1917.                 if( !HasCrewFlag(playerid, CREW_FLAG_AREAS) ) return SendGuiInformation(playerid, "Informacja", "Brak uprawnień do użycia tej komendy.");
  1918.                 new a_id;
  1919.                 if( sscanf(param, "d", a_id) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /strefa goto [id strefy]");
  1920.                 if( !Iter_Contains(Areas, a_id) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /strefa goto [id strefy]");
  1921.                 if( Area[a_id][area_type] != AREA_TYPE_NORMAL ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /strefa goto [id strefy]");
  1922.                 SetPlayerPos(playerid, Area[a_id][area_pos][0], Area[a_id][area_pos][1], Area[a_id][area_pos][2]);
  1923.         }
  1924.         else if( !strcmp(sub_cmd, "obiekty") )
  1925.         {
  1926.                 if( !HasCrewFlag(playerid, CREW_FLAG_AREAS) ) return SendGuiInformation(playerid, "Informacja", "Brak uprawnień do użycia tej komendy.");
  1927.                 new a_id, limit;
  1928.                 if( sscanf(param, "dd", a_id, limit) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /strefa obiekty [id strefy] [limit obiektów]");   
  1929.                 if( !Iter_Contains(Areas, a_id) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /strefa obiekty [id strefy] [limit obiektów]");
  1930.                 if( limit < 0 ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /strefa obiekty [id strefy] [limit obiektów]");  
  1931.                 if( Area[a_id][area_type] != AREA_TYPE_NORMAL ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /strefa obiekty [id strefy] [limit obiektów]");  
  1932.                
  1933.                 mysql_query(mySQLconnection, sprintf("UPDATE `ipb_areas` SET `area_objects` = %d WHERE `area_uid` = %d", limit, Area[a_id][area_uid]));
  1934.                        
  1935.                 Area[a_id][area_objects_limit] = limit;
  1936.                
  1937.                 ShowPlayerDialog(playerid, DIALOG_INFO, DIALOG_STYLE_MSGBOX, "Informacja", sprintf("Pomyślnie zmieniłeś limit obiektów strefy [LIMIT: %d, UID: %d, ID: %d].", limit, Area[a_id][area_uid], a_id), "OK", "");       
  1938.         }
  1939.         else if( !strcmp(sub_cmd, "flagi") )
  1940.         {
  1941.                 if( !HasCrewFlag(playerid, CREW_FLAG_AREAS) ) return SendGuiInformation(playerid, "Informacja", "Brak uprawnień do użycia tej komendy.");
  1942.                 new a_id;
  1943.                 if( sscanf(param, "d", a_id) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /strefa flagi [id strefy]");
  1944.                
  1945.                 if( !Iter_Contains(Areas, a_id) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /strefa flagi [id strefy]");
  1946.                
  1947.                 DynamicGui_Init(playerid);
  1948.                 DynamicGui_SetDialogValue(playerid, a_id);
  1949.                 new str[700];
  1950.                
  1951.                 format(str, sizeof(str), "%s%s01tZbyt narkotykown", str, ((AreaHasFlag(a_id, AREA_FLAG_CORNER)) ? (HEX_COLOR_LIGHTER_GREEN) : (HEX_COLOR_LIGHTER_RED)));
  1952.                 DynamicGui_AddRow(playerid, AREA_FLAG_CORNER);
  1953.                
  1954.                 format(str, sizeof(str), "%s%s02tBMXn", str, ((AreaHasFlag(a_id, AREA_FLAG_BMX)) ? (HEX_COLOR_LIGHTER_GREEN) : (HEX_COLOR_LIGHTER_RED)));
  1955.                 DynamicGui_AddRow(playerid, AREA_FLAG_BMX);
  1956.                
  1957.                 format(str, sizeof(str), "%s%s03tMonitoringn", str, ((AreaHasFlag(a_id, AREA_FLAG_MONITORING)) ? (HEX_COLOR_LIGHTER_GREEN) : (HEX_COLOR_LIGHTER_RED)));
  1958.                 DynamicGui_AddRow(playerid, AREA_FLAG_MONITORING);
  1959.  
  1960.                 format(str, sizeof(str), "%s%s04tDrive-thrun", str, ((AreaHasFlag(a_id, AREA_FLAG_DRIVE)) ? (HEX_COLOR_LIGHTER_GREEN) : (HEX_COLOR_LIGHTER_RED)));
  1961.                 DynamicGui_AddRow(playerid, AREA_FLAG_DRIVE);
  1962.  
  1963.                 format(str, sizeof(str), "%s%s05tSadzenie roślinn", str, ((AreaHasFlag(a_id, AREA_FLAG_PLANT)) ? (HEX_COLOR_LIGHTER_GREEN) : (HEX_COLOR_LIGHTER_RED)));
  1964.                 DynamicGui_AddRow(playerid, AREA_FLAG_PLANT);
  1965.  
  1966.                 format(str, sizeof(str), "%s%s06tOgraniczenie parkowanian", str, ((AreaHasFlag(a_id, AREA_FLAG_PARKING)) ? (HEX_COLOR_LIGHTER_GREEN) : (HEX_COLOR_LIGHTER_RED)));
  1967.                 DynamicGui_AddRow(playerid, AREA_FLAG_PARKING);
  1968.  
  1969.                 format(str, sizeof(str), "%s%s07tOferowanie produktówn", str, ((AreaHasFlag(a_id, AREA_FLAG_OFFER)) ? (HEX_COLOR_LIGHTER_GREEN) : (HEX_COLOR_LIGHTER_RED)));
  1970.                 DynamicGui_AddRow(playerid, AREA_FLAG_OFFER);
  1971.  
  1972.                 format(str, sizeof(str), "%s%s08tSerwis pojazdówn", str, ((AreaHasFlag(a_id, AREA_FLAG_SERWIS)) ? (HEX_COLOR_LIGHTER_GREEN) : (HEX_COLOR_LIGHTER_RED)));
  1973.                 DynamicGui_AddRow(playerid, AREA_FLAG_SERWIS);
  1974.  
  1975.                 format(str, sizeof(str), "%s%s09tPraca drwalan", str, ((AreaHasFlag(a_id, AREA_FLAG_WORK)) ? (HEX_COLOR_LIGHTER_GREEN) : (HEX_COLOR_LIGHTER_RED)));
  1976.                 DynamicGui_AddRow(playerid, AREA_FLAG_WORK);
  1977.  
  1978.                 format(str, sizeof(str), "%s%s10tPraca rybakan", str, ((AreaHasFlag(a_id, AREA_FLAG_WORK_FISH)) ? (HEX_COLOR_LIGHTER_GREEN) : (HEX_COLOR_LIGHTER_RED)));
  1979.                 DynamicGui_AddRow(playerid, AREA_FLAG_WORK_FISH);
  1980.  
  1981.                 format(str, sizeof(str), "%s%s11tAnty Jobcarn", str, ((AreaHasFlag(a_id, AREA_FLAG_LS)) ? (HEX_COLOR_LIGHTER_GREEN) : (HEX_COLOR_LIGHTER_RED)));
  1982.                 DynamicGui_AddRow(playerid, AREA_FLAG_LS);
  1983.  
  1984.                 format(str, sizeof(str), "%s%s12tGra w golfan", str, ((AreaHasFlag(a_id, AREA_FLAG_GOLF)) ? (HEX_COLOR_LIGHTER_GREEN) : (HEX_COLOR_LIGHTER_RED)));
  1985.                 DynamicGui_AddRow(playerid, AREA_FLAG_GOLF);
  1986.  
  1987.                 format(str, sizeof(str), "%s%s13tZłomowanie pojazdun", str, ((AreaHasFlag(a_id, AREA_FLAG_ZLOM)) ? (HEX_COLOR_LIGHTER_GREEN) : (HEX_COLOR_LIGHTER_RED)));
  1988.                 DynamicGui_AddRow(playerid, AREA_FLAG_ZLOM);
  1989.                
  1990.                 ShowPlayerDialog(playerid, DIALOG_AREA_FLAGS, DIALOG_STYLE_LIST, sprintf("Flagi strefy [UID: %d, ID: %d]", Area[a_id][area_uid], a_id), str, "Wybierz", "Zamknij");
  1991.         }
  1992.         else if( !strcmp(sub_cmd, "wyczysc") )
  1993.         {
  1994.                 if( !HasCrewFlag(playerid, CREW_FLAG_AREAS) ) return SendGuiInformation(playerid, "Informacja", "Brak uprawnień do użycia tej komendy.");
  1995.                 new a_id, object_count;
  1996.                 if( sscanf(param, "d", a_id) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /strefa wyczysc [id strefy]");     
  1997.                 if( !Iter_Contains(Areas, a_id) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /strefa wyczysc [id strefy]");
  1998.                 if( Area[a_id][area_type] != AREA_TYPE_NORMAL ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /strefa wyczysc [id strefy]");
  1999.                
  2000.                 foreach(new o_id : Objects)
  2001.                 {
  2002.                         if( Object[o_id][object_owner_type] != OBJECT_OWNER_TYPE_AREA ) continue;
  2003.                         if( Object[o_id][object_owner] == Area[a_id][area_uid] )
  2004.                         {
  2005.                                 mysql_query(mySQLconnection, sprintf("DELETE FROM `ipb_objects` WHERE `object_uid` = %d", Object[o_id][object_uid]));
  2006.  
  2007.                                 DestroyDynamicObject(o_id);
  2008.  
  2009.                                 for(new z=0; e_objects:z != e_objects; z++)
  2010.                                 {
  2011.                                         Object[o_id][e_objects:z] = 0;
  2012.                             }
  2013.                             object_count++;
  2014.                            
  2015.                             new next;
  2016.                             Iter_SafeRemove(Objects, o_id, next);
  2017.                             o_id = next;
  2018.                         }
  2019.                 }
  2020.                 ShowPlayerDialog(playerid, DIALOG_INFO, DIALOG_STYLE_MSGBOX, "Informacja", sprintf("Pomyślnie wyczyściłeś strefę z %d obiektów. [UID: %d, ID: %d].", object_count, Area[a_id][area_uid], a_id), "OK", "");
  2021.         }
  2022.         else if( !strcmp(sub_cmd, "podglad") )
  2023.         {
  2024.                 if( !HasCrewFlag(playerid, CREW_FLAG_AREAS) ) return SendGuiInformation(playerid, "Informacja", "Brak uprawnień do użycia tej komendy.");
  2025.                 if( pInfo[playerid][player_lookup_area] )
  2026.                 {
  2027.                         pInfo[playerid][player_lookup_area] = false;
  2028.                         GangZoneDestroy(pInfo[playerid][player_carea_zone]);
  2029.                        
  2030.                         if( IsValidDynamic3DTextLabel(pInfo[playerid][player_carea_label][0]) ) DestroyDynamic3DTextLabel(pInfo[playerid][player_carea_label][0]);
  2031.                         if( IsValidDynamic3DTextLabel(pInfo[playerid][player_carea_label][1]) ) DestroyDynamic3DTextLabel(pInfo[playerid][player_carea_label][1]);
  2032.                        
  2033.                         TextDrawHideForPlayer(playerid, Dashboard[playerid]);
  2034.                 }
  2035.                 else
  2036.                 {
  2037.                         new a_id;
  2038.                         if( sscanf(param, "d", a_id) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /strefa podglad [id strefy]");     
  2039.                         if( !Iter_Contains(Areas, a_id) ) return SendClientMessage(playerid, COLOR_GREY, "Strefa o podanym id nie istnieje.");
  2040.                         if( pInfo[playerid][player_creating_area] ) return SendClientMessage(playerid, COLOR_GREY, "Nie możesz korzystać z podglądu strefy w trybie tworzenia strefy.");
  2041.                         if( Area[a_id][area_type] != AREA_TYPE_NORMAL ) return SendClientMessage(playerid, COLOR_GREY, "Nie możesz edytować strefy tego typu.");
  2042.                        
  2043.                         pInfo[playerid][player_lookup_area] = true;
  2044.                         new string[140];
  2045.                
  2046.                         new owner_str[80];
  2047.                         switch( Area[a_id][area_owner_type] )
  2048.                         {
  2049.                                 case AREA_OWNER_TYPE_GLOBAL:
  2050.                                 {
  2051.                                         format(owner_str, sizeof(owner_str), "globalne; brak");
  2052.                                 }
  2053.                                
  2054.                                 case AREA_OWNER_TYPE_PLAYER:
  2055.                                 {                      
  2056.                                         new name[MAX_PLAYER_NAME+1];
  2057.                                         GetPlayerNameByUid(Area[a_id][area_owner], name);
  2058.                                        
  2059.                                         format(owner_str, sizeof(owner_str), "prywatne; %s", name);
  2060.                                 }
  2061.                                
  2062.                                 case AREA_OWNER_TYPE_GROUP:
  2063.                                 {                      
  2064.                                         new gid = GetGroupByUid(Area[a_id][area_owner]);
  2065.                                         format(owner_str, sizeof(owner_str), "grupowe; %s", Group[gid][group_name]);
  2066.                                 }
  2067.                         }
  2068.                        
  2069.                         format(string, sizeof(string), "%d. Strefa (SampID: %d)~n~~n~~p~Owner: ~w~%d:%d (%s)    ~w~Obiektow: %d/%d", Area[a_id][area_uid], a_id, Area[a_id][area_owner_type], Area[a_id][area_owner], owner_str, CountAreaObjects(a_id), Area[a_id][area_objects_limit]);
  2070.                                
  2071.                         TextDrawSetString(Dashboard[playerid], string);
  2072.                         TextDrawShowForPlayer(playerid, Dashboard[playerid]);
  2073.                        
  2074.                         new rows, fields;
  2075.                         new Float:point1[3], Float:point2[3], shape;
  2076.                         mysql_query(mySQLconnection, sprintf("SELECT area_shape, area_point1, area_point2 FROM `ipb_areas` WHERE `area_uid` = %d", Area[a_id][area_uid]));
  2077.                         cache_get_data(rows, fields);
  2078.                        
  2079.                         new str[100];
  2080.                         cache_get_row(0, 1, str);
  2081.                         sscanf(str, "p<|>a<f>[3]", point1);
  2082.                        
  2083.                         new str2[100];
  2084.                         cache_get_row(0, 2, str2);
  2085.                         sscanf(str2, "p<|>a<f>[3]", point2);
  2086.                        
  2087.                         shape = cache_get_row_int(0, 0);
  2088.                        
  2089.                         if( shape == AREA_SHAPE_SQUARE  )
  2090.                         {
  2091.                                 pInfo[playerid][player_carea_zone] = GangZoneCreate(Min(point1[0], point2[0]), Min(point1[1], point2[1]), Max(point1[0], point2[0]), Max(point1[1], point2[1]));
  2092.                                 GangZoneShowForPlayer(playerid, pInfo[playerid][player_carea_zone], 0xFF3C3C80);
  2093.  
  2094.                                 pInfo[playerid][player_carea_label][0] = CreateDynamic3DTextLabel(sprintf("Punkt pierwszyn(%f, %f, %f)", point1[0], point1[1], point1[2]), COLOR_LIGHTER_RED, point1[0], point1[1], point1[2], 50.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, playerid);
  2095.                                 pInfo[playerid][player_carea_label][1] = CreateDynamic3DTextLabel(sprintf("Punkt drugin(%f, %f, %f)", point2[0], point2[1], point2[2]), COLOR_LIGHTER_RED, point2[0], point2[1], point2[2], 50.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, playerid);
  2096.                         }
  2097.                         else if( shape == AREA_SHAPE_CIRCLE )
  2098.                         {
  2099.                                 pInfo[playerid][player_carea_label][0] = CreateDynamic3DTextLabel(sprintf("Punkt pierwszyn(%f, %f, %f)", point1[0], point1[1], point1[2]), COLOR_LIGHTER_RED, point1[0], point1[1], point1[2], 50.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, playerid);
  2100.                         }
  2101.                 }
  2102.         }
  2103.         else return SendClientMessage(playerid, COLOR_GREY, "Tip: /strefa [stworz/usun/przypisz/podglad/obiekty/flagi]");
  2104.         return 1;
  2105. }
  2106.  
  2107. COMMAND:bw(playerid, params[])
  2108. {
  2109.         if( !HasCrewFlag(playerid, CREW_FLAG_GM) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie masz uprawnień do korzystania z tej komendy.");
  2110.        
  2111.         new time, targetid;
  2112.         if( sscanf(params, "ud", targetid, time) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /bw [id gracza/czesc nicku] [czas]");
  2113.         if( time < 0 ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /bw [id gracza] [czas]");
  2114.         if( !IsPlayerConnected(targetid) ) return SendClientMessage(playerid, COLOR_GREY, "Gracz o podanym id nie jest podłączony.");
  2115.         if( !pInfo[targetid][player_logged] ) return SendClientMessage(playerid, COLOR_GREY, "Gracz o podanym id nie jest zalogowany.");
  2116.                
  2117.         if( time == 0 && pInfo[targetid][player_bw] > 0 )
  2118.         {
  2119.                 ShowPlayerDialog(playerid, DIALOG_INFO, DIALOG_STYLE_MSGBOX, "Informacja", sprintf("Nadałeś graczowi %s [UID: %d, ID: %d] bw na czas: %d minut.", pInfo[targetid][player_name], pInfo[targetid][player_id], targetid, time), "OK", "");
  2120.                 // koniec bw
  2121.                 pInfo[targetid][player_bw] = 0;
  2122.                 pInfo[targetid][player_bw_end_time] = 0;
  2123.                 mysql_query(mySQLconnection, sprintf("UPDATE `ipb_characters` SET `char_bw` = 0 WHERE `char_uid` = %d", pInfo[targetid][player_id]));
  2124.                
  2125.                 RemovePlayerStatus(targetid, PLAYER_STATUS_BW);
  2126.                 SetPlayerHealth(targetid, 20);
  2127.                 TogglePlayerControllable(targetid, 1);
  2128.                 SetCameraBehindPlayer(targetid);
  2129.                 ClearAnimations(targetid);
  2130.                 new skin = GetPlayerSkin(playerid);
  2131.                 SetPlayerSkin(playerid, skin);
  2132.                 SetPlayerSpecialAction(targetid, SPECIAL_ACTION_NONE);
  2133.                 SetPlayerChatBubble(playerid, "", -1, 7.0, 5);
  2134.                 return 1;
  2135.         }
  2136.         else if( time == 0 )
  2137.         {
  2138.                 return SendClientMessage(playerid, COLOR_GREY, "Gracz o podanym id nie ma bw, więc nie możesz mu go zdjąć.");
  2139.         }
  2140.  
  2141.         ShowPlayerDialog(playerid, DIALOG_INFO, DIALOG_STYLE_MSGBOX, "Informacja", sprintf("Nadałeś graczowi %s [UID: %d, ID: %d] bw na czas: %d minut.", pInfo[targetid][player_name], pInfo[targetid][player_id], targetid, time), "OK", "");
  2142.  
  2143.         new
  2144.                 Float:x,
  2145.                 Float:y,
  2146.                 Float:z,
  2147.                 Float:a;
  2148.         GetPlayerPos(targetid, x, y, z);
  2149.         GetPlayerFacingAngle(targetid, a);
  2150.  
  2151.  
  2152.         pInfo[targetid][player_bw] = 60 * time;
  2153.         pInfo[targetid][player_bw_end_time] = pInfo[targetid][player_bw] + gettime();
  2154.                
  2155.        
  2156.         RP_PLUS_SetPlayerPos(targetid, x, y, z);
  2157.         SetPlayerFacingAngle(targetid, a);
  2158.  
  2159.         mysql_query(mySQLconnection, sprintf("UPDATE `ipb_characters` SET `char_bw`=%d, `char_posx`='%f', `char_posy`='%f', `char_posz`='%f', `char_posa`='%f', `char_world`=%d, `char_interior`=%d WHERE `char_uid`=%d", pInfo[targetid][player_bw], x, y, z, a, GetPlayerVirtualWorld(targetid), GetPlayerInterior(targetid), pInfo[targetid][player_id]));
  2160.        
  2161.         pInfo[targetid][player_quit_pos][0] = x;
  2162.         pInfo[targetid][player_quit_pos][1] = y;
  2163.         pInfo[targetid][player_quit_pos][2] = z;
  2164.         pInfo[targetid][player_quit_pos][3] = a;
  2165.         pInfo[targetid][player_quit_vw] = GetPlayerVirtualWorld(targetid);
  2166.         pInfo[targetid][player_quit_int] = GetPlayerInterior(targetid);
  2167.  
  2168.         defer ApplyAnim[2000](targetid, ANIM_TYPE_BW);
  2169.        
  2170.         scrp_SpawnPlayer(targetid);
  2171.         return 1;
  2172. }
  2173.  
  2174. COMMAND:setvw(playerid, params[])
  2175. {
  2176.         if( !HasCrewFlag(playerid, CREW_FLAG_GM) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie masz uprawnień do korzystania z tej komendy.");
  2177.        
  2178.         new targetid, vw;
  2179.         if( sscanf(params, "ud", targetid, vw) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /setvw [id gracza/czesc nicku] [vw]");
  2180.         if( vw < 0 ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /setvw [id gracza/czesc nicku] [vw]");
  2181.         if( !IsPlayerConnected(targetid) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Gracz o podanym id nie jest podłączony.");
  2182.         if( !pInfo[targetid][player_logged] ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Gracz o podanym id nie jest zalogowany.");
  2183.        
  2184.         SetPlayerVirtualWorld(targetid, vw);
  2185.        
  2186.         if( targetid != playerid ) SendFormattedClientMessage(targetid, COLOR_LIGHTER_RED, "Administrator %s zmienił Twój vw na %d.", pInfo[playerid][player_name], vw);
  2187.         SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Zmieniłeś vw graczowi %s na %d.", pInfo[targetid][player_name], vw));
  2188.        
  2189.         return 1;
  2190. }
  2191.  
  2192. COMMAND:setint(playerid, params[])
  2193. {
  2194.         if( !HasCrewFlag(playerid, CREW_FLAG_GM) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN) && !HasCrewFlag(playerid, CREW_FLAG_ADMIN_ROOT) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie masz uprawnień do korzystania z tej komendy.");
  2195.        
  2196.         new targetid, vw;
  2197.         if( sscanf(params, "dd", targetid, vw) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /setint [id gracza] [interior world]");
  2198.         if( vw < 0 ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /setint[id gracza] [vw]");
  2199.         if( !IsPlayerConnected(targetid) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Gracz o podanym id nie jest podlaczony.");
  2200.         if( !pInfo[targetid][player_logged] ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Gracz o podanym id nie jest zalogowany.");
  2201.        
  2202.         SetPlayerInterior(targetid, vw);
  2203.        
  2204.         if( targetid != playerid ) SendFormattedClientMessage(targetid, COLOR_LIGHTER_RED, "Administrator %s zmienił Twoj interior world na %d.", pInfo[playerid][player_name], vw);
  2205.         SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Zmieniłeś interior world graczowi %s na %d.", pInfo[targetid][player_name], vw));
  2206.        
  2207.         return 1;
  2208. }
  2209.  
  2210. COMMAND:ag(playerid, params[])
  2211. {
  2212.         return cmd_agrupa(playerid, params);
  2213. }
  2214.  
  2215. COMMAND:agrupa(playerid, params[])
  2216. {
  2217.         if( !HasCrewFlag(playerid, CREW_FLAG_GROUPS) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie masz uprawnień do korzystania z tej komendy.");
  2218.        
  2219.         new sub_cmd[40], param[150];
  2220.         if( sscanf(params, "s[40] S()[150]", sub_cmd, param) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ag)rupa [stworz/usun/flagi/nazwa/lider/info/typ/wypros/zapros]");
  2221.        
  2222.         if( !strcmp(sub_cmd, "stworz") )
  2223.         {
  2224.                 new name[50];
  2225.                 if( sscanf(param, "s[50]", name) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ag)rupa stworz [nazwa]");
  2226.                
  2227.                 mysql_real_escape_string(name, name);
  2228.                 mysql_query(mySQLconnection, sprintf("INSERT INTO `ipb_game_groups` (group_uid, group_name, group_tag) VALUES (null, '%s', 'TAG')", name));
  2229.                
  2230.                 if( cache_insert_id() )
  2231.                 {
  2232.                         new gid = Iter_Free(Groups);
  2233.                         Iter_Add(Groups, gid);
  2234.                        
  2235.                         Group[gid][group_uid] = cache_insert_id();
  2236.                         Group[gid][group_bank_money] = 0;
  2237.                        
  2238.                         strcopy(Group[gid][group_name], name);
  2239.                        
  2240.                         ShowPlayerDialog(playerid, DIALOG_INFO, DIALOG_STYLE_MSGBOX, "Informacja", sprintf("Stworzyłeś grupe %s (UID: %d, ID: %d).", Group[gid][group_name], Group[gid][group_uid], gid), "OK", "");
  2241.                 }
  2242.         }
  2243.         else if( !strcmp(sub_cmd, "kolor") )
  2244.         {
  2245.                 new color[16], uid;
  2246.                 if( sscanf(param, "ds[16]", uid,  color) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /ag kolor [uid grupy] [HEX]");
  2247.                 if(!ishex(color))  return SendClientMessage(playerid, COLOR_GREY, "Tip: /lider kolor [HEX]");
  2248.                
  2249.                 format(color, sizeof(color), "0x%sDD", color);
  2250.                 mysql_query(mySQLconnection, sprintf("UPDATE `ipb_game_groups` SET `group_color` = '%d' WHERE `group_uid` = %d", hexstring(color), uid));
  2251.                 SendGuiInformation(playerid, "Informacja", "Kolor grupy został zmieniony.");
  2252.         }
  2253.         else if( !strcmp(sub_cmd, "usun") )
  2254.         {
  2255.                 new g_uid;
  2256.                 if( sscanf(param, "d", g_uid) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ag)rupa usun [uid grupy]");
  2257.                 new gid = GetGroupByUid(g_uid);
  2258.                 if( gid == -1 ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Grupa o podanym id nie istnieje");
  2259.                
  2260.                 foreach(new d_id : Doors)
  2261.                 {
  2262.                         if( Door[d_id][door_owner_type] == DOOR_OWNER_TYPE_GROUP && Door[d_id][door_owner] == Group[gid][group_uid] ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie możesz usunąć grupy, która posiada przypisane drzwi.");
  2263.                 }
  2264.                
  2265.                 foreach(new a_id : Areas)
  2266.                 {
  2267.                         if( Area[a_id][area_owner_type] == AREA_OWNER_TYPE_GROUP && Area[a_id][area_owner] == Group[gid][group_uid] ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie możesz usunąć grupy, która posiada przypisaną strefę.");
  2268.                 }
  2269.                
  2270.                 foreach(new v_id: Vehicles)
  2271.                 {
  2272.                         if( Vehicle[v_id][vehicle_owner_type] == VEHICLE_OWNER_TYPE_GROUP && Vehicle[v_id][vehicle_owner] == Group[gid][group_uid] )
  2273.                         {
  2274.                                 mysql_query(mySQLconnection, sprintf("DELETE FROM `ipb_vehicles` WHERE `vehicle_uid` = %d", Vehicle[v_id][vehicle_uid]));
  2275.                                 DestroyDynamic3DTextLabel(Vehicle[v_id][vehicle_state_label]);
  2276.                                 DestroyDynamic3DTextLabel(Vehicle[v_id][vehicle_description]);
  2277.                                 DestroyDynamic3DTextLabel(Vehicle[v_id][vehicle_sign]);
  2278.  
  2279.                                 if(Vehicle[v_id][vehicle_siren] == true)
  2280.                                 {
  2281.                                         DestroyDynamicObject(Vehicle[v_id][vehicle_siren_object]);
  2282.                                         Vehicle[v_id][vehicle_siren] = false;
  2283.                                 }
  2284.  
  2285.                                 for(new z=0; e_vehicles:z != e_vehicles; z++)
  2286.                                 {
  2287.                                         Vehicle[v_id][e_vehicles:z] = 0;
  2288.                                 }
  2289.  
  2290.                                 DestroyVehicle(v_id);
  2291.  
  2292.                                 new next;
  2293.                             Iter_SafeRemove(Vehicles, v_id, next);
  2294.                             v_id = next;
  2295.                         }
  2296.                 }
  2297.  
  2298.                 SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Usunąłeś grupe %s [UID: %d, ID: %d] razem ze wszystkimi jej pojazdami.", Group[gid][group_name], Group[gid][group_uid], gid));
  2299.                
  2300.                 // Na poczatku usuwamy z grupy wszystkich graczy online
  2301.                 foreach(new p : Player)
  2302.                 {
  2303.                         new slot = GetPlayerGroupSlot(p, gid);
  2304.                         if( slot > -1 )
  2305.                         {
  2306.                                 if( pGroup[p][slot][pg_duty] ) PlayerTextDrawHide(p, GroupDutyTag);
  2307.                                 CleanPlayerGroup(playerid, slot);
  2308.                         }
  2309.                 }
  2310.                
  2311.                 // Teraz usuwamy czlonkow z bazy danych
  2312.                 mysql_query(mySQLconnection, sprintf("DELETE FROM `ipb_char_groups` WHERE `group_belongs` = %d", Group[gid][group_uid]));
  2313.                
  2314.                 // Kolej na usuniecie grupy z bazy danych
  2315.                 mysql_query(mySQLconnection, sprintf("DELETE FROM `ipb_game_groups` WHERE `group_uid` = %d", Group[gid][group_uid]));
  2316.                
  2317.                 // Na koncu usuwamy grupe z serwera
  2318.                 for(new z=0; e_groups:z != e_groups; z++)
  2319.                 {
  2320.                         Group[gid][e_groups:z] = 0;
  2321.                 }
  2322.                
  2323.                 Iter_Remove(Groups, gid);
  2324.         }
  2325.         else if( !strcmp(sub_cmd, "info") )
  2326.         {
  2327.                 new g_uid;
  2328.                 if( sscanf(param, "d", g_uid) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ag)rupa info [uid grupy]");
  2329.                 new gid = GetGroupByUid(g_uid);
  2330.                 if( gid == -1 ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Grupa o podanym uid nie istnieje");
  2331.                
  2332.                 new str[300];
  2333.                
  2334.                 format(str, sizeof(str), "%sTyp grupy:tt%sn", str, GroupTypes[Group[gid][group_type]]);
  2335.                 format(str, sizeof(str), "%sBudżet:ttt$%dn", str, Group[gid][group_bank_money]);
  2336.                 format(str, sizeof(str), "%sKapitał:ttt$%dn", str, Group[gid][group_capital]);
  2337.                 format(str, sizeof(str), "%sPunkty aktywności:t%s%dn", str, ((Group[gid][group_activity_points] >= 1000) ? (HEX_COLOR_LIGHTER_GREEN) : (HEX_COLOR_LIGHTER_RED)), Group[gid][group_activity_points]);
  2338.                 format(str, sizeof(str), "%sDotacja:tt$%dn", str, GetGroupDotation(gid));
  2339.                 format(str, sizeof(str), "%sTag:ttt%sn", str, GetGroupTag(gid));
  2340.                        
  2341.                 ShowPlayerDialog(playerid, DIALOG_INFO, DIALOG_STYLE_LIST, sprintf("%s (UID: %d) » Informacje", Group[gid][group_name], Group[gid][group_uid]), str, "OK", "");
  2342.         }
  2343.         else if( !strcmp(sub_cmd, "flagi") )
  2344.         {
  2345.                 new g_uid;
  2346.                 if( sscanf(param, "d", g_uid) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ag)rupa info [uid grupy]");
  2347.                 new gid = GetGroupByUid(g_uid);
  2348.                 if( gid == -1 ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Grupa o podanym uid nie istnieje");
  2349.                
  2350.                 DynamicGui_Init(playerid);
  2351.                 DynamicGui_SetDialogValue(playerid, gid);
  2352.                 new str[700];
  2353.                
  2354.                 format(str, sizeof(str), "%s%s01tRadio (czat IC)n", str, ((GroupHasFlag(gid, GROUP_FLAG_IC)) ? (HEX_COLOR_LIGHTER_GREEN) : (HEX_COLOR_LIGHTER_RED)));
  2355.                 DynamicGui_AddRow(playerid, GROUP_FLAG_IC);
  2356.                
  2357.                 format(str, sizeof(str), "%s%s02tCzat OOCn", str, ((GroupHasFlag(gid, GROUP_FLAG_OOC)) ? (HEX_COLOR_LIGHTER_GREEN) : (HEX_COLOR_LIGHTER_RED)));
  2358.                 DynamicGui_AddRow(playerid, GROUP_FLAG_OOC);
  2359.  
  2360.                 format(str, sizeof(str), "%s%s03tKolorowe nickin", str, ((GroupHasFlag(gid, GROUP_FLAG_COLORED)) ? (HEX_COLOR_LIGHTER_GREEN) : (HEX_COLOR_LIGHTER_RED)));
  2361.                 DynamicGui_AddRow(playerid, GROUP_FLAG_COLORED);
  2362.  
  2363.                 format(str, sizeof(str), "%s%s04tCzat departamentowyn", str, ((GroupHasFlag(gid, GROUP_FLAG_DEP)) ? (HEX_COLOR_LIGHTER_GREEN) : (HEX_COLOR_LIGHTER_RED)));
  2364.                 DynamicGui_AddRow(playerid, GROUP_FLAG_DEP);
  2365.  
  2366.                 format(str, sizeof(str), "%s%s05tOgraniczona służban", str, ((GroupHasFlag(gid, GROUP_FLAG_DUTY)) ? (HEX_COLOR_LIGHTER_GREEN) : (HEX_COLOR_LIGHTER_RED)));
  2367.                 DynamicGui_AddRow(playerid, GROUP_FLAG_DUTY);
  2368.  
  2369.                 format(str, sizeof(str), "%s%s06tPrzetrzymywanien", str, ((GroupHasFlag(gid, GROUP_FLAG_KEEP)) ? (HEX_COLOR_LIGHTER_GREEN) : (HEX_COLOR_LIGHTER_RED)));
  2370.                 DynamicGui_AddRow(playerid, GROUP_FLAG_KEEP);
  2371.  
  2372.                 format(str, sizeof(str), "%s%s07tStawianie blokadn", str, ((GroupHasFlag(gid, GROUP_FLAG_BLOCKADE)) ? (HEX_COLOR_LIGHTER_GREEN) : (HEX_COLOR_LIGHTER_RED)));
  2373.                 DynamicGui_AddRow(playerid, GROUP_FLAG_BLOCKADE);
  2374.  
  2375.                 format(str, sizeof(str), "%s%s08tUżywanie oflagowanych bronin", str, ((GroupHasFlag(gid, GROUP_FLAG_WEAPON_FLAG)) ? (HEX_COLOR_LIGHTER_GREEN) : (HEX_COLOR_LIGHTER_RED)));
  2376.                 DynamicGui_AddRow(playerid, GROUP_FLAG_WEAPON_FLAG);
  2377.  
  2378.                 format(str, sizeof(str), "%s%s09tZgłoszenia 911n", str, ((GroupHasFlag(gid, GROUP_FLAG_911)) ? (HEX_COLOR_LIGHTER_GREEN) : (HEX_COLOR_LIGHTER_RED)));
  2379.                 DynamicGui_AddRow(playerid, GROUP_FLAG_911);
  2380.  
  2381.                 format(str, sizeof(str), "%s%s10tTworzenie wyścigówn", str, ((GroupHasFlag(gid, GROUP_FLAG_RACES)) ? (HEX_COLOR_LIGHTER_GREEN) : (HEX_COLOR_LIGHTER_RED)));
  2382.                 DynamicGui_AddRow(playerid, GROUP_FLAG_RACES);
  2383.  
  2384.                 format(str, sizeof(str), "%s%s11tUżywanie masekn", str, ((GroupHasFlag(gid, GROUP_FLAG_MASK)) ? (HEX_COLOR_LIGHTER_GREEN) : (HEX_COLOR_LIGHTER_RED)));
  2385.                 DynamicGui_AddRow(playerid, GROUP_FLAG_MASK);
  2386.  
  2387.                 format(str, sizeof(str), "%s%s12tPrzeszukiwanien", str, ((GroupHasFlag(gid, GROUP_FLAG_SEARCH)) ? (HEX_COLOR_LIGHTER_GREEN) : (HEX_COLOR_LIGHTER_RED)));
  2388.                 DynamicGui_AddRow(playerid, GROUP_FLAG_SEARCH);
  2389.  
  2390.                 format(str, sizeof(str), "%s%s13tSkuwanie graczyn", str, ((GroupHasFlag(gid, GROUP_FLAG_CUFFS)) ? (HEX_COLOR_LIGHTER_GREEN) : (HEX_COLOR_LIGHTER_RED)));
  2391.                 DynamicGui_AddRow(playerid, GROUP_FLAG_CUFFS);
  2392.  
  2393.                 format(str, sizeof(str), "%s%s14tWyważanie drzwin", str, ((GroupHasFlag(gid, GROUP_FLAG_PRYING)) ? (HEX_COLOR_LIGHTER_GREEN) : (HEX_COLOR_LIGHTER_RED)));
  2394.                 DynamicGui_AddRow(playerid, GROUP_FLAG_PRYING);
  2395.  
  2396.                 format(str, sizeof(str), "%s%s15tDostęp do botan", str, ((GroupHasFlag(gid, GROUP_FLAG_BOT)) ? (HEX_COLOR_LIGHTER_GREEN) : (HEX_COLOR_LIGHTER_RED)));
  2397.                 DynamicGui_AddRow(playerid, GROUP_FLAG_BOT);
  2398.  
  2399.                 format(str, sizeof(str), "%s%s16tZabieranien", str, ((GroupHasFlag(gid, GROUP_FLAG_TAKE)) ? (HEX_COLOR_LIGHTER_GREEN) : (HEX_COLOR_LIGHTER_RED)));
  2400.                 DynamicGui_AddRow(playerid, GROUP_FLAG_TAKE);
  2401.  
  2402.                 format(str, sizeof(str), "%s%s17tLeczenien", str, ((GroupHasFlag(gid, GROUP_FLAG_MEDIC)) ? (HEX_COLOR_LIGHTER_GREEN) : (HEX_COLOR_LIGHTER_RED)));
  2403.                 DynamicGui_AddRow(playerid, GROUP_FLAG_MEDIC);
  2404.  
  2405.                 format(str, sizeof(str), "%s%s18tTworzenie paintjobówn", str, ((GroupHasFlag(gid, GROUP_FLAG_PAINTJOB)) ? (HEX_COLOR_LIGHTER_GREEN) : (HEX_COLOR_LIGHTER_RED)));
  2406.                 DynamicGui_AddRow(playerid, GROUP_FLAG_PAINTJOB);
  2407.  
  2408.                 format(str, sizeof(str), "%s%s19tBiznesn", str, ((GroupHasFlag(gid, GROUP_FLAG_BUSINESS)) ? (HEX_COLOR_LIGHTER_GREEN) : (HEX_COLOR_LIGHTER_RED)));
  2409.                 DynamicGui_AddRow(playerid, GROUP_FLAG_BUSINESS);
  2410.        
  2411.                 ShowPlayerDialog(playerid, DIALOG_GROUP_FLAGS, DIALOG_STYLE_LIST, sprintf("Flagi grupy [UID: %d]", g_uid), str, "Wybierz", "Zamknij");
  2412.         }
  2413.         else if( !strcmp(sub_cmd, "nazwa") )
  2414.         {
  2415.                 new g_uid, name[64];
  2416.                 if( sscanf(param, "ds[64]", g_uid, name) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ag)rupa nazwa [uid grupy] [nazwa]");
  2417.                 new gid = GetGroupByUid(g_uid);
  2418.                 if( gid == -1 ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Grupa o podanym id nie istnieje");
  2419.                 mysql_real_escape_string(name, name);  
  2420.                 strcopy(Group[gid][group_name], name);
  2421.                
  2422.                 mysql_query(mySQLconnection, sprintf("UPDATE `ipb_game_groups` SET `group_name` = '%s' WHERE `group_uid` = %d", Group[gid][group_name], Group[gid][group_uid]));
  2423.                
  2424.                 SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Pomyślnie zmieniłeś nazwe grupy [UID: %d, ID: %d] na %s.", Group[gid][group_uid], gid, Group[gid][group_name]));
  2425.         }
  2426.         else if( !strcmp(sub_cmd, "typ") )
  2427.         {
  2428.                 new g_uid;
  2429.                 if( sscanf(param, "d", g_uid) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ag)rupa typ [uid grupy]");
  2430.                 new gid = GetGroupByUid(g_uid);
  2431.                 if( gid == -1 ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Grupa o podanym uid nie istnieje");
  2432.                
  2433.                 new str[400];
  2434.                 DynamicGui_Init(playerid);
  2435.                 DynamicGui_SetDialogValue(playerid, gid);
  2436.                
  2437.                 for(new i;i<sizeof(GroupTypes);i++)
  2438.                 {
  2439.                         format(str, sizeof(str), "%s%02dt%sn", str, i+1, GroupTypes[i]);
  2440.                         DynamicGui_AddRow(playerid, 0, i);
  2441.                 }
  2442.                
  2443.                 ShowPlayerDialog(playerid, DIALOG_AGRUPA_TYP, DIALOG_STYLE_LIST, sprintf("%s (UID: %d) » Zmiana typu", Group[gid][group_name], Group[gid][group_uid]), str, "Wybierz", "Zamknij");
  2444.         }
  2445.         else if( !strcmp(sub_cmd, "lider") )
  2446.         {
  2447.                 new g_uid, targetid;
  2448.                 if( sscanf(param, "dd", g_uid, targetid) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ag)rupa lider [uid grupy] [id gracza]");
  2449.                 new gid = GetGroupByUid(g_uid);
  2450.                 if( gid == -1 ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Grupa o podanym id nie istnieje");
  2451.                 if( !IsPlayerConnected(targetid) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Gracz o podanym id nie jest podłączony.");
  2452.                 if( !pInfo[targetid][player_logged] ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Gracz o podanym id nie jest zalogowany.");
  2453.                
  2454.                 new slot = GetPlayerGroupSlot(targetid, gid);
  2455.                 if( slot > -1 )
  2456.                 {
  2457.                         mysql_query(mySQLconnection, sprintf("UPDATE `ipb_char_groups` SET `group_perm` = %d WHERE `char_uid` = %d AND `group_belongs` = %d", 63, pInfo[targetid][player_id], Group[gid][group_uid]));
  2458.                        
  2459.                         pGroup[targetid][slot][pg_rank_perm] = 63;
  2460.                        
  2461.                         SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Nadałeś graczowi %s (UID: %d, ID: %d) uprawnienia lidera w grupie %s (UID: %d).", pInfo[targetid][player_name], pInfo[targetid][player_id], targetid, Group[gid][group_name], Group[gid][group_uid]));
  2462.                         if( targetid != playerid ) SendGuiInformation(targetid, "Informacja", sprintf("Administrator %s nadał Ci uprawnienia lidera w grupie %s (UID: %d).", pInfo[playerid][player_name], Group[gid][group_name], Group[gid][group_uid]));
  2463.                 }
  2464.                 else
  2465.                 {
  2466.                         new free_slot = GetPlayerGroupFreeSlot(targetid);
  2467.                         if( free_slot == -1 ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Gracz o podanym id nie ma już wolnego slotu grupy.");
  2468.                        
  2469.                         mysql_query(mySQLconnection, sprintf("INSERT INTO `ipb_char_groups` (char_uid, group_belongs, group_perm) VALUES (%d, %d, %d)", pInfo[targetid][player_id], Group[gid][group_uid], 63));
  2470.                        
  2471.                         pGroup[targetid][free_slot][pg_id] = gid;
  2472.                         pGroup[targetid][free_slot][pg_rank_perm] = 63;
  2473.                         SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Zaprosiles gracza %s (UID: %d, ID: %d) i nadales mu uprawnienia lidera w grupie %s (UID: %d).", pInfo[targetid][player_name], pInfo[targetid][player_id], targetid, Group[gid][group_name], Group[gid][group_uid]));
  2474.                         if( targetid != playerid ) SendGuiInformation(targetid, "Informacja", sprintf("Administrator %s zaprosil Cie do grupy %s (UID: %d) nadajÂąc uprawnienia lidera.", pInfo[playerid][player_name], Group[gid][group_name], Group[gid][group_uid]));
  2475.                 }
  2476.         }
  2477.         else if( !strcmp(sub_cmd, "zapros") )
  2478.         {
  2479.                 new g_uid, targetid;
  2480.                 if( sscanf(param, "dd", g_uid, targetid) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ag)rupa zapros [uid grupy] [id gracza]");
  2481.                 new gid = GetGroupByUid(g_uid);
  2482.                 if( gid == -1 ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Grupa o podanym id nie istnieje");
  2483.                 if( !IsPlayerConnected(targetid) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Gracz o podanym id nie jest podłączony.");
  2484.                 if( !pInfo[targetid][player_logged] ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Gracz o podanym id nie jest zalogowany.");
  2485.                 if( GetPlayerGroupSlot(targetid, gid) > -1 ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Gracz o podanym id jest już w tej grupie.");
  2486.                
  2487.                 new free_slot = GetPlayerGroupFreeSlot(targetid);
  2488.                 if( free_slot == -1 ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Gracz o podanym id nie ma już wolnego slotu grupy.");
  2489.                
  2490.                 mysql_query(mySQLconnection, sprintf("INSERT INTO `ipb_char_groups` (char_uid, group_belongs, group_perm) VALUES (%d, %d, %d)", pInfo[targetid][player_id], Group[gid][group_uid], 31));
  2491.                        
  2492.                 pGroup[targetid][free_slot][pg_id] = gid;
  2493.                 pGroup[targetid][free_slot][pg_rank_perm] = 31;
  2494.                 SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Zaprosiles gracza %s (UID: %d, ID: %d) do grupy %s (UID: %d).", pInfo[targetid][player_name], pInfo[targetid][player_id], targetid, Group[gid][group_name], Group[gid][group_uid]));
  2495.                 if( targetid != playerid ) SendGuiInformation(targetid, "Informacja", sprintf("Administrator %s zaprosil Cie do grupy %s (UID: %d).", pInfo[playerid][player_name], Group[gid][group_name], Group[gid][group_uid]));
  2496.         }
  2497.         else if( !strcmp(sub_cmd, "wypros") )
  2498.         {
  2499.                 new g_uid, targetid;
  2500.                 if( sscanf(param, "dd", g_uid, targetid) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ag)rupa wypros [uid grupy] [id gracza]");
  2501.                 new gid = GetGroupByUid(g_uid);
  2502.                 if( gid == -1 ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Grupa o podanym id nie istnieje");
  2503.                 if( !IsPlayerConnected(targetid) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Gracz o podanym id nie jest podłączony.");
  2504.                 if( !pInfo[targetid][player_logged] ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Gracz o podanym id nie jest zalogowany.");
  2505.                
  2506.                 new slot = GetPlayerGroupSlot(targetid, gid);
  2507.                 if( slot == -1 ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Gracz o podanym id nie jest w tej grupie.");
  2508.                
  2509.                 mysql_query(mySQLconnection, sprintf("DELETE FROM `ipb_char_groups` WHERE `char_uid` = %d AND `group_belongs` = %d", pInfo[targetid][player_id], Group[gid][group_uid]));
  2510.                
  2511.                 if( pGroup[targetid][slot][pg_duty] ) PlayerTextDrawHide(targetid, GroupDutyTag);
  2512.                
  2513.                 CleanPlayerGroup(targetid, slot);
  2514.                
  2515.                 SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Wyprosiłeś gracza %s (UID: %d, ID: %d) z grupy %s (UID: %d).", pInfo[targetid][player_name], pInfo[targetid][player_id], targetid, Group[gid][group_name], Group[gid][group_uid]));
  2516.                 if( targetid != playerid ) SendGuiInformation(targetid, "Informacja", sprintf("Administrator %s wyprosił Cie z grupy %s (UID: %d).", pInfo[playerid][player_name], Group[gid][group_name], Group[gid][group_uid]));
  2517.         }
  2518.         else return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ag)rupa [stworz/usun/nazwa/lider/info/typ/wypros/zapros]");
  2519.         return 1;
  2520. }
  2521.  
  2522. COMMAND:av(playerid, params[])
  2523. {      
  2524.         return cmd_avehicle(playerid, params);
  2525. }
  2526.  
  2527. COMMAND:avehicle(playerid, params[])
  2528. {
  2529.         if( !HasCrewFlag(playerid, CREW_FLAG_VEHICLES) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie masz uprawnień do korzystania z tej komendy.");
  2530.        
  2531.         new sub_cmd[40], param[150];
  2532.         if( sscanf(params, "s[40] S()[150]", sub_cmd, param) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(av)ehicle [stworz/usun/info/model/hp/visual/przypisz/id/zaparkuj/resp/spawn/unspawn/paliwotyp/paliwo/goto/gethere/kolor1/kolor2]");
  2533.        
  2534.         if( !strcmp(sub_cmd, "stworz") )
  2535.         {
  2536.                 new carmodel[32], c1, c2;
  2537.                 if( sscanf(param, "dds[32]", c1, c2, carmodel) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(av)ehicle stworz [kolor1] [kolor2] [nazwa]");
  2538.  
  2539.                 new model = GetVehicleModelIDFromName(carmodel);
  2540.  
  2541.                 if( model < 400 || model > 611 ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Podałeś błędną nazwe pojazdu.");
  2542.                
  2543.                 new Float:v_pos[4];
  2544.                 GetPointInAngleOfPlayer(playerid, v_pos[0], v_pos[1], v_pos[2], 4.0, 0.0);
  2545.                
  2546.                 GetPlayerFacingAngle(playerid, v_pos[3]);
  2547.                 if( v_pos[3] > 90.0 ) v_pos[3] -= 90.0;
  2548.                 else v_pos[3] += 90.0;
  2549.                
  2550.                 mysql_query(mySQLconnection, sprintf("INSERT INTO `ipb_vehicles` (vehicle_uid, vehicle_model, vehicle_posx, vehicle_posy, vehicle_posz, vehicle_posa, vehicle_world, vehicle_interior, vehicle_color1, vehicle_color2, vehicle_fuel) VALUES (null, %d, %f, %f, %f, %f, %d, %d, %d, %d, '20.0')", model, v_pos[0], v_pos[1], v_pos[2], v_pos[3], GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), c1, c2));
  2551.                 new uid = cache_insert_id();
  2552.        
  2553.                 new vid = LoadVehicle(sprintf("WHERE `vehicle_uid` = %d", uid), true);
  2554.        
  2555.                 SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Stworzyłeś pojazd %s [UID: %d, ID: %d].", VehicleNames[model-400], uid, vid));
  2556.         }
  2557.         else if( !strcmp(sub_cmd, "usun") )
  2558.         {
  2559.                 new vid;
  2560.                 if( sscanf(param, "d", vid) ) return SendClientMessage(playerid, COLOR_GREY, "Tip /(av)ehicle usun [id pojazdu]");
  2561.                 if( !Iter_Contains(Vehicles, vid) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Pojazd o podanym id nie istnieje.");
  2562.  
  2563.                 SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Pomyślnie usunąłeś pojazd %s [UID: %d, ID: %d]", VehicleNames[GetVehicleModel(vid)-400], Vehicle[vid][vehicle_uid], vid));
  2564.                
  2565.                 DeleteVehicle(vid, true);
  2566.         }
  2567.         else if( !strcmp(sub_cmd, "spawn") )
  2568.         {
  2569.                 new v_uid;
  2570.                 if( sscanf(param, "d", v_uid) ) return SendClientMessage(playerid, COLOR_GREY, "Tip /(av)ehicle spawn [uid pojazdu]");
  2571.                 if( v_uid < 1 ) return SendClientMessage(playerid, COLOR_GREY, "Tip /(av)ehicle spawn [uid pojazdu]");
  2572.                
  2573.                 new vid = LoadVehicle(sprintf("WHERE `vehicle_uid` = %d", v_uid), true);
  2574.                
  2575.                 if( vid == INVALID_VEHICLE_ID ) SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Pojazd o podanym uid nie istnieje lub jest już zespawnowany.");
  2576.                 else SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Zespawnowales pojazd %s [UID: %d, ID: %d].", VehicleNames[GetVehicleModel(vid)-400], v_uid, vid));
  2577.         }
  2578.         else if( !strcmp(sub_cmd, "tirestate") )
  2579.         {
  2580.                 new vid, tstate;
  2581.                 if( sscanf(param, "dd", vid, tstate) ) return SendClientMessage(playerid, COLOR_GREY, "Tip /(av)ehicle tirestate[id pojazdu] [state]");
  2582.                 if( !Iter_Contains(Vehicles, vid) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Pojazd o podanym id nie istnieje.");
  2583.                
  2584.                 SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Zmieniono stan opon pojazdu %s [UID: %d, ID: %d].", VehicleNames[GetVehicleModel(vid)-400], Vehicle[vid][vehicle_uid], vid));
  2585.                
  2586.                 new Panels, Doors, Lights, Tires;
  2587.                 GetVehicleDamageStatus(vid, Panels, Doors, Lights, Tires);
  2588.                 UpdateVehicleDamageStatus(vid, Panels, Doors, Lights, tstate);
  2589.         }
  2590.         else if( !strcmp(sub_cmd, "unspawn") )
  2591.         {
  2592.                 new vid;
  2593.                 if( sscanf(param, "d", vid) ) return SendClientMessage(playerid, COLOR_GREY, "Tip /(av)ehicle unspawn [id pojazdu]");
  2594.                 if( !Iter_Contains(Vehicles, vid) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Pojazd o podanym id nie istnieje.");
  2595.                
  2596.                 SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Odspawnowales pojazd %s [UID: %d, ID: %d].", VehicleNames[GetVehicleModel(vid)-400], Vehicle[vid][vehicle_uid], vid));
  2597.                
  2598.                 DeleteVehicle(vid);
  2599.         }
  2600.         else if( !strcmp(sub_cmd, "reset") )
  2601.         {
  2602.                 new vid;
  2603.                 if( sscanf(param, "d", vid) ) return SendClientMessage(playerid, COLOR_GREY, "Tip /(av)ehicle reset [id pojazdu]");
  2604.                 if( !Iter_Contains(Vehicles, vid) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Pojazd o podanym id nie istnieje.");
  2605.                
  2606.                 SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Zresetowales pojazd %s [UID: %d, ID: %d].", VehicleNames[GetVehicleModel(vid)-400], Vehicle[vid][vehicle_uid], vid));
  2607.                
  2608.                 SetVehiclePos(vid, Vehicle[vid][vehicle_park][0],Vehicle[vid][vehicle_park][1],Vehicle[vid][vehicle_park][2]);
  2609.                 SetVehicleZAngle(vid, Vehicle[vid][vehicle_park][3]);
  2610.                 SetVehicleVirtualWorld(vid, Vehicle[vid][vehicle_park_world]);
  2611.                 LinkVehicleToInterior(vid, Vehicle[vid][vehicle_park_interior]);       
  2612.         }
  2613.         else if( !strcmp(sub_cmd, "model") )
  2614.         {
  2615.                 new vid, carmodel[32];
  2616.                 if( sscanf(param, "ds[32]", vid, carmodel) ) return SendClientMessage(playerid, COLOR_GREY, "Tip /(av)ehicle model [id pojazdu] [nazwa pojazdu]");
  2617.                 if( !Iter_Contains(Vehicles, vid) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Pojazd o podanym id nie istnieje.");
  2618.  
  2619.                 new model = GetVehicleModelIDFromName(carmodel);
  2620.                 if( model < 400 || model > 611 ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Podales błędną nazwe pojazdu.");
  2621.                
  2622.                 mysql_query(mySQLconnection, sprintf("UPDATE `ipb_vehicles` SET `vehicle_model` = %d WHERE `vehicle_uid` = %d", model, Vehicle[vid][vehicle_uid]));
  2623.                
  2624.                 new uid = Vehicle[vid][vehicle_uid];
  2625.                 DeleteVehicle(vid);
  2626.                
  2627.                 new v_id = LoadVehicle(sprintf("WHERE `vehicle_uid` = %d", uid), true);
  2628.                 SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Pomyślnie zmieniłeś model pojazu na %s [UID: %d, ID: %d]", VehicleNames[GetVehicleModel(v_id)-400], uid, v_id));
  2629.         }
  2630.         else if( !strcmp(sub_cmd, "id") )
  2631.         {
  2632.                 new v_uid;
  2633.                 if( sscanf(param, "d", v_uid) ) return SendClientMessage(playerid, COLOR_GREY, "Tip /(av)ehicle id [uid pojazdu]");
  2634.                 if( v_uid < 1 ) return SendClientMessage(playerid, COLOR_GREY, "Tip /(av)ehicle id [uid pojazdu]");
  2635.                
  2636.                 new vid = GetVehicleByUid(v_uid);
  2637.                
  2638.                 if( vid == INVALID_VEHICLE_ID ) SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Pojazd o podanym uid nie jest zespawnowany.");
  2639.                 else SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Pojazd %s posiada ID: %d.", VehicleNames[GetVehicleModel(vid)-400], vid));
  2640.         }
  2641.         else if( !strcmp(sub_cmd, "info") )
  2642.         {
  2643.                 new vid;
  2644.                 if( sscanf(param, "d", vid) ) return SendClientMessage(playerid, COLOR_GREY, "Tip /(av)ehicle info [id pojazdu]");
  2645.                 if( !Iter_Contains(Vehicles, vid) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Pojazd o podanym id nie istnieje.");
  2646.  
  2647.                 new owner_str[80];
  2648.                 switch( Vehicle[vid][vehicle_owner_type] )
  2649.                 {
  2650.                         case VEHICLE_OWNER_TYPE_PLAYER:
  2651.                         {                      
  2652.                                 new name[MAX_PLAYER_NAME+1];
  2653.                                 GetPlayerNameByUid(Vehicle[vid][vehicle_owner], name);
  2654.                                
  2655.                                 format(owner_str, sizeof(owner_str), "gracz; %s", name);
  2656.                         }
  2657.                        
  2658.                         case VEHICLE_OWNER_TYPE_GROUP:
  2659.                         {                      
  2660.                                 new gid = GetGroupByUid(Vehicle[vid][vehicle_owner]);
  2661.                                 format(owner_str, sizeof(owner_str), "grupa; %s", Group[gid][group_name]);
  2662.                         }
  2663.  
  2664.                         case VEHICLE_OWNER_TYPE_JOB:
  2665.                         {                      
  2666.                                 format(owner_str, sizeof(owner_str), "praca; %d", Vehicle[vid][vehicle_owner]);
  2667.                         }
  2668.                 }
  2669.                
  2670.                 new string[340];
  2671.                 format(string, sizeof(string), "Pojazd UID %d - %s~n~~n~~y~Owner: ~w~%d:%d (%s)~n~~y~Kolory:~w~ %d:%d~n~", Vehicle[vid][vehicle_uid], VehicleNames[GetVehicleModel(vid)-400], Vehicle[vid][vehicle_owner_type], Vehicle[vid][vehicle_owner], owner_str, Vehicle[vid][vehicle_color][0], Vehicle[vid][vehicle_color][1]);
  2672.                 format(string, sizeof(string), "%s~n~~y~Paliwo: ~w~%d/%d~n~~y~Rejestracja: ~w~%s~n~~y~HP: ~w~%.1f", string, floatround(Vehicle[vid][vehicle_fuel_current], floatround_ceil), VehicleFuelMax[GetVehicleModel(vid)-400], Vehicle[vid][vehicle_register], Vehicle[vid][vehicle_health]);
  2673.                 format(string, sizeof(string), "%s~n~~n~~b~~h~~h~VW:~w~ %d~n~~b~~h~~h~INT: ~w~%d~n~~n~Klawisz ~p~N~w~ zamyka to okno.", string, Vehicle[vid][vehicle_park_world], Vehicle[vid][vehicle_park_interior]);
  2674.  
  2675.                
  2676.                 TextDrawSetString(Tutorial[playerid], string);
  2677.                 TextDrawShowForPlayer(playerid, Tutorial[playerid]);
  2678.         }
  2679.         else if( !strcmp(sub_cmd, "fix") )
  2680.         {
  2681.                 new vid;
  2682.                 if( sscanf(param, "d", vid) ) return SendClientMessage(playerid, COLOR_GREY, "Tip /(av)ehicle fix [id pojazdu]");
  2683.                 if( !Iter_Contains(Vehicles, vid) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Pojazd o podanym id nie istnieje.");
  2684.                
  2685.                 SetVehicleHealth(vid, 1000.0);
  2686.  
  2687.                 Vehicle[vid][vehicle_destroyed] = false;
  2688.                 Vehicle[vid][vehicle_damage][0] = 0;
  2689.                 Vehicle[vid][vehicle_damage][1] = 0;
  2690.                 Vehicle[vid][vehicle_damage][2] = 0;
  2691.                 Vehicle[vid][vehicle_damage][3] = 0;
  2692.  
  2693.                 UpdateVehicleDamageStatus(vid, Vehicle[vid][vehicle_damage][0], Vehicle[vid][vehicle_damage][1], Vehicle[vid][vehicle_damage][2], Vehicle[vid][vehicle_damage][3]);
  2694.  
  2695.                 SaveVehicle(vid);
  2696.                
  2697.                 SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Naprawiles pojazd %s [UID: %d, ID: %d].", VehicleNames[GetVehicleModel(vid)-400], Vehicle[vid][vehicle_uid], vid));
  2698.                
  2699.                 logprintf(LOG_VEHICLE, "[/av fix] [VUID: %d, PUID: %d, PGID: %d]", Vehicle[vid][vehicle_uid], pInfo[playerid][player_id], gInfo[playerid][global_id]);
  2700.         }
  2701.         else if( !strcmp(sub_cmd, "hp") )
  2702.         {
  2703.                 new vid, Float:hp;
  2704.                 if( sscanf(param, "df", vid, hp) ) return SendClientMessage(playerid, COLOR_GREY, "Tip /(av)ehicle hp [id pojazdu] [hp]");
  2705.                 if( !Iter_Contains(Vehicles, vid) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Pojazd o podanym id nie istnieje.");
  2706.                 if( hp < 0.0 ) return SendClientMessage(playerid, COLOR_GREY, "Tip /(av)ehicle hp [id pojazdu] [hp]");
  2707.                
  2708.                 SetVehicleHealth(vid, hp);
  2709.                 Vehicle[vid][vehicle_destroyed] = false;
  2710.                 mysql_query(mySQLconnection, sprintf("UPDATE `ipb_vehicles` SET `vehicle_health` = %f WHERE `vehicle_uid` = %d", hp, Vehicle[vid][vehicle_uid]));
  2711.                
  2712.                 SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Ustawiles %.1f hp pojazdowi %s [UID: %d, ID: %d].", hp, VehicleNames[GetVehicleModel(vid)-400], Vehicle[vid][vehicle_uid], vid));
  2713.                
  2714.                 logprintf(LOG_VEHICLE, "[/av hp] [VUID: %d, PUID: %d, PGID: %d, VHP: %f]", Vehicle[vid][vehicle_uid], pInfo[playerid][player_id], gInfo[playerid][global_id], hp);
  2715.         }
  2716.         else if( !strcmp(sub_cmd, "visual") )
  2717.         {
  2718.                 new vid;
  2719.                 if( sscanf(param, "d", vid) ) return SendClientMessage(playerid, COLOR_GREY, "Tip /(av)ehicle visual [id pojazdu]");
  2720.                 if( !Iter_Contains(Vehicles, vid) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Pojazd o podanym id nie istnieje.");
  2721.                
  2722.                 Vehicle[vid][vehicle_damage][0] = 0;
  2723.                 Vehicle[vid][vehicle_damage][1] = 0;
  2724.                 Vehicle[vid][vehicle_damage][2] = 0;
  2725.                 Vehicle[vid][vehicle_damage][3] = 0;
  2726.                
  2727.                 UpdateVehicleDamageStatus(vid, Vehicle[vid][vehicle_damage][0], Vehicle[vid][vehicle_damage][1], Vehicle[vid][vehicle_damage][2], Vehicle[vid][vehicle_damage][3]);
  2728.                
  2729.                 SaveVehicle(vid);
  2730.                
  2731.                 SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Naprawiles uszkodzenia wizualne pojazdu %s [UID: %d, ID: %d].", VehicleNames[GetVehicleModel(vid)-400], Vehicle[vid][vehicle_uid], vid));
  2732.         }
  2733.         else if( !strcmp(sub_cmd, "zaparkuj") )
  2734.         {
  2735.                 new vid;
  2736.                 if( sscanf(param, "d", vid) ) return SendClientMessage(playerid, COLOR_GREY, "Tip /(av)ehicle zaparkuj [id pojazdu]");
  2737.                 if( !Iter_Contains(Vehicles, vid) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Pojazd o podanym id nie istnieje.");
  2738.                
  2739.                 GetVehiclePos(vid, Vehicle[vid][vehicle_park][0], Vehicle[vid][vehicle_park][1], Vehicle[vid][vehicle_park][2]);
  2740.                 GetVehicleZAngle(vid, Vehicle[vid][vehicle_park][3]);
  2741.                 Vehicle[vid][vehicle_park_world] = GetVehicleVirtualWorld(vid);
  2742.                 Vehicle[vid][vehicle_park_interior] = Vehicle[vid][vehicle_interior];
  2743.  
  2744.                 mysql_query(mySQLconnection, sprintf("UPDATE `ipb_vehicles` SET `vehicle_posx` = %f, `vehicle_posy` = %f, `vehicle_posz` = %f, `vehicle_posa` = %f, `vehicle_world` = %d, `vehicle_interior` = %d WHERE `vehicle_uid` = %d", Vehicle[vid][vehicle_park][0], Vehicle[vid][vehicle_park][1], Vehicle[vid][vehicle_park][2], Vehicle[vid][vehicle_park][3], Vehicle[vid][vehicle_park_world], Vehicle[vid][vehicle_park_interior] ,Vehicle[vid][vehicle_uid]));
  2745.        
  2746.                 SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Zaparkowano pojazd %s [UID: %d, ID: %d].", VehicleNames[GetVehicleModel(vid)-400], Vehicle[vid][vehicle_uid], vid));
  2747.         }
  2748.         else if( !strcmp(sub_cmd, "przypisz") )
  2749.         {
  2750.                 new vid, action[10], id;
  2751.                 if( sscanf(param, "ds[10]d", vid, action, id) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /av przypisz [id pojazdu] [gracz/grupa/praca] [id postaci/uid grupy/id pracy]");
  2752.                
  2753.                 if( !strcmp(action, "gracz") )
  2754.                 {
  2755.                         if( !IsPlayerConnected(id) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Gracza o podanym id nie ma na serwerze.");
  2756.                         if( !pInfo[id][player_logged] ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Gracz o podanym id nie jest zalogowany.");
  2757.                         if( !Iter_Contains(Vehicles, vid) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Pojazd o podanym id nie istnieje.");
  2758.                        
  2759.                         mysql_query(mySQLconnection, sprintf("UPDATE `ipb_vehicles` SET `vehicle_ownertype` = %d, `vehicle_owner` = %d WHERE `vehicle_uid` = %d", VEHICLE_OWNER_TYPE_PLAYER, pInfo[id][player_id], Vehicle[vid][vehicle_uid]));
  2760.                         Vehicle[vid][vehicle_owner_type] = VEHICLE_OWNER_TYPE_PLAYER;
  2761.                         Vehicle[vid][vehicle_owner] = pInfo[id][player_id];
  2762.                        
  2763.                         SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Przypisano pojazd %s [UID: %d, ID: %d] graczowi %s [ID: %d].", VehicleNames[GetVehicleModel(vid)-400], Vehicle[vid][vehicle_uid], vid, pInfo[id][player_name], id));
  2764.                 }
  2765.                 else if( !strcmp(action, "praca") )
  2766.                 {      
  2767.                         if( !Iter_Contains(Vehicles, vid) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Pojazd o podanym id nie istnieje.");
  2768.                         mysql_query(mySQLconnection, sprintf("UPDATE `ipb_vehicles` SET `vehicle_ownertype` = %d, `vehicle_owner` = %d WHERE `vehicle_uid` = %d", VEHICLE_OWNER_TYPE_JOB, id, Vehicle[vid][vehicle_uid]));
  2769.                         Vehicle[vid][vehicle_owner_type] = VEHICLE_OWNER_TYPE_JOB;
  2770.                         Vehicle[vid][vehicle_owner] = id;
  2771.                        
  2772.                         SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Przypisano pojazd %s [UID: %d, ID: %d] pracy dorywczej [ID: %d].", VehicleNames[GetVehicleModel(vid)-400], Vehicle[vid][vehicle_uid], vid, id));
  2773.                 }
  2774.                 else if( !strcmp(action, "grupa") )
  2775.                 {
  2776.                         if( !Iter_Contains(Vehicles, vid) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Pojazd o podanym id nie istnieje.");
  2777.                         new gid = GetGroupByUid(id);
  2778.                         if( gid == -1 ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Grupa o podanym uid nie istnieje.");
  2779.                        
  2780.                         mysql_query(mySQLconnection, sprintf("UPDATE `ipb_vehicles` SET `vehicle_ownertype` = %d, `vehicle_owner` = %d WHERE `vehicle_uid` = %d", VEHICLE_OWNER_TYPE_GROUP, id, Vehicle[vid][vehicle_uid]));
  2781.                         Vehicle[vid][vehicle_owner_type] = VEHICLE_OWNER_TYPE_GROUP;
  2782.                         Vehicle[vid][vehicle_owner] = id;
  2783.                        
  2784.                         SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Przypisano pojazd %s [UID: %d, ID: %d] grupie %s [UID: %d].", VehicleNames[GetVehicleModel(vid)-400], Vehicle[vid][vehicle_uid], vid, Group[gid][group_name], id));
  2785.                 }
  2786.                 else return SendClientMessage(playerid, COLOR_GREY, "Tip: /(av)ehicle przypisz [id pojazdu] [postac/grupa] [id postaci/uid grupy]");
  2787.         }
  2788.         else if( !strcmp(sub_cmd, "paliwotyp") )
  2789.         {
  2790.                 new vid, type;
  2791.                 if( sscanf(param, "dd", vid, type) ) return SendClientMessage(playerid, COLOR_GREY, "Tip /(av)ehicle paliwotyp [id pojazdu] [1 - benzyna, 2 - gaz, 3 - diesel, 4 - paliwo lotnicze]");
  2792.                 if( !Iter_Contains(Vehicles, vid) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Pojazd o podanym id nie istnieje.");
  2793.                 if( type < 1 || type > 4 ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Podales błędny typ paliwa.");
  2794.                
  2795.                 mysql_query(mySQLconnection, sprintf("UPDATE `ipb_vehicles` SET `vehicle_fueltype` = %d WHERE `vehicle_uid` = %d", type, Vehicle[vid][vehicle_uid]));
  2796.                
  2797.                 Vehicle[vid][vehicle_fuel_type] = type;
  2798.                
  2799.                 SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Zmieniono typ paliwa pojazdu %s [UID: %d, ID: %d] na: %s.", VehicleNames[GetVehicleModel(vid)-400], Vehicle[vid][vehicle_uid], vid, VehicleFuelTypes[type]));
  2800.         }
  2801.         else if( !strcmp(sub_cmd, "paliwo") )
  2802.         {
  2803.                 new vid, Float:amount;
  2804.                 if( sscanf(param, "df", vid, amount) ) return SendClientMessage(playerid, COLOR_GREY, "Tip /(av)ehicle paliwo [id pojazdu] [ilość]");
  2805.                 if( !Iter_Contains(Vehicles, vid) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Pojazd o podanym id nie istnieje.");
  2806.                 if( amount < 0.0 || amount > 3000.0 ) return  SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Podales blednÂą ilosæ paliwa.");
  2807.                
  2808.                 mysql_query(mySQLconnection, sprintf("UPDATE `ipb_vehicles` SET `vehicle_fuel` = %f WHERE `vehicle_uid` = %d", amount, Vehicle[vid][vehicle_uid]));
  2809.                 Vehicle[vid][vehicle_fuel_current] = amount;
  2810.                
  2811.                 SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Pomyślnie ustawiles ilosc paliwa w pojezdzie %s [UID: %d, ID: %d] na: %.1fL.", VehicleNames[GetVehicleModel(vid)-400], Vehicle[vid][vehicle_uid], vid, amount));
  2812.         }
  2813.         else if( !strcmp(sub_cmd, "goto") )
  2814.         {
  2815.                 new vid;
  2816.                 if( sscanf(param, "d", vid) ) return SendClientMessage(playerid, COLOR_GREY, "Tip /(av)ehicle goto [id pojazdu]");
  2817.                 if( !Iter_Contains(Vehicles, vid) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Pojazd o podanym id nie istnieje.");
  2818.                
  2819.                 new Float:v_pos[3];
  2820.                 GetVehiclePos(vid, v_pos[0], v_pos[1], v_pos[2]);
  2821.                
  2822.                 RP_PLUS_SetPlayerPos(playerid, v_pos[0], v_pos[1], v_pos[2]);
  2823.                 SetPlayerVirtualWorld(playerid, GetVehicleVirtualWorld(vid));
  2824.                 SetPlayerInterior(playerid, Vehicle[vid][vehicle_interior]);
  2825.                
  2826.                 SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Teleportowales sie do pojazdu %s [UID: %d, ID: %d, VW: %d, INT: %d]", VehicleNames[GetVehicleModel(vid)-400], Vehicle[vid][vehicle_uid], vid, GetVehicleVirtualWorld(vid), Vehicle[vid][vehicle_interior]));
  2827.         }
  2828.         else if( !strcmp(sub_cmd, "gethere") )
  2829.         {
  2830.                 new vid;
  2831.                 if( sscanf(param, "d", vid) ) return SendClientMessage(playerid, COLOR_GREY, "Tip /(av)ehicle gethere [id pojazdu]");
  2832.                 if( !Iter_Contains(Vehicles, vid) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Pojazd o podanym id nie istnieje.");
  2833.                
  2834.                 new Float:v_pos[4];
  2835.                 GetPointInAngleOfPlayer(playerid, v_pos[0], v_pos[1], v_pos[2], 4.0, 0.0);
  2836.                
  2837.                 GetPlayerFacingAngle(playerid, v_pos[3]);
  2838.                 if( v_pos[3] > 90.0 ) v_pos[3] -= 90.0;
  2839.                 else v_pos[3] += 90.0;
  2840.                
  2841.                 SetVehiclePos(vid, v_pos[0], v_pos[1], v_pos[2]);
  2842.                 SetVehicleZAngle(vid, v_pos[3]);
  2843.                 SetVehicleVirtualWorld(vid, GetPlayerVirtualWorld(playerid));
  2844.                 LinkVehicleToInterior(vid, GetPlayerInterior(playerid));
  2845.                
  2846.                 SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Przeteleportowales do siebie pojazd %s [UID: %d, ID: %d]", VehicleNames[GetVehicleModel(vid)-400], Vehicle[vid][vehicle_uid], vid));
  2847.         }
  2848.         else if( !strcmp(sub_cmd, "kolor1") )
  2849.         {
  2850.                 new vid, color;
  2851.                 if( sscanf(param, "dd", vid, color) ) return SendClientMessage(playerid, COLOR_GREY, "Tip /(av)ehicle kolor1 [id pojazdu] [kolor]");
  2852.                 if( !Iter_Contains(Vehicles, vid) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Pojazd o podanym id nie istnieje.");
  2853.                 if( color < 0 || color > 255 ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Podany kolor nie istnieje.");
  2854.                
  2855.                 Vehicle[vid][vehicle_color][0] = color;
  2856.                 mysql_query(mySQLconnection, sprintf("UPDATE `ipb_vehicles` SET `vehicle_color1` = %d WHERE `vehicle_uid` = %d", color, Vehicle[vid][vehicle_uid]));
  2857.                
  2858.                 ChangeVehicleColor(vid, Vehicle[vid][vehicle_color][0], Vehicle[vid][vehicle_color][1]);
  2859.                
  2860.                 SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Zmieniono kolor pojazdu %s [UID: %d, ID: %d] na %d:%d.", VehicleNames[GetVehicleModel(vid)-400], Vehicle[vid][vehicle_uid], vid, Vehicle[vid][vehicle_color][0], Vehicle[vid][vehicle_color][1]));
  2861.         }
  2862.         else if( !strcmp(sub_cmd, "kolor2") )
  2863.         {
  2864.                 new vid, color;
  2865.                 if( sscanf(param, "dd", vid, color) ) return SendClientMessage(playerid, COLOR_GREY, "Tip /(av)ehicle kolor1 [id pojazdu] [kolor]");
  2866.                 if( !Iter_Contains(Vehicles, vid) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Pojazd o podanym id nie istnieje.");
  2867.                 if( color < 0 || color > 255 ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Podany kolor nie istnieje.");
  2868.                
  2869.                 Vehicle[vid][vehicle_color][1] = color;
  2870.                 mysql_query(mySQLconnection, sprintf("UPDATE `ipb_vehicles` SET `vehicle_color2` = %d WHERE `vehicle_uid` = %d", color, Vehicle[vid][vehicle_uid]));
  2871.                
  2872.                 ChangeVehicleColor(vid, Vehicle[vid][vehicle_color][0], Vehicle[vid][vehicle_color][1]);
  2873.                
  2874.                 SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Zmieniłeś kolor pojazdu %s [UID: %d, ID: %d] na %d:%d.", VehicleNames[GetVehicleModel(vid)-400], Vehicle[vid][vehicle_uid], vid, Vehicle[vid][vehicle_color][0], Vehicle[vid][vehicle_color][1]));
  2875.         }
  2876.         else if( !strcmp(sub_cmd, "tablica") )
  2877.         {
  2878.                 new plate[32], vid;
  2879.                 if( sscanf(param, "ds[32]", vid, plate) ) return SendClientMessage(playerid, COLOR_GREY, "Tip /(av)ehicle tablica [id pojazdu] [nowa rejestracja]");
  2880.                 if( !Iter_Contains(Vehicles, vid) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Pojazd o podanym id nie istnieje.");
  2881.                 sscanf(plate, "s[32]", Vehicle[vid][vehicle_register]);
  2882.                 mysql_query(mySQLconnection, sprintf("UPDATE `ipb_vehicles` SET `vehicle_register` = '%s' WHERE `vehicle_uid` = %d", plate, Vehicle[vid][vehicle_uid]));
  2883.                 SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Zmieniono tablice rejestracyjne pojazdu %s [UID: %d, ID: %d].", VehicleNames[GetVehicleModel(vid)-400], Vehicle[vid][vehicle_uid], vid));
  2884.         }
  2885.         else if( !strcmp(sub_cmd, "resp") )
  2886.         {
  2887.                 new vid;
  2888.                 if( sscanf(param, "d", vid) ) return SendClientMessage(playerid, COLOR_GREY, "Tip /(av)ehicle resp [id pojazdu]");
  2889.                 if( !Iter_Contains(Vehicles, vid) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Pojazd o podanym id nie istnieje.");
  2890.                
  2891.                 SetVehiclePos(vid, Vehicle[vid][vehicle_park][0], Vehicle[vid][vehicle_park][1], Vehicle[vid][vehicle_park][2]);
  2892.                 SetVehicleZAngle(vid, Vehicle[vid][vehicle_park][3]);
  2893.                 SetVehicleVirtualWorld(vid, Vehicle[vid][vehicle_park_world]);
  2894.                 LinkVehicleToInterior(vid, Vehicle[vid][vehicle_park_interior]);
  2895.                 Vehicle[vid][vehicle_engine] = false;
  2896.                 Vehicle[vid][vehicle_locked] = true;
  2897.                 UpdateVehicleVisuals(vid);
  2898.                
  2899.                 SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Pojazd %s [UID: %d, ID: %d] powrócił na miejsce spawnu.", VehicleNames[GetVehicleModel(vid)-400], Vehicle[vid][vehicle_uid], vid));
  2900.         }
  2901.         else return SendClientMessage(playerid, COLOR_GREY, "Tip: /(av)ehicle [stworz/usun/model/hp/visual/przypisz/id/zaparkuj/spawn/unspawn/resp/paliwotyp/paliwo/goto/gethere/kolor1/kolor2]");
  2902.         return 1;
  2903. }
  2904.  
  2905. COMMAND:ap(playerid, params[])
  2906. {
  2907.         return cmd_aprzedmiot(playerid, params);
  2908. }
  2909.  
  2910. COMMAND:aprzedmiot(playerid, params[])
  2911. {
  2912.         if( !HasCrewFlag(playerid, CREW_FLAG_ITEMS) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie masz uprawnień do korzystania z tej komendy.");
  2913.        
  2914.         new sub_cmd[40], param[150];
  2915.         if( sscanf(params, "s[40] S()[150]", sub_cmd, param) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ap)rzedmiot [stworz/usun/value1/value2/typ]");
  2916.        
  2917.         if( !strcmp(sub_cmd, "stworz") )
  2918.         {
  2919.                 new type, model, val1, val2, name[40];
  2920.                 if( sscanf(param, "dddd s[40]", type, model, val1, val2, name) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ap)rzedmiot stworz [typ] [model] [value1] [value2] [nazwa]");
  2921.  
  2922.                 if(model == 0)
  2923.                 {
  2924.                         model = 327;
  2925.                 }
  2926.                
  2927.                 Item_Create(ITEM_OWNER_TYPE_PLAYER, playerid, type, model, val1, val2, name);
  2928.                
  2929.                 SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Stworzyłeś przedmiot %s [TYP: %d, MODEL: %d, V1: %d, V2: %d].", name, type, model, val1, val2));
  2930.         }
  2931.         else if( !strcmp(sub_cmd, "usun") )
  2932.         {
  2933.                 new itemuid;
  2934.                 if(     sscanf(param, "d", itemuid) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ap)rzedmiot usun [uid przedmiotu]");
  2935.                
  2936.                 new itemid = GetItemByUid(itemuid, playerid);
  2937.                 if( itemid > -1 )
  2938.                 {
  2939.                         DeleteItem(itemid, true, playerid);
  2940.                         SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Skasowałeś przedmiot o UID: %d.", itemuid));
  2941.                 }
  2942.                 else
  2943.                 {
  2944.                         SendGuiInformation(playerid, "Informacja", "Ten przedmiot nie jest w twoim posiadaniu lub nie istnieje.");
  2945.                 }
  2946.         }
  2947.         else if( !strcmp(sub_cmd, "value1") )
  2948.         {
  2949.                 new itemuid, value1;
  2950.                 if(     sscanf(param, "dd", itemuid, value1) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ap)rzedmiot value1 [uid przedmiotu] [value1]");
  2951.                
  2952.                 new itemid = GetItemByUid(itemuid, playerid);
  2953.                 if( itemid > -1 )
  2954.                 {
  2955.                         PlayerItem[playerid][itemid][player_item_value1] = value1;     
  2956.                         mysql_query(mySQLconnection, sprintf("UPDATE `ipb_items` SET `item_value1` = %d WHERE `item_uid` = %d", value1, itemuid));
  2957.                         SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Zmieniłeś wartość 1 przedmiotu o UID: %d na: %d.", itemuid, value1));
  2958.                 }
  2959.                 else
  2960.                 {
  2961.                         SendGuiInformation(playerid, "Informacja", "Ten przedmiot nie jest w twoim posiadaniu lub nie istnieje.");
  2962.                 }
  2963.         }
  2964.         else if( !strcmp(sub_cmd, "value2") )
  2965.         {
  2966.                 new itemuid, value2;
  2967.                 if(     sscanf(param, "dd", itemuid, value2) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ap)rzedmiot value2 [uid przedmiotu] [value2]");
  2968.                
  2969.                 new itemid = GetItemByUid(itemuid, playerid);
  2970.                 if( itemid > -1 )
  2971.                 {
  2972.                         PlayerItem[playerid][itemid][player_item_value2] = value2;
  2973.                         SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Zmieniłeś wartość 2 przedmiotu o UID: %d na: %d.", itemuid, value2));
  2974.                         mysql_query(mySQLconnection, sprintf("UPDATE `ipb_items` SET `item_value2` = %d WHERE `item_uid` = %d", value2, itemuid));
  2975.                 }
  2976.                 else
  2977.                 {
  2978.                         SendGuiInformation(playerid, "Informacja", "Ten przedmiot nie jest w twoim posiadaniu lub nie istnieje.");
  2979.                 }
  2980.         }
  2981.         else if( !strcmp(sub_cmd, "waga") )
  2982.         {
  2983.                 new itemuid, value2;
  2984.                 if(     sscanf(param, "dd", itemuid, value2) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ap)rzedmiot waga [uid przedmiotu] [waga]");
  2985.                
  2986.                 new itemid = GetItemByUid(itemuid, playerid);
  2987.                 if( itemid > -1 )
  2988.                 {
  2989.                         PlayerItem[playerid][itemid][player_item_weight] = value2;
  2990.                         SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Zmieniłeś wage przedmiotu o UID: %d na: %d.", itemuid, value2));
  2991.                         mysql_query(mySQLconnection, sprintf("UPDATE `ipb_items` SET `item_weight` = %d WHERE `item_uid` = %d", value2, itemuid));
  2992.                 }
  2993.                 else
  2994.                 {
  2995.                         SendGuiInformation(playerid, "Informacja", "Ten przedmiot nie jest w twoim posiadaniu lub nie istnieje.");
  2996.                 }
  2997.         }
  2998.         else if( !strcmp(sub_cmd, "extraid") )
  2999.         {
  3000.                 new itemuid, groupuid;
  3001.                 if(     sscanf(param, "dd", itemuid, groupuid) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ap)rzedmiot extraid [uid przedmiotu] [extraid]");
  3002.                
  3003.                 new itemid = GetItemByUid(itemuid, playerid);
  3004.                 if( itemid > -1 )
  3005.                 {
  3006.                         PlayerItem[playerid][itemid][player_item_extraid] = groupuid;
  3007.                         mysql_query(mySQLconnection, sprintf("UPDATE `ipb_items` SET `item_extraid` = %d WHERE `item_uid` = %d", groupuid, itemuid));
  3008.                         SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Nadano extraid %d dla przedmiotu UID: %d.", groupuid, itemuid));
  3009.                 }
  3010.                 else
  3011.                 {
  3012.                         SendGuiInformation(playerid, "Informacja", "Ten przedmiot nie jest w twoim posiadaniu lub nie istnieje.");
  3013.                 }
  3014.         }
  3015.         else if( !strcmp(sub_cmd, "flaga") )
  3016.         {
  3017.                 new itemuid, groupuid;
  3018.                 if(     sscanf(param, "dd", itemuid, groupuid) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ap)rzedmiot flaga [uid przedmiotu] [uid grupy]");
  3019.                
  3020.                 new itemid = GetItemByUid(itemuid, playerid);
  3021.                 if( itemid > -1 )
  3022.                 {
  3023.                         PlayerItem[playerid][itemid][player_item_group] = groupuid;
  3024.                         mysql_query(mySQLconnection, sprintf("UPDATE `ipb_items` SET `item_group` = %d WHERE `item_uid` = %d", groupuid, itemuid));
  3025.                         SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Oflagowano przedmiot o UID: %d dla grupy %d.", itemuid, groupuid));
  3026.                 }
  3027.                 else
  3028.                 {
  3029.                         SendGuiInformation(playerid, "Informacja", "Ten przedmiot nie jest w twoim posiadaniu lub nie istnieje.");
  3030.                 }
  3031.         }
  3032.         else if( !strcmp(sub_cmd, "typ") )
  3033.         {
  3034.                 new itemuid, typ;
  3035.                 if(     sscanf(param, "dd", itemuid, typ) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ap)rzedmiot typ [uid przedmiotu] [typ]");
  3036.                
  3037.                 new itemid = GetItemByUid(itemuid, playerid);
  3038.                 if( itemid > -1 )
  3039.                 {
  3040.                         PlayerItem[playerid][itemid][player_item_type] = typ;
  3041.                         mysql_query(mySQLconnection, sprintf("UPDATE `ipb_items` SET `item_type` = %d WHERE `item_uid` = %d", typ, itemuid));
  3042.                         SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Zmieniłeś typ przedmiotu o UID: %d na: %d.", itemuid, typ));
  3043.                 }
  3044.                 else
  3045.                 {
  3046.                         SendGuiInformation(playerid, "Informacja", "Ten przedmiot nie jest w twoim posiadaniu lub nie istnieje.");
  3047.                 }
  3048.         }
  3049.         else if( !strcmp(sub_cmd, "model") )
  3050.         {
  3051.                 new itemuid, model;
  3052.                 if(     sscanf(param, "dd", itemuid, model) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ap)rzedmiot model[uid przedmiotu] [typ]");
  3053.                
  3054.                 new itemid = GetItemByUid(itemuid, playerid);
  3055.                 if( itemid > -1 )
  3056.                 {
  3057.                         PlayerItem[playerid][itemid][player_item_model] = model;
  3058.                         mysql_query(mySQLconnection, sprintf("UPDATE `ipb_items` SET `item_model` = %d WHERE `item_uid` = %d", model, itemuid));
  3059.                         SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Zmieniłeś model przedmiotu o UID: %d na: %d.", itemuid, model));
  3060.                 }
  3061.                 else
  3062.                 {
  3063.                         SendGuiInformation(playerid, "Informacja", "Ten przedmiot nie jest w twoim posiadaniu lub nie istnieje.");
  3064.                 }
  3065.         }
  3066.         else if( !strcmp(sub_cmd, "nazwa") )
  3067.         {
  3068.                 new itemuid, itname[40];
  3069.                 if(     sscanf(param, "ds[40]", itemuid, itname) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ap)rzedmiot nazwa [uid przedmiotu] [nowa nazwa]");
  3070.                
  3071.                 new itemid = GetItemByUid(itemuid, playerid);
  3072.                 if( itemid > -1 )
  3073.                 {
  3074.                         sscanf(itname, "s[40]", PlayerItem[playerid][itemid][player_item_name]);
  3075.                         mysql_query(mySQLconnection, sprintf("UPDATE `ipb_items` SET `item_name` = '%s' WHERE `item_uid` = %d", itname, itemuid));
  3076.                         SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Zmieniłeś nazwe przedmiotu o UID: %d na: %s.", itemuid, itname));
  3077.                 }
  3078.                 else
  3079.                 {
  3080.                         SendGuiInformation(playerid, "Informacja", "Ten przedmiot nie jest w twoim posiadaniu lub nie istnieje.");
  3081.                 }
  3082.         }
  3083.         else return SendClientMessage(playerid, COLOR_GREY, "Tip: /(ap)rzedmiot [stworz/usun/value1/value2/typ/lista]");
  3084.        
  3085.         return 1;
  3086. }
  3087.  
  3088. COMMAND:attach(playerid, params[])
  3089. {
  3090.         if( !HasCrewFlag(playerid, CREW_FLAG_ITEMS) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie masz uprawnień do korzystania z tej komendy.");
  3091.        
  3092.         new sub_cmd[40], param[150];
  3093.         if( sscanf(params, "s[40] S()[150]", sub_cmd, param) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /attach [stworz/usun/edytuj/print]");
  3094.        
  3095.         if( !strcmp(sub_cmd, "stworz") )
  3096.         {
  3097.                 new model, bone;
  3098.                 if( sscanf(param, "dd", model, bone) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /attach stworz [model] [bone]");
  3099.                
  3100.                 new freeid = GetPlayerFreeAttachSlot(playerid);
  3101.                 if( freeid == -1 ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie możesz przyczepić już wiecej obiektów.");
  3102.                
  3103.                 SetPlayerAttachedObject(playerid, freeid, model, bone);
  3104.                 SendFormattedClientMessage(playerid, -1, "{ffffff}Utworzyles nowy obiekt przyczepialny [INDEX: %d]. Aby zapisać jego pozycje, zapisz edycje za pomocą ikonky dyskietki.", freeid);
  3105.                
  3106.                 ao[playerid][freeid][ao_model] = model;
  3107.         ao[playerid][freeid][ao_bone] = bone;
  3108.         }
  3109.         else if( !strcmp(sub_cmd, "usun") )
  3110.         {
  3111.                 new index;
  3112.                 if( sscanf(param, "d", index) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /attach usun [index]");
  3113.                 if( !IsPlayerAttachedObjectSlotUsed(playerid, index) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "W tym slocie nie masz żadnego obiektu.");
  3114.                
  3115.                 ao[playerid][index][ao_model] = -1;
  3116.         ao[playerid][index][ao_bone] = -1;
  3117.                 ao[playerid][index][ao_x] = 0.0;
  3118.         ao[playerid][index][ao_y] = 0.0;
  3119.         ao[playerid][index][ao_z] = 0.0;
  3120.         ao[playerid][index][ao_rx] = 0.0;
  3121.         ao[playerid][index][ao_ry] = 0.0;
  3122.         ao[playerid][index][ao_rz] = 0.0;
  3123.         ao[playerid][index][ao_sx] = 0.0;
  3124.         ao[playerid][index][ao_sy] = 0.0;
  3125.         ao[playerid][index][ao_sz] = 0.0;
  3126.                
  3127.                 RemovePlayerAttachedObject(playerid, index);
  3128.                 SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Pomyślnie usunąłeś obiekt przyczepialny");
  3129.         }
  3130.         else if( !strcmp(sub_cmd, "edytuj") )
  3131.         {
  3132.                 new index;
  3133.                 if( sscanf(param, "d", index) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /attach edytuj [index]");
  3134.                 if( !IsPlayerAttachedObjectSlotUsed(playerid, index) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "W tym slocie nie masz żadnego obiektu.");
  3135.                
  3136.                 EditAttachedObject(playerid, index);
  3137.         }
  3138.         else if( !strcmp(sub_cmd, "print") )
  3139.         {
  3140.                 new index;
  3141.                 if( sscanf(param, "d", index) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /attach print [index]");
  3142.                 if( !IsPlayerAttachedObjectSlotUsed(playerid, index) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "W tym slocie nie masz żadnego obiektu.");
  3143.                
  3144.                 printf("[model %d, bone: %d] %f, %f, %f, %f, %f, %f, %f, %f, %f", ao[playerid][index][ao_model], ao[playerid][index][ao_bone], ao[playerid][index][ao_x], ao[playerid][index][ao_y], ao[playerid][index][ao_z], ao[playerid][index][ao_rx], ao[playerid][index][ao_ry], ao[playerid][index][ao_rz], ao[playerid][index][ao_sx], ao[playerid][index][ao_sy], ao[playerid][index][ao_sz]);
  3145.         }
  3146.         return 1;
  3147. }
  3148.  
  3149. COMMAND:aplace(playerid, params[])
  3150. {
  3151.         if( !HasCrewFlag(playerid, CREW_FLAG_DOORS) ) return SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Nie masz uprawnień do korzystania z tej komendy.");
  3152.        
  3153.         new sub_cmd[40], param[150];
  3154.         if( sscanf(params, "s[40] S()[150]", sub_cmd, param) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /aplace [stworz/usun]");
  3155.        
  3156.         if( !strcmp(sub_cmd, "stworz") )
  3157.         {
  3158.                 new type, Float:sx, Float:sy, Float:sz;
  3159.                 if( sscanf(param, "d", type) )
  3160.                 {
  3161.                         TextDrawSetString(Tutorial[playerid], "~w~Typy ~p~miejsc~w~:~n~~n~1. Bank~n~2. Hotel~n~3. Sklep 24/7~n~4. Victim~n~5. Apteka~n~6. Salon aut~n~7. Ammunation~n~8.Toolshop~n~Klawisz ~g~N~w~ zamyka to okno.");
  3162.                         TextDrawShowForPlayer(playerid, Tutorial[playerid]);
  3163.                         SendClientMessage(playerid, COLOR_GREY, "Tip: /aplace stworz [typ]");
  3164.                         return 1;
  3165.                 }
  3166.                 new svw = GetPlayerVirtualWorld(playerid);
  3167.                 GetPlayerPos(playerid, sx, sy, sz);
  3168.                
  3169.                 new puid = CreateSpecialPlace(type, Float:sx, Float:sy, Float:sz, svw);
  3170.                 SendGuiInformation(playerid, ""guiopis"Powiadomienie", sprintf("Miejsce UID: %d, typ: %d zostało pomyślnie utworzone.", puid, type));
  3171.         }
  3172.         else if( !strcmp(sub_cmd, "usun") )
  3173.         {
  3174.                 new index;
  3175.                 if( sscanf(param, "d", index) ) return SendClientMessage(playerid, COLOR_GREY, "Tip: /aplace usun [uid]");
  3176.                 SendGuiInformation(playerid, ""guiopis"Powiadomienie", "Pomyślnie usunąłeś to miejsce.");
  3177.                 new ib = GetPlaceByUid(index);
  3178.                 if(ib != -1) Iter_Remove(Places, ib);
  3179.                 DeleteSpecialPlace(index);
  3180.         }
  3181.         return 1;
  3182. }
  3183.