[AJUDA] Comando carro nгo funciona !
#1

Olha pessoal, eu fiz meu prуprio comando carros, mais quando vou spawnar ele nгo spawna, aqui o cуdigo e me fala o que eu errei:

pawn Код:
#include <a_samp>

#define FILTERSCRIPT
#define DIALOGID 5000

main()
{
        print("-----------------------");
        print("-------Filter Script----");
        print("------Spawn de Carros--");
        print("--------By: RaRi-----");
        print("-----------------------");
        return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
   if(strcmp("/Carros", cmdtext, true, 10) == 0)
         {
          ShowPlayerDialog(playerid, DIALOGID+5, DIALOG_STYLE_LIST, ".:: DrF - Carros ::.", "~>Elegy\n~>Sultan\n~>Jester\n~>Police [LS]\n~>Police [LV]\n~>Police [SF]\n~>Nrg500\n~>Blade\n~>Bullet\n~>Stretch\n~>Infernus\n~>Tropic\n~>Police Maverick\n~>Shamal\n~>S.W.A.T.\n~>Monster A\n~>Monster B", "Spawnar", "sair");
          }
  }
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
   if(dialogid == DIALOGID) // Carros
        {
          if(response)
           {
          if(listitem == 0)//Elegy
                {
            if(IsPlayerInAnyVehicle(playerid))
         {
             return SendClientMessage(playerid, 0x33AA33AA, ".::[INFO]Voce ja esta em um veiculo");
              }
                new Float:pos0 = 0, Float:pos1 = 0, Float:pos2 = 0, Float:pos3 = 0;
                GetPlayerPos(playerid, pos0, pos1, pos2);
                GetPlayerFacingAngle(playerid, pos3);
                CreateVehicle(562, pos0 + 1, pos1 + 1, pos2, pos3, 1, 1, 10000);
                }
          if(listitem == 1)//Sultan
                {
          if(IsPlayerInAnyVehicle(playerid))
         {
             return SendClientMessage(playerid, 0x33AA33AA, ".::[INFO] Voce ja esta em um veiculo");
              }
                  new Float:pos0 = 0, Float:pos1 = 0, Float:pos2 = 0, Float:pos3 = 0;
              GetPlayerPos(playerid, pos0, pos1, pos2);
                  GetPlayerFacingAngle(playerid, pos3);
                  CreateVehicle(560, pos0 + 1, pos1 + 1, pos2, pos3, 1, 1, 10000);
                }
      if(listitem == 2)//Jester
                {
          if(IsPlayerInAnyVehicle(playerid))
         {
             return SendClientMessage(playerid, 0x33AA33AA, ".::[INFO] Voce ja esta em um veiculo");
              }
                  new Float:pos0 = 0, Float:pos1 = 0, Float:pos2 = 0, Float:pos3 = 0;
                  GetPlayerPos(playerid, pos0, pos1, pos2);
                  GetPlayerFacingAngle(playerid, pos3);
                  CreateVehicle(559, pos0 + 1, pos1 + 1, pos2, pos3, 1, 1, 10000);
                }
          if(listitem == 3)//Police LS
                {
          if(IsPlayerInAnyVehicle(playerid))
         {
             return SendClientMessage(playerid, 0x33AA33AA, ".::[INFO] Voce ja esta em um veiculo");
              }
                  new Float:pos0 = 0, Float:pos1 = 0, Float:pos2 = 0, Float:pos3 = 0;
                  GetPlayerPos(playerid, pos0, pos1, pos2);
                  GetPlayerFacingAngle(playerid, pos3);
                  CreateVehicle(596, pos0 + 1, pos1 + 1, pos2, pos3, 1, 1, 10000);
                }
      if(listitem == 4)//Police LV
                {
        if(IsPlayerInAnyVehicle(playerid))
         {
             return SendClientMessage(playerid, 0x33AA33AA, ".::[INFO] Voce ja esta em um veiculo");
              }
        new Float:pos0 = 0, Float:pos1 = 0, Float:pos2 = 0, Float:pos3 = 0;
        GetPlayerPos(playerid, pos0, pos1, pos2);
        GetPlayerFacingAngle(playerid, pos3);
        CreateVehicle(598, pos0 + 1, pos1 + 1, pos2, pos3, 1, 1, 10000);
                }
          if(listitem == 5)//Police SF
                {
        if(IsPlayerInAnyVehicle(playerid))
         {
             return SendClientMessage(playerid, 0x33AA33AA, ".::[INFO] Voce ja esta em um veiculo");
              }
                new Float:pos0 = 0, Float:pos1 = 0, Float:pos2 = 0, Float:pos3 = 0;
                GetPlayerPos(playerid, pos0, pos1, pos2);
                GetPlayerFacingAngle(playerid, pos3);
                CreateVehicle(597, pos0 + 1, pos1 + 1, pos2, pos3, 1, 1, 10000);
                }
          if(listitem == 6)//Nrg 500
                {
        if(IsPlayerInAnyVehicle(playerid))
         {
             return SendClientMessage(playerid, 0x33AA33AA, "Voce ja esta em um veiculo");
              }
                new Float:pos0 = 0, Float:pos1 = 0, Float:pos2 = 0, Float:pos3 = 0;
                GetPlayerPos(playerid, pos0, pos1, pos2);
                GetPlayerFacingAngle(playerid, pos3);
                CreateVehicle(522, pos0 + 1, pos1 + 1, pos2, pos3, 1, 1, 10000);
                }
      if(listitem == 7)//Blade
                {
        if(IsPlayerInAnyVehicle(playerid))
         {
             return SendClientMessage(playerid, 0x33AA33AA, ".::[INFO] Voce ja esta em um veiculo");
              }
                new Float:pos0 = 0, Float:pos1 = 0, Float:pos2 = 0, Float:pos3 = 0;
                GetPlayerPos(playerid, pos0, pos1, pos2);
                GetPlayerFacingAngle(playerid, pos3);
                CreateVehicle(536, pos0 + 1, pos1 + 1, pos2, pos3, 1, 1, 10000);
                }
      if(listitem == 8)//Bullet
                {
        if(IsPlayerInAnyVehicle(playerid))
         {
             return SendClientMessage(playerid, 0x33AA33AA, ".::[INFO] Voce ja esta em um veiculo");
              }
                new Float:pos0 = 0, Float:pos1 = 0, Float:pos2 = 0, Float:pos3 = 0;
                GetPlayerPos(playerid, pos0, pos1, pos2);
                GetPlayerFacingAngle(playerid, pos3);
                CreateVehicle(541, pos0 + 1, pos1 + 1, pos2, pos3, 1, 1, 10000);
                }
          if(listitem == 9)//Stretch
                {
        if(IsPlayerInAnyVehicle(playerid))
         {
             return SendClientMessage(playerid, 0x33AA33AA, ".::[INFO] Voce ja esta em um veiculo");
              }
                new Float:pos0 = 0, Float:pos1 = 0, Float:pos2 = 0, Float:pos3 = 0;
                GetPlayerPos(playerid, pos0, pos1, pos2);
                GetPlayerFacingAngle(playerid, pos3);
                CreateVehicle(409, pos0 + 1, pos1 + 1, pos2, pos3, 1, 1, 10000);
                }
      if(listitem == 10)//Infernus
           {
        if(IsPlayerInAnyVehicle(playerid))
         {
             return SendClientMessage(playerid, 0x33AA33AA, ".::[INFO] Voce ja esta em um veiculo");
              }
                new Float:pos0 = 0, Float:pos1 = 0, Float:pos2 = 0, Float:pos3 = 0;
                GetPlayerPos(playerid, pos0, pos1, pos2);
                GetPlayerFacingAngle(playerid, pos3);
                CreateVehicle(411, pos0 + 1, pos1 + 1, pos2, pos3, 1, 1, 10000);
                }
      if(listitem == 11)//Tropic
                {
        if(IsPlayerInAnyVehicle(playerid))
         {
             return SendClientMessage(playerid, 0x33AA33AA, ".::[INFO] Voce ja esta em um veiculo");
              }
                new Float:pos0 = 0, Float:pos1 = 0, Float:pos2 = 0, Float:pos3 = 0;
                GetPlayerPos(playerid, pos0, pos1, pos2);
                GetPlayerFacingAngle(playerid, pos3);
                CreateVehicle(454, pos0 + 1, pos1 + 1, pos2, pos3, 1, 1, 10000);
                }
      if(listitem == 12)//Police Maverick
                {
        if(IsPlayerInAnyVehicle(playerid))
         {
             return SendClientMessage(playerid, 0x33AA33AA, ".::[INFO] Voce ja esta em um veiculo");
              }
                new Float:pos0 = 0, Float:pos1 = 0, Float:pos2 = 0, Float:pos3 = 0;
                GetPlayerPos(playerid, pos0, pos1, pos2);
                GetPlayerFacingAngle(playerid, pos3);
                CreateVehicle(497, pos0 + 1, pos1 + 1, pos2, pos3, 1, 1, 10000);
                }
                if(listitem == 13)//Shamal
                {
        if(IsPlayerInAnyVehicle(playerid))
         {
             return SendClientMessage(playerid, 0x33AA33AA, ".::[INFO] Voce ja esta em um veiculo");
              }
                new Float:pos0 = 0, Float:pos1 = 0, Float:pos2 = 0, Float:pos3 = 0;
                GetPlayerPos(playerid, pos0, pos1, pos2);
                GetPlayerFacingAngle(playerid, pos3);
                CreateVehicle(519, pos0 + 1, pos1 + 1, pos2, pos3, 1, 1, 10000);
                }
                if(listitem == 14)//S.W.A.T.
                {
        if(IsPlayerInAnyVehicle(playerid))
         {
             return SendClientMessage(playerid, 0x33AA33AA, ".::[INFO] Voce ja esta em um veiculo");
              }
                new Float:pos0 = 0, Float:pos1 = 0, Float:pos2 = 0, Float:pos3 = 0;
                GetPlayerPos(playerid, pos0, pos1, pos2);
                GetPlayerFacingAngle(playerid, pos3);
                CreateVehicle(601, pos0 + 1, pos1 + 1, pos2, pos3, 1, 1, 10000);
                }
                if(listitem == 15)//Monster A
                {
        if(IsPlayerInAnyVehicle(playerid))
         {
             return SendClientMessage(playerid, 0x33AA33AA, ".::[INFO] Voce ja esta em um veiculo");
              }
                new Float:pos0 = 0, Float:pos1 = 0, Float:pos2 = 0, Float:pos3 = 0;
                GetPlayerPos(playerid, pos0, pos1, pos2);
                GetPlayerFacingAngle(playerid, pos3);
                CreateVehicle(556, pos0 + 1, pos1 + 1, pos2, pos3, 1, 1, 10000);
                }
                if(listitem == 16)//Monster B
                {
        if(IsPlayerInAnyVehicle(playerid))
         {
             return SendClientMessage(playerid, 0x33AA33AA, ".::[INFO] Voce ja esta em um veiculo");
              }
                new Float:pos0 = 0, Float:pos1 = 0, Float:pos2 = 0, Float:pos3 = 0;
                GetPlayerPos(playerid, pos0, pos1, pos2);
                GetPlayerFacingAngle(playerid, pos3);
                CreateVehicle(557, pos0 + 1, pos1 + 1, pos2, pos3, 1, 1, 10000);
                }
                }
                else{
                if(response == 2)
                {
                 return 1;
            }
                }
                }
   return 1;
  }
Ou vocк pode baixar e me passar por pm
Reply
#2

Qualquer coisa manda seu MSN por MP.
Reply
#3

Ja mandei a mensagem por pm !
Reply
#4

Se quiser fazer o download do FS pronto ta aqui: By: Eu

Pawno e AMX:
http://www.4shared.com/file/67NAX0Cd/Carro.html
http://www.4shared.com/file/L2mfaEhx/Carro.html


No topo do GM:
pawn Код:
new CarrosPs[MAX_PLAYERS];
OnPlayerCommandText:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/carros", true) == 0)
{
ShowPlayerDialog(playerid,158,DIALOG_STYLE_LIST,"Pegar carros","\n~>Elegy\n~>Sultan\n~>Jester\n~>Police [LS]\n~>Police [LV]\n~>Police [SF]\n~>Nrg500\n~>Blade\n~>Bullet\n~>Stretch\n~>Infernus\n~>Tropic\n~>Police Maverick\n~>Shamal\n~>S.W.A.T.\n~>Monster A\n~>Monster B","Spawnar","Sair");
return 1;
}
return 0;
}

OnDialogResponse:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 158)
{
if(response)
{
if(listitem == 0)
{
if(CarrosPs[playerid] != INVALID_VEHICLE_ID)
DestroyVehicle(CarrosPs[playerid]);
new Float:X,Float:Y,Float:Z,Float:Angle;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
GetPlayerVehicleID(playerid);
CarrosPs[playerid] = CreateVehicle(562,X,Y,Z,Angle,-1,-1,600);
PutPlayerInVehicle(playerid, CarrosPs[playerid], 0);
}
}
if(listitem == 1)
{
if(CarrosPs[playerid] != INVALID_VEHICLE_ID)
DestroyVehicle(CarrosPs[playerid]);
new Float:X,Float:Y,Float:Z,Float:Angle;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
GetPlayerVehicleID(playerid);
CarrosPs[playerid] = CreateVehicle(560,X,Y,Z,Angle,-1,-1,600);
PutPlayerInVehicle(playerid, CarrosPs[playerid], 0);
}
}
if(listitem == 2)
{
if(CarrosPs[playerid] != INVALID_VEHICLE_ID)
DestroyVehicle(CarrosPs[playerid]);
new Float:X,Float:Y,Float:Z,Float:Angle;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
GetPlayerVehicleID(playerid);
CarrosPs[playerid] = CreateVehicle(559,X,Y,Z,Angle,-1,-1,600);
PutPlayerInVehicle(playerid, CarrosPs[playerid], 0);
}
if(listitem == 3)
{
if(CarrosPs[playerid] != INVALID_VEHICLE_ID)
DestroyVehicle(CarrosPs[playerid]);
new Float:X,Float:Y,Float:Z,Float:Angle;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
GetPlayerVehicleID(playerid);
CarrosPs[playerid] = CreateVehicle(596,X,Y,Z,Angle,-1,-1,600);
PutPlayerInVehicle(playerid, CarrosPs[playerid], 0);
}
if(listitem == 4)
{
if(CarrosPs[playerid] != INVALID_VEHICLE_ID)
DestroyVehicle(CarrosPs[playerid]);
new Float:X,Float:Y,Float:Z,Float:Angle;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
GetPlayerVehicleID(playerid);
CarrosPs[playerid] = CreateVehicle(598,X,Y,Z,Angle,-1,-1,600);
PutPlayerInVehicle(playerid, CarrosPs[playerid], 0);
}
if(listitem == 5)
{
if(CarrosPs[playerid] != INVALID_VEHICLE_ID)
DestroyVehicle(CarrosPs[playerid]);
new Float:X,Float:Y,Float:Z,Float:Angle;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
GetPlayerVehicleID(playerid);
CarrosPs[playerid] = CreateVehicle(597,X,Y,Z,Angle,-1,-1,600);
PutPlayerInVehicle(playerid, CarrosPs[playerid], 0);
}
if(listitem == 6)
{
if(CarrosPs[playerid] != INVALID_VEHICLE_ID)
DestroyVehicle(CarrosPs[playerid]);
new Float:X,Float:Y,Float:Z,Float:Angle;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
GetPlayerVehicleID(playerid);
CarrosPs[playerid] = CreateVehicle(522,X,Y,Z,Angle,-1,-1,600);
PutPlayerInVehicle(playerid, CarrosPs[playerid], 0);
}
if(listitem == 7)
{
if(CarrosPs[playerid] != INVALID_VEHICLE_ID)
DestroyVehicle(CarrosPs[playerid]);
new Float:X,Float:Y,Float:Z,Float:Angle;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
GetPlayerVehicleID(playerid);
CarrosPs[playerid] = CreateVehicle( 536,X,Y,Z,Angle,-1,-1,600);
PutPlayerInVehicle(playerid, CarrosPs[playerid], 0);
}
if(listitem == 8)
{
if(CarrosPs[playerid] != INVALID_VEHICLE_ID)
DestroyVehicle(CarrosPs[playerid]);
new Float:X,Float:Y,Float:Z,Float:Angle;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
GetPlayerVehicleID(playerid);
CarrosPs[playerid] = CreateVehicle( 409,X,Y,Z,Angle,-1,-1,600);
PutPlayerInVehicle(playerid, CarrosPs[playerid], 0);
}
if(listitem == 9)
{
if(CarrosPs[playerid] != INVALID_VEHICLE_ID)
DestroyVehicle(CarrosPs[playerid]);
new Float:X,Float:Y,Float:Z,Float:Angle;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
GetPlayerVehicleID(playerid);
CarrosPs[playerid] = CreateVehicle( 541,X,Y,Z,Angle,-1,-1,600);
PutPlayerInVehicle(playerid, CarrosPs[playerid], 0);
}
if(listitem == 10)
{
if(CarrosPs[playerid] != INVALID_VEHICLE_ID)
DestroyVehicle(CarrosPs[playerid]);
new Float:X,Float:Y,Float:Z,Float:Angle;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
GetPlayerVehicleID(playerid);
CarrosPs[playerid] = CreateVehicle( 411,X,Y,Z,Angle,-1,-1,600);
PutPlayerInVehicle(playerid, CarrosPs[playerid], 0);
}
if(listitem == 11)
{
if(CarrosPs[playerid] != INVALID_VEHICLE_ID)
DestroyVehicle(CarrosPs[playerid]);
new Float:X,Float:Y,Float:Z,Float:Angle;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
GetPlayerVehicleID(playerid);
CarrosPs[playerid] = CreateVehicle( 554,X,Y,Z,Angle,-1,-1,600);
PutPlayerInVehicle(playerid, CarrosPs[playerid], 0);
}
if(listitem == 12)
{
if(CarrosPs[playerid] != INVALID_VEHICLE_ID)
DestroyVehicle(CarrosPs[playerid]);
new Float:X,Float:Y,Float:Z,Float:Angle;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
GetPlayerVehicleID(playerid);
CarrosPs[playerid] = CreateVehicle( 497,X,Y,Z,Angle,-1,-1,600);
PutPlayerInVehicle(playerid, CarrosPs[playerid], 0);
}
if(listitem == 13)
{
if(CarrosPs[playerid] != INVALID_VEHICLE_ID)
DestroyVehicle(CarrosPs[playerid]);
new Float:X,Float:Y,Float:Z,Float:Angle;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
GetPlayerVehicleID(playerid);
CarrosPs[playerid] = CreateVehicle( 519,X,Y,Z,Angle,-1,-1,600);
PutPlayerInVehicle(playerid, CarrosPs[playerid], 0);
}
if(listitem == 14)
{
if(CarrosPs[playerid] != INVALID_VEHICLE_ID)
DestroyVehicle(CarrosPs[playerid]);
new Float:X,Float:Y,Float:Z,Float:Angle;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
GetPlayerVehicleID(playerid);
CarrosPs[playerid] = CreateVehicle( 601,X,Y,Z,Angle,-1,-1,600);
PutPlayerInVehicle(playerid, CarrosPs[playerid], 0);
}
if(listitem == 15)
{
if(CarrosPs[playerid] != INVALID_VEHICLE_ID)
DestroyVehicle(CarrosPs[playerid]);
new Float:X,Float:Y,Float:Z,Float:Angle;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
GetPlayerVehicleID(playerid);
CarrosPs[playerid] = CreateVehicle( 556,X,Y,Z,Angle,-1,-1,600);
PutPlayerInVehicle(playerid, CarrosPs[playerid], 0);
}
if(listitem == 16)
{
if(CarrosPs[playerid] != INVALID_VEHICLE_ID)
DestroyVehicle(CarrosPs[playerid]);
new Float:X,Float:Y,Float:Z,Float:Angle;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
GetPlayerVehicleID(playerid);
CarrosPs[playerid] = CreateVehicle( 557,X,Y,Z,Angle,-1,-1,600);
PutPlayerInVehicle(playerid, CarrosPs[playerid], 0);
}
return 1;
}

Espero ter ajudado.
Reply
#5

Vlw me ajudo mesmo
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)