private cars question
#1

Alright so i got private cars code. Name1 works fine, but in Name2 anyone can drive the car and no client message shows..... this is the code-.. no errors

Код:
	if(newstate == PLAYER_STATE_DRIVER)
{
  new pname[MAX_PLAYER_NAME];
  GetPlayerName(playerid, pname, sizeof(pname));
  new v = GetPlayerVehicleID(playerid);
  if(v == name1car)
  {
    if(!strcmp(pname, "Name1", true))
    {
      SendClientMessage(playerid, COLOR_RED, "Welcome to your car");
    }
    else
    {
      SendClientMessage(playerid, COLOR_RED, "This car is private.");
      RemovePlayerFromVehicle(playerid);
    }
  }
  return 1;
  }
    if(newstate == PLAYER_STATE_DRIVER)
{
  new pname[MAX_PLAYER_NAME];
  GetPlayerName(playerid, pname, sizeof(pname));
  new v = GetPlayerVehicleID(playerid);
  if(v == Name2)
  {
    if(!strcmp(pname, "Name2", true))
    {
      SendClientMessage(playerid, COLOR_RED, "Yo welcome to your car");
    }
    else
    {
      SendClientMessage(playerid, COLOR_RED, "Car is private");
      RemovePlayerFromVehicle(playerid);
    }
  }
  return 1;
}
Reply


Messages In This Thread
private cars question - by Nines - 16.07.2013, 21:22
Re: private cars question - by Nines - 16.07.2013, 21:48
Re: private cars question - by Jefff - 16.07.2013, 21:59
Re: private cars question - by Nines - 16.07.2013, 22:55
Re: private cars question - by Nines - 17.07.2013, 15:40
Re: private cars question - by Aerotactics - 17.07.2013, 19:20
Re: private cars question - by Nines - 18.07.2013, 12:20
Re: private cars question - by DobbysGamertag - 18.07.2013, 13:29
Re: private cars question - by Nines - 18.07.2013, 13:33
Re: private cars question - by Nines - 21.07.2013, 14:39

Forum Jump:


Users browsing this thread: 1 Guest(s)