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
#2

help?
Reply
#3

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

Its 2 seperate cars though, not one jefff
Reply
#5

bump
Reply
#6

I'm not sure, sorry, but I hope this bump gets you some help.
Reply
#7

please guys lol really need help
Reply
#8

Try: http://codegenerators.pl/privateVehicle

Its a useful website.
Reply
#9

Quote:
Originally Posted by DobbysGamertag
Посмотреть сообщение
Try: http://codegenerators.pl/privateVehicle

Its a useful website.
My code should work fine though, Name1 works but anyone can drive name2's car, why?
Reply
#10

bumpp
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)