Guest User

Untitled

a guest
Jun 25th, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.76 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. #define FILTERSCRIPT
  4.  
  5. #include <zcmd>
  6. #include <sscanf2>
  7.  
  8. // Definicje kolorów
  9. #define C_RED 0xFF0000FF
  10. #define C_GREEN 0x00FF00FF
  11. #define C_GREY 0xAFAFAFAA
  12. #define C_LINK 0x00D2D2FF
  13.  
  14. // Zmienne globalne
  15. new PlayerText3D:vehOPIS[MAX_PLAYERS];
  16.  
  17. public OnFilterScriptInit()
  18. {
  19.     print("\n--------------------------------------");
  20.     print(" Opis pojazdu by Poganin.");
  21.     print("--------------------------------------\n");
  22.     return 1;
  23. }
  24.  
  25. public OnFilterScriptExit()
  26. {
  27.     return 1;
  28. }
  29.  
  30. CMD:aopis(playerid, params[])
  31. {
  32.     new aopis[512], vehID, message[512];
  33.  
  34.     if(!IsPlayerInAnyVehicle(playerid))
  35.     {
  36.         SendClientMessage(playerid, C_GREY, "Nie jesteś w żadnym pojeździe.");
  37.         return 1;
  38.     } else if(sscanf(params, "s[512]", aopis))
  39.     {
  40.         SendClientMessage(playerid, C_GREY, "Wpisz: /aopis [OPIS POJAZDU]");
  41.         return 1;
  42.     } else if(strfind("usun", aopis) == 0)
  43.     {
  44.         for(new x=0; x<MAX_PLAYERS; x++)
  45.         {
  46.             DeletePlayer3DTextLabel(x, PlayerText3D:vehOPIS[playerid]);
  47.         }
  48.         SendClientMessage(playerid, C_GREY, "Usunąłeś opis swojego pojazdu.");
  49.         return 1;
  50.     } else
  51.     {
  52.         vehID = GetPlayerVehicleID(playerid);
  53.         format(message, sizeof(message), "Aktualny opis pojazdu: %s", aopis);
  54.         SendClientMessage(playerid, C_GREY, message);
  55.         for(new i=25; i<strlen(aopis); i+=25)
  56.         {
  57.             strins(aopis, "\n", i);
  58.         }
  59.         for(new z=0; z<MAX_PLAYERS; z++)
  60.         {
  61.             DeletePlayer3DTextLabel(z, vehOPIS[playerid]);
  62.             vehOPIS[playerid] = CreatePlayer3DTextLabel(z, aopis, C_LINK, 0, 0, 0, 40.0, INVALID_PLAYER_ID, vehID, 0);
  63.             DeletePlayer3DTextLabel(playerid, vehOPIS[playerid]);
  64.         }
  65.     }
  66.     return 1;
  67. }
Add Comment
Please, Sign In to add comment