Whats wrong with this command?
#1

The title.

pawn Код:
command(undercover, playerid, params[])
{
 if(Groups[Player[playerid][Group]][CommandTypes] == 1)
 {
   if(IsPlayerInAnyVehicle);
   {
   SetPVarInt(playerid, "coplight0", CreateObject(18646,0,0,0,0,0,0));
   SetPVarInt(playerid, "coplight1", CreateObject(18646,0,0,0,0,0,0));
   AttachObjectToVehicle(GetPVarInt(playerid, "coplight0"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
   AttachObjectToVehicle(GetPVarInt(playerid, "coplight1"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
   }
   else
   {
   SendClientMessage(playerid,RED,"You need to be inside a car to use this. Preferrably the Elegent");
  }
  else
  {
  SendClientMessage(playerid,RED,"You must be in the LSPD to use this.");
  }
 }
 return 1;
}
Reply
#2

if(IsPlayerInAnyVehicle(playerid))
Reply
#3

Quote:
Originally Posted by farris
Посмотреть сообщение
if(IsPlayerInAnyVehicle(playerid))
And missing/miss-placed brackets..

pawn Код:
command(undercover, playerid, params[])
{
    if(Groups[Player[playerid][Group]][CommandTypes] == 1)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            SetPVarInt(playerid, "coplight0", CreateObject(18646,0,0,0,0,0,0));
            SetPVarInt(playerid, "coplight1", CreateObject(18646,0,0,0,0,0,0));
            AttachObjectToVehicle(GetPVarInt(playerid, "coplight0"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
            AttachObjectToVehicle(GetPVarInt(playerid, "coplight1"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
        }
        else
        {
            SendClientMessage(playerid,RED,"You need to be inside a car to use this. Preferrably the Elegent");
        }
    }  
    else
    {
        SendClientMessage(playerid,RED,"You must be in the LSPD to use this.");
    }
    return 1;
}
Reply
#4

pawn Код:
command(undercover, playerid, params[])
{
    if(Groups[Player[playerid][Group]][CommandTypes] == 1)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            SetPVarInt(playerid, "coplight0", CreateObject(18646,0,0,0,0,0,0));
            SetPVarInt(playerid, "coplight1", CreateObject(18646,0,0,0,0,0,0));
            AttachObjectToVehicle(GetPVarInt(playerid, "coplight0"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
            AttachObjectToVehicle(GetPVarInt(playerid, "coplight1"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
        }
        else
        {
            SendClientMessage(playerid,RED,"You need to be inside a car to use this. Preferrably the Elegent");
        }
    }  
    else
    {
        SendClientMessage(playerid,RED,"You must be in the LSPD to use this.");
    }
    return 1;
}
Reply
#5

Quote:
Originally Posted by On_Top_Non_Stop
Посмотреть сообщение
And missing/miss-placed brackets..

pawn Код:
command(undercover, playerid, params[])
{
    if(Groups[Player[playerid][Group]][CommandTypes] == 1)
    {
        if(IsPlayerInAnyVehicle(playerid));
        {
            SetPVarInt(playerid, "coplight0", CreateObject(18646,0,0,0,0,0,0));
            SetPVarInt(playerid, "coplight1", CreateObject(18646,0,0,0,0,0,0));
            AttachObjectToVehicle(GetPVarInt(playerid, "coplight0"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
            AttachObjectToVehicle(GetPVarInt(playerid, "coplight1"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
        }
        else
        {
            SendClientMessage(playerid,RED,"You need to be inside a car to use this. Preferrably the Elegent");
        }
    }  
    else
    {
        SendClientMessage(playerid,RED,"You must be in the LSPD to use this.");
    }
    return 1;
}
Jesus Christ, you're even worse.
Reply
#6

Quote:
Originally Posted by Antonio [G-RP]
Посмотреть сообщение
Jesus Christ, you're even worse.
How do you mean?

And if I made a mistake, would it not be better to try and help like I was doing rather than posting useless nonsense that's no help to any body?
Reply
#7

I mean, you created something that wouldn't help him at all.

And why would I, when RealCop already provided the correct code for him?
Reply
#8

Quote:
Originally Posted by Antonio [G-RP]
Посмотреть сообщение
I mean, you created something that wouldn't help him at all.

And why would I, when RealCop already provided the correct code for him?
Are you serious?

RealCop posted AFTER me.
Your obviously trying to start a flame war or something so this is the last time I am posting here.
Reply
#9

Quote:
Originally Posted by On_Top_Non_Stop
Посмотреть сообщение
And missing/miss-placed brackets..

pawn Код:
if(IsPlayerInAnyVehicle(playerid));
You didn't help at all, in fact you put him in a similar position to where he was before. When using 'if' statements, colons aren't needed.
Reply
#10

Thank you for pointing out MY mistake (at last). I was just a typo as I wrote it on the forums. If you just said I would have edited it and all would be well..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)