Advertisement
Kuddy

[SA-MP] KZODB - KomanZ Object Debug

Jul 9th, 2012
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.99 KB | None | 0 0
  1. // Use isto como um GAMEMODE
  2. // Criado por Kuddy
  3. #include <a_samp>
  4.  
  5. new
  6.     OBDATAM[1000],
  7.     Float:OBDATAX[1000],
  8.     Float:OBDATAY[1000],
  9.     Float:OBDATAZ[1000],
  10.     Float:OBDATARX[1000],
  11.     Float:OBDATARY[1000],
  12.     Float:OBDATARZ[1000];
  13.  
  14. #define DIALOG_WELCOME 1
  15.  
  16. new CreatedObjects, Current;
  17.  
  18. main()
  19. {
  20.     for(new i; i < 5; i++) print(" ");
  21.     print("                SA-MP Object Debug coded by KomanZ Team");
  22.     print("                Version:                     0.1.2 BETA");
  23.     print("                Contact info:         [email protected]");
  24.     for(new i; i < 5; i++) print(" ");
  25. }
  26. /*
  27. native DebugObject(Object_ID, Float:X, Float:Y, Float:Z, Float:RotX, Float:RotY, Float:RotZ);
  28. */
  29.  
  30. public OnGameModeInit()
  31. {
  32.     SetGameModeText("Kz Object Debug"); // You have not permission to change this
  33.     AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  34.  
  35.     // TESTE DE MAPAS
  36.     // Coloque os objetos em DebugObject abaixo, como no exemplo:
  37.     DebugObject(13099,3481.50000000,417.29998779,2000.00000000,0.00000000,0.00000000,0.00000000); //object(ce_groundpalo06) (1)
  38.     DebugObject(13099,3440.69995117,452.29998779,2000.00000000,0.00000000,0.00000000,336.00000000); //object(ce_groundpalo06) (4)
  39.     DebugObject(13099,3449.09960938,445.39941406,1995.00000000,0.00000000,0.00000000,313.99475098); //object(ce_groundpalo06) (5)
  40.     // Apague os objetos acima para um resultado preciso
  41.  
  42.  
  43.     return 1;
  44. }
  45.  
  46. new DBC;
  47. stock DebugObject(OBM, Float:OBX, Float:OBY, Float:OBZ,Float:OBRX,Float:OBRY,Float:OBRZ)
  48. {
  49.     OBDATAM[DBC] = OBM;
  50.     OBDATAX[DBC] = OBX;
  51.     OBDATAY[DBC] = OBY;
  52.     OBDATAZ[DBC] = OBZ;
  53.     OBDATARX[DBC] = OBRX;
  54.     OBDATARY[DBC] = OBRY;
  55.     OBDATARZ[DBC] = OBRZ;
  56.     DBC ++;
  57.     return 1;
  58. }
  59.  
  60.  
  61. new OBID;
  62. stock CarregarObjetos(playerid)
  63. {
  64.     //CreatePlayerObject(playerid, OBDATAM[playerid], OBDATAX[playerid],OBDATAY[playerid],OBDATAZ[playerid],OBDATARX[playerid],OBDATRY[playerid],OBDATRZ[playerid]);
  65.     for(new DestroyCount; DestroyCount < Current; DestroyCount ++)
  66.     {
  67.         DestroyPlayerObject(playerid, DestroyCount);
  68.     }
  69.     for(new CreateCount; CreateCount < Current; CreateCount ++)
  70.     {
  71.         CreatePlayerObject(playerid, OBDATAM[CreateCount], OBDATAX[CreateCount],OBDATAY[CreateCount],OBDATAZ[CreateCount],
  72.             OBDATARX[CreateCount],OBDATARY[CreateCount],OBDATARZ[CreateCount]);
  73.         CreatedObjects ++;
  74.     }
  75.     OBID = Current;
  76.     Current = CreatedObjects + 1;
  77.     CreatedObjects = 0;
  78.  
  79.     new string[248];
  80.     format(string,sizeof(string),"DebugObject(%d, %f, %f, %f, %f, %f, %f);",
  81.         OBDATAM[OBID], OBDATAX[OBID], OBDATAY[OBID], OBDATAZ[OBID], OBDATARX[OBID], OBDATARY[OBID], OBDATARZ[OBID]);
  82.  
  83.     ShowPlayerDialog(playerid, DIALOG_WELCOME, DIALOG_STYLE_MSGBOX, "Kz Debug", string, "Avançar", "Fechar");
  84.  
  85.     return 1;
  86. }
  87.  
  88. public OnPlayerDisconnect(playerid, reason)
  89. {
  90.     new string[248];
  91.     format(string,sizeof(string),"DebugObject(%d, %f, %f, %f, %f, %f, %f);",
  92.         OBDATAM[OBID], OBDATAX[OBID], OBDATAY[OBID], OBDATAZ[OBID], OBDATARX[OBID], OBDATARY[OBID], OBDATARZ[OBID]);
  93.     print(string);
  94.     return 1;
  95. }
  96.  
  97. public OnGameModeExit()
  98. {
  99.     return 1;
  100. }
  101.  
  102. public OnPlayerRequestClass(playerid, classid)
  103. {
  104.     SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  105.     SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  106.     SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  107.     return 1;
  108. }
  109.  
  110. public OnPlayerCommandText(playerid, cmdtext[])
  111. {
  112.     if (strcmp("/comecar", cmdtext, true, 10) == 0)
  113.     {
  114.         CarregarObjetos(playerid);
  115.         return 1;
  116.     }
  117.     return 0;
  118. }
  119.  
  120. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  121. {
  122.     if(dialogid == DIALOG_WELCOME)
  123.     {
  124.         if(!response) return 1;
  125.         CarregarObjetos(playerid);
  126.     }
  127.     return 1;
  128. }
  129.  
  130. // Criado por Kuddy
  131. // Acesse:   http://forum.sa-mp.com/member.php?u=129339  // Minha conta no forum do SA-MP
  132. //           Youtube.com/KuddyTV                         // Meu canal no youtube
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement