• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] Help me
#2
Bug 
Sou novo no Open.MP e no Qawno, estou querendo fazer um servidor de fugas e pvp. Testei um sistema de criar motos bem básico, mas não estou tendo resultado na criação da moto, o sistema funciona com base no comando: /moto (utilizei a include do zcmd), esse comando abre uma dialog que é possivel escolher uma moto, mas não cria a moto. Alguem pode me ajuda? Meu Código(coloqueias partes principais):

Code:
#include <open.mp> #include <a_samp> #include <zcmd> new Float:PlayerX; new Float:PlayerY; new Float:PlayerZ; public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {     if(dialogid == ESCOLHER_MOTOS)     {         if(response)         {             switch(listitem)             {                 case 0:                 {                     // Obtém a posição e o ângulo do jogador                     GetPlayerPos(playerid, PlayerX, PlayerY, PlayerZ);                     new Float:PlayerAngle;                     GetPlayerFacingAngle(playerid, PlayerAngle);                                         // Calcula a nova posição na frente do jogador                     new Float:OffsetX, Float:OffsetY, Float:OffsetZ = 1.0; // Um pouco acima                     OffsetX = PlayerX + (3.0 * floatsin(-PlayerAngle, degrees)); // 3 unidades na frente                     OffsetY = PlayerY + (3.0 * floatcos(-PlayerAngle, degrees)); // 3 unidades na frente                     // Envia uma mensagem ao jogador com as novas coordenadas                     new str[128];                     format(str, sizeof(str), "Nova posição para criar a moto: X: %f, Y: %f, Z: %f", OffsetX, OffsetY, PlayerZ + OffsetZ);                     SendClientMessage(playerid, -1, str);                     // Cria o veículo na nova posição                     new vehicleid = AddStaticVehicleEx(522, OffsetX, OffsetY, PlayerZ + OffsetZ, PlayerAngle, -1, -1, 1000, false);                                         // Verifica se o veículo foi criado com sucesso                     if(vehicleid == INVALID_VEHICLE_ID)                     {                         SendClientMessage(playerid, -1, "Falha ao criar a moto.");                     }                     else                     {                         SendClientMessage(playerid, -1, "Moto NRG-500 criada com sucesso.");                     }                 }             }         }     }     return 1; } CMD:moto(playerid) { ShowPlayerDialog(playerid, 876, DIALOG_STYLE_LIST, "Motos", "NRG-500", "Selecionar", "Cancelar"); return 1; }
  Reply


Messages In This Thread
Help me - by tuankhanqsamp - 2024-08-21, 09:36 AM
RE: Help me - by contatofelipeojustin - 2024-08-25, 02:21 PM