[Help] Simple RemovePLlayerFromVehicule
#2

Quote:
Originally Posted by Sn4ke
Посмотреть сообщение
Hello, I try to make a script where the player will be ejected from an hunter if he wasn't in the army group (lieutenant) that I previously set.

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
        if(GetVehicleModel(vehicleid) == 425) {  
        if(Rank[playerid] = 4) { // (no problem here)
        {
        SendClientMessage(playerid,COLOR_GREEN,"Welcome To The Hunter!");
        }
        }
        else SendClientMessage(playerid,COLOR_RED,"You Are Not a lieutenant");
        GetPlayerVehicleID(playerid);                     //problem here
        RemovePlayerFromVehicle(playerid);    //problem here
    }
        return 1;
}
But when I enter in a vehicule it said just "You are not a military" and I'm not ejected from the vehicule (I'm not in the army group) PLease help thanks

Sorry 4 my bad English


1) Use ClearAnimations(playerid); It works fine.

2) Brackets

pawn Код:
else SendClientMessage(playerid,COLOR_RED,"You Are Not a lieutenant");
  GetPlayerVehicleID(playerid);                     //problem here
  RemovePlayerFromVehicle(playerid);    //problem here
with this you mean that:

else: Send the message

In every case: Get the vehicle and remove him.

The correct thing to do is:

else: Send the message, get the vehicle and remove the player.


INFO: ClearAnimation means that the player can't perform the Entering-vehicle animation

USE:

pawn Код:
else { SendClientMessage(playerid,COLOR_RED,"You Are Not a lieutenant");
    GetPlayerVehicleID(playerid);                     //problem here
    ClearAnimations(playerid);    //problem here
  }
Reply


Messages In This Thread
[Help] Simple RemovePLlayerFromVehicule - by Sn4ke - 11.03.2011, 14:25
Re: [Help] Simple RemovePLlayerFromVehicule - by Sasino97 - 11.03.2011, 14:27
Re : [Help] Simple RemovePLlayerFromVehicule - by Sn4ke - 11.03.2011, 14:33
New post - by Sasino97 - 11.03.2011, 14:53
Re: [Help] Simple RemovePLlayerFromVehicule - by dice7 - 11.03.2011, 15:05

Forum Jump:


Users browsing this thread: 1 Guest(s)