Little help please
#1

Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	if(vehicleid == Car)
	if(Member[playerid] == 1)

	SendClientMessage(playerid,green,"Welcome to LVPD vehicle");

	else
{
	if(vehicleid == Car)
	if(Member[playerid] == 0)
	if(Member[playerid] == 2)

  RemovePlayerFromVehicle(playerid);
  SendClientMessage(playerid,red,"[!] You are not LVPD you cannot use this vehicle [!]");

}
}
ok whats its suppose to do....if your member id = 1 its suppose to give the message "Welcome to LVPD vehicle" when you enter a certain vehicle

and if your member id = 0 or id = 2 its suppose to eject you from the vehicle and give you the message ,"[!] You are not LVPD you cannot use this vehicle [!]"

Can someone help me with this....ive tried scripting it different ways and it just wont work
Reply
#2

if vehicleid = car? aren't you surpose to put the model id of the vehicle?
Reply
#3

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(vehicleid == Car)
if(Member[playerid] == 1)
{
    SendClientMessage(playerid,green,"Welcome to LVPD vehicle");
}
else
{
  RemovePlayerFromVehicle(playerid);
  SendClientMessage(playerid,red,"[!] You are not LVPD you cannot use this vehicle [!]");
}
return 1;
}
Reply
#4

Quote:
Originally Posted by oliverrud
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(vehicleid == Car)
if(Member[playerid] == 1)
{
    SendClientMessage(playerid,green,"Welcome to LVPD vehicle");
}
else
{
  RemovePlayerFromVehicle(playerid);
  SendClientMessage(playerid,red,"[!] You are not LVPD you cannot use this vehicle [!]");
}
return 1;
}
Sorry Doesnt Work
Quote:
Originally Posted by Kar
if vehicleid = car? aren't you surpose to put the model id of the vehicle?
What do you mean?
Heres what i have for the vehicle == Car
Код:
public OnGameModeInit()
{
Car = AddStaticVehicle(598,2277.8750,2460.4392,10.5657,358.5709,0,1); //
Car = AddStaticVehicle(598,2260.3335,2477.5132,10.5679,0.3022,0,1); //
Car = AddStaticVehicle(598,2297.7563,2460.3704,3.0189,89.6632,0,1); //
Car = AddStaticVehicle(598,2240.6677,2452.0735,3.0210,270.0270,0,1); //
Car = AddStaticVehicle(523,2277.1277,2430.8215,2.8440,359.3682,0,0); //
Car = AddStaticVehicle(523,2285.5767,2431.1370,2.8529,359.2295,0,0); //
Car = AddStaticVehicle(523,2294.5940,2431.0159,2.8677,359.2234,0,0); //
Car = AddStaticVehicle(523,2303.0117,2430.9021,2.8676,359.2236,0,0); //
Car = AddStaticVehicle(523,-1400.3375,2656.6453,55.2537,90.6682,0,0); //
Car = AddStaticVehicle(599,-1400.3079,2631.7339,55.9482,269.7901,0,1); //
Car = AddStaticVehicle(599,-1400.1130,2643.8862,55.9178,269.7845,0,1); //
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(vehicleid == Car)
if(Member[playerid] == 1)
{
SendClientMessage(playerid,green,"Welcome to LVPD vehicle");
}
else
{
  RemovePlayerFromVehicle(playerid);
  SendClientMessage(playerid,red,"[!] You are not LVPD you cannot use this vehicle [!]");
}
return 1;
}
Reply
#5

i see 598 and 599 are lvpd and sfpd u want if someone that isnt id1 enters vehicle model 599 they get kicked out try using it by the vehicleid and not car=
Reply
#6

Quote:
Originally Posted by Kar
i see 598 and 599 are lvpd and sfpd u want if someone that isnt id1 enters vehicle model 599 they get kicked out try using it by the vehicleid and not car=
using the vehicle id doesnt work either.....i can send the whole script if someone would like to try to get it to work
Reply
#7

Try this then wont say it will work but a try worth
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(vehicleid == Car)
    {
        if(Member[playerid] == 1)
    {
        SendClientMessage(playerid,green,"Welcome to LVPD vehicle");
    }
  }
  else
  {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,red,"[!] You are not LVPD you cannot use this vehicle [!]");
  }
    return 1;
}
Reply
#8

Quote:
Originally Posted by oliverrud
Try this then wont say it will work but a try worth
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(vehicleid == Car)
    {
        if(Member[playerid] == 1)
    {
        SendClientMessage(playerid,green,"Welcome to LVPD vehicle");
    }
  }
  else
  {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,red,"[!] You are not LVPD you cannot use this vehicle [!]");
  }
    return 1;
}
Ok instead of RemovePlayerFromVehicle(playerid); is there something that wont even let the player enter the vehicle?
Reply
#9

Quote:
Originally Posted by sinbad
Ok instead of RemovePlayerFromVehicle(playerid); is there something that wont even let the player enter the vehicle?
I'm a beginner at scripting but you could maybe:
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(vehicleid == Car)
    {
        if(Member[playerid] == 1)
    {
        SendClientMessage(playerid,green,"Welcome to LVPD vehicle");
    }
  }
  else
  {
    TogglePlayerControllable(playerid,0);
      TogglePlayerControllable(playerid,1);
    SendClientMessage(playerid,red,"[!] You are not LVPD you cannot use this vehicle [!]");
  }
    return 1;
}
Don't know if it works and if it does, then nice, however there might be a much more effective and easier way to do it.
Reply
#10

Try sumin like this

pawn Код:
new Car[25]; // At Top

public OnPlayerStateChange(playerid,newstate,oldstate)
{
  if(newstate == 2)
  {
     if(IsPlayerPoliceCar(playerid))
     {
       if(Member[playerid] == 1) SendClientMessage(playerid,green,"Welcome to LVPD vehicle");
       else
       {
         RemovePlayerFromVehicle(playerid);
         SendClientMessage(playerid,red,"[!] You are not LVPD you cannot use this vehicle [!]")
       }
     }
  }
  return 1;
}

IsPlayerPoliceCar(playerid)
{
  switch(GetPlayerVehicleID(playerid)) case Car[0], Car[1], Car[2], Car[3], Car[4], Car[5]: return 1;
  return 0;
}

public OnGameModeInit()
{
  Car[0] = AddStaticVehicle(598,2277.8750,2460.4392,10.5657,358.5709,0,1); //
  Car[1] = AddStaticVehicle(598,2260.3335,2477.5132,10.5679,0.3022,0,1); //
  Car[2] = AddStaticVehicle(598,2297.7563,2460.3704,3.0189,89.6632,0,1); //
  Car[3] = AddStaticVehicle(598,2240.6677,2452.0735,3.0210,270.0270,0,1); //
  Car[4] = AddStaticVehicle(599,-1400.3079,2631.7339,55.9482,269.7901,0,1); //
  Car[5] = AddStaticVehicle(599,-1400.1130,2643.8862,55.9178,269.7845,0,1); //
  Car[6] = AddStaticVehicle(523,2277.1277,2430.8215,2.8440,359.3682,0,0); //
  Car[7] = AddStaticVehicle(523,2285.5767,2431.1370,2.8529,359.2295,0,0); //
  Car[8] = AddStaticVehicle(523,2294.5940,2431.0159,2.8677,359.2234,0,0); //
  Car[9] = AddStaticVehicle(523,2303.0117,2430.9021,2.8676,359.2236,0,0); //
  Car[10] = AddStaticVehicle(523,-1400.3375,2656.6453,55.2537,90.6682,0,0); //
  return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)