fail... :O
#1

The problem is.. when someone leaves any vehicle it notifys that, and it only needs to notify it for the defined vehicles. (PLANE_LS) Etc.

pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
    new playervehicleid = GetPlayerVehicleID(playerid);
  new string[256]; new playername[MAX_PLAYER_NAME];
  GetPlayerName (playerid, playername, sizeof(playername));

  if(playervehicleid == PLANE_LS || PLANE_SF || PLANE_LS2 || PLANE_SF2 && GetPlayerTeam(playerid) == TEAM_LS || TEAM_SF)
  {
        format (string, sizeof(string), "%s has left the Infernus!", playername);
        TextDrawSetString (text4, string);
        TextDrawShowForAll (text4);
        PlaySoundForAll(1150);
        SetTimer ("Destroy4", 3000, false);
        man[playerid] = 0;
        return 1;
        }
    return 1;
}
Reply
#2

pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
    new playervehicleid = GetPlayerVehicleID(playerid);
  new string[256]; new playername[MAX_PLAYER_NAME];
  GetPlayerName (playerid, playername, sizeof(playername));

  if((playervehicleid == PLANE_LS || PLANE_SF || PLANE_LS2 || PLANE_SF2) && (GetPlayerTeam(playerid) == TEAM_LS || TEAM_SF))
  {
        format (string, sizeof(string), "%s has left the Infernus!", playername);
        TextDrawSetString (text4, string);
        TextDrawShowForAll (text4);
        PlaySoundForAll(1150);
        SetTimer ("Destroy4", 3000, false);
        man[playerid] = 0;
        return 1;
        }
    return 1;
}
If I'm not mistaken you have to put it as one. So here it is
Reply
#3

I'm not sure if you can make conditionals that way.

pawn Код:
public OnPlayerStateChange(playerid,newstate,oldstate)
{
  if( (newstate==PLAYER_STATE_ON_FOOT) && (oldstate==PLAYER_STATE_DRIVER) )
  {
    new pvehid=GetPlayerVehicleID(playerid);
    new string[256];
    GetPlayerName(playerid,string,sizeof(string));
    if( ( (pvehid==PLANE_LS) || (pvehid==PLANE_SF) || (pvehid==PLANE_LS2) || (pvehid==PLANE_SF2) ) && ( (GetPlayerTeam(playerid)==TEAM_LS) ||(GetPlayerTeam(playerid)==TEAM_SF) ) )
    {
      //Code
    }
  }
  return 1;
}
Notice that I'm using a different callback, this way it won't say that if the player ileaving the passenger seat.
Reply
#4

in onplayerstatechange i already have like 200 lines . i need it on onplayerexitvehicle. I used KnooL's code but still doing the same.
Reply
#5

It won't change anything if you add that code on otp of your other stuff inside of OnPlayerStateChange
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)