[HELP] remove player from vehicle!
#1

Hi there, i don't now why but something in this code makes it so that you get removed from any vehicle
pawn Код:
if(PlayerInfo[playerid][pAir] == 0 && PlayerInfo[playerid][pHel] == 0)
        {
            if(GetStreamVehicleModel(newcar) == 417)
            {
            RemovePlayerFromVehicle(playerid);
      SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
      GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
            }
            if(GetStreamVehicleModel(newcar) == 425)
            {
            RemovePlayerFromVehicle(playerid);
      SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
      GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
            }
            if(GetStreamVehicleModel(newcar) == 447)
            {
            RemovePlayerFromVehicle(playerid);
      SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
      GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
            }
            if(GetStreamVehicleModel(newcar) == 460)
            {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
            GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
            }
            if(GetStreamVehicleModel(newcar) == 469)
            {
            SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
            GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
            }
            RemovePlayerFromVehicle(playerid);
            if(GetStreamVehicleModel(newcar) == 476)
            {
            SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
            GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
            }
            if(GetStreamVehicleModel(newcar) == 487)
            {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
            GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
            }
            if(GetStreamVehicleModel(newcar) == 488)
            {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
            GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
            }
            if(GetStreamVehicleModel(newcar) == 497)
            {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
            GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
            }
            RemovePlayerFromVehicle(playerid);
            if(GetStreamVehicleModel(newcar) == 511)
            {
            SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
            GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
            }
            if(GetStreamVehicleModel(newcar) == 512)
            {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
            GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
            }
            if(GetStreamVehicleModel(newcar) == 513)
            {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
            GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
            }
            if(GetStreamVehicleModel(newcar) == 519)
            {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
            GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
            }
            if(GetStreamVehicleModel(newcar) == 520)
            {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
            GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
            }
            if(GetStreamVehicleModel(newcar) == 548)
            {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
            GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
            }
            if(GetStreamVehicleModel(newcar) == 553)
            {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
            GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
            }
            if(GetStreamVehicleModel(newcar) == 563)
            {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
            GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
            }
            if(GetStreamVehicleModel(newcar) == 577)
            {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
            GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
            }
            if(GetStreamVehicleModel(newcar) == 592)
            {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
            GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
            }
            if(GetStreamVehicleModel(newcar) == 593)
            {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
            GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
            }

        }
Now apart from this being scripted stupid, and WAY to long, i don't know whats wrong please help me out here!

Thanks in advance!
Reply
#2

You had two of the
pawn Код:
RemovePlayerFromVehicle(playerid);
out of the brackets of the code like:
pawn Код:
if(GetStreamVehicleModel(newcar) == ID)
{
      SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
      GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
}
RemovePlayerFromVehicle(playerid);
Here's the fix:
pawn Код:
if(PlayerInfo[playerid][pAir] == 0 && PlayerInfo[playerid][pHel] == 0)
{
     if(GetStreamVehicleModel(newcar) == 417)
{
RemovePlayerFromVehicle(playerid);
      SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
      GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
}
if(GetStreamVehicleModel(newcar) == 425)
{
RemovePlayerFromVehicle(playerid);
      SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
      GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
}
if(GetStreamVehicleModel(newcar) == 447)
{
RemovePlayerFromVehicle(playerid);
      SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
      GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
}
if(GetStreamVehicleModel(newcar) == 460)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
}
if(GetStreamVehicleModel(newcar) == 469)
{
SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
}
if(GetStreamVehicleModel(newcar) == 476)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
}
if(GetStreamVehicleModel(newcar) == 487)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
}
if(GetStreamVehicleModel(newcar) == 488)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
}
if(GetStreamVehicleModel(newcar) == 497)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
}
if(GetStreamVehicleModel(newcar) == 511)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
}
if(GetStreamVehicleModel(newcar) == 512)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
}
if(GetStreamVehicleModel(newcar) == 513)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
}
if(GetStreamVehicleModel(newcar) == 519)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
}
if(GetStreamVehicleModel(newcar) == 520)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
}
if(GetStreamVehicleModel(newcar) == 548)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
}
if(GetStreamVehicleModel(newcar) == 553)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
}
if(GetStreamVehicleModel(newcar) == 563)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
}
if(GetStreamVehicleModel(newcar) == 577)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
}
if(GetStreamVehicleModel(newcar) == 592)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
}
if(GetStreamVehicleModel(newcar) == 593)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
}

}
Reply
#3

Quote:
Originally Posted by ak47killa
You had two of the
pawn Код:
RemovePlayerFromVehicle(playerid);
out of the brackets of the code like:
pawn Код:
if(GetStreamVehicleModel(newcar) == ID)
{
      SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
      GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
}
RemovePlayerFromVehicle(playerid);
Thanks man, to fast copy and paste :P

Here's the fix:
pawn Код:
if(PlayerInfo[playerid][pAir] == 0 && PlayerInfo[playerid][pHel] == 0)
{
     if(GetStreamVehicleModel(newcar) == 417)
{
RemovePlayerFromVehicle(playerid);
      SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
      GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
}
if(GetStreamVehicleModel(newcar) == 425)
{
RemovePlayerFromVehicle(playerid);
      SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
      GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
}
if(GetStreamVehicleModel(newcar) == 447)
{
RemovePlayerFromVehicle(playerid);
      SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
      GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
}
if(GetStreamVehicleModel(newcar) == 460)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
}
if(GetStreamVehicleModel(newcar) == 469)
{
SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
}
if(GetStreamVehicleModel(newcar) == 476)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
}
if(GetStreamVehicleModel(newcar) == 487)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
}
if(GetStreamVehicleModel(newcar) == 488)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
}
if(GetStreamVehicleModel(newcar) == 497)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
}
if(GetStreamVehicleModel(newcar) == 511)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
}
if(GetStreamVehicleModel(newcar) == 512)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
}
if(GetStreamVehicleModel(newcar) == 513)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
}
if(GetStreamVehicleModel(newcar) == 519)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
}
if(GetStreamVehicleModel(newcar) == 520)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
}
if(GetStreamVehicleModel(newcar) == 548)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
}
if(GetStreamVehicleModel(newcar) == 553)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
}
if(GetStreamVehicleModel(newcar) == 563)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
}
if(GetStreamVehicleModel(newcar) == 577)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
}
if(GetStreamVehicleModel(newcar) == 592)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
}
if(GetStreamVehicleModel(newcar) == 593)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)");
GameTextForPlayer(playerid, "First buy an aircraft at Wangcars to get your license! (check /buyvehicle)", 10000, 1);
}

}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)