OnPlayerStateChange
#1

This is my code:

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    new getthecar;
    getthecar = GetPlayerVehicleID(playerid);
    if(newstate == PLAYER_STATE_DRIVER && oldstate == PLAYER_STATE_ONFOOT)
    {
    //
        if(getthecar == vip1)
    {
        if(player_op[playerid] == 1){
      }
      else
      {
        RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, COLOR_ORED, "You are not a VIP Member!");
      }
    }
    if(getthecar == vip2)
    {
        if(player_op[playerid] == 1){
      }
      else
      {
        RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, COLOR_ORED, "You are not a VIP Member!");
      }
    }
    if(getthecar == vip3)
    {
        if(player_op[playerid] == 1){
      }
      else
      {
        RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, COLOR_ORED, "You are not a VIP Member!");
      }
    }
    if(getthecar == vip4)
    {
        if(player_op[playerid] == 1){
      }
      else
      {
        RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, COLOR_ORED, "You are not a VIP Member!");
      }
    }
    if(getthecar == vip5)
    {
        if(player_op[playerid] == 1){
      }
      else
      {
        RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, COLOR_ORED, "You are not a VIP Member!");
      }
    }
    if(getthecar == vip8)
    {
        if(player_op[playerid] == 1){
      }
      else
      {
        RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, COLOR_ORED, "You are not a VIP Member!");
      }
    }
    if(getthecar == vip9)
    {
        if(player_op[playerid] == 1){
      }
      else
      {
        RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, COLOR_ORED, "Error: You are not a VIP Member!");
      }
    if(IsOrgCar(playerid,getthecar))
    {
    if(PlayerJob[playerid] == 0)
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,COLOR_WHITE,"Error: You are not authorized to use this vehicle");
    }
    }
    if(IsPlane(playerid,getthecar))
    {
    if(FlyLicense[playerid] == 0)
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,COLOR_ORANGE,"You must have a flying license first! Head to the Cityhall to get a license");
    }
    }
    if(IsCar(playerid,getthecar))
    {
    if(CarLicense[playerid] == 0)
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,COLOR_ORANGE,"You must have a driving license first! Head to the Cityhall to get a license");
    }
    }
    if(IsAOFCar(playerid,getthecar))
    {
    if(NotDrunk[playerid] == 0)
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,COLOR_WHITE,"You are currently drunk. You can't drive a vehicle right now.");
    }
    }
    }
 }


    return 0;
}
How I can get all of these functions working correct? Only those VIP- Member vehicles work, not others. How do I fix it?
Reply
#2

Actually I fixed it already :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)