On Player Enter Vehicle
#1

Ok i think iv done this b4, but forgot how, got a idea how but not entiely sure,

how cud i under OnPlayerEnterVehicle have
like if your name isnt [LSB]Johnson you get ejected from the car? I know its realy simple but completely forgot, also the name of the car is jsay ..

ty , J
Reply
#2

pawn Код:
new mycar;

//@Ongamemodeinit
mycar = CreateVehicle(..

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
 if(vehicleid == mycar)
 {
   new PlayerName[MAX_PLAYER_NAME];
   GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
   if(strcmp(PlayerName, "[LSB]Johnson", true) == 0)
   {
     SendClientMessage(playerid, COLOR_COLOR,"This is your car.");
   }
   else
   {
    SendClientMessage(playerid, COLOR_COLOR, "This car is reserved for [LSB]Johnson!");
    RemovePlayerFromVehicle(playerid);
   }
 }
 return 1;
}
Untested.
Reply
#3

This is actually quite simple, I would give you an code but it so happens that if i do
i will be giving away my private car script, And i will be breaking many rules.
Reply
#4

Quote:
Originally Posted by Rksss
pawn Код:
new mycar;

//@Ongamemodeinit
mycar = CreateVehicle(..

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
 if(vehicleid == mycar)
 {
   new PlayerName[MAX_PLAYER_NAME];
   GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
   if(strcmp(PlayerName, "[LSB]Johnson", true) == 0)
   {
    SendClientMessage(playerid, COLOR_COLOR,"This is your car.");
   }
   else
   {
    SendClientMessage(playerid, COLOR_COLOR, "This car is reserved for [LSB]Johnson!");
    RemovePlayerFromVehicle(playerid);
   }
 }
 return 1;
}
Untested.
ty you for this g,

but i alredi got it from one of mi old gm's, but thankyou for your help

Johnson
Reply
#5

Quote:
Originally Posted by MadnessJohnson
Quote:
Originally Posted by Rksss
pawn Код:
new mycar;

//@Ongamemodeinit
mycar = CreateVehicle(..

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
  if(vehicleid == mycar)
  {
   new PlayerName[MAX_PLAYER_NAME];
   GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
   if(strcmp(PlayerName, "[LSB]Johnson", true) == 0)
   {
     SendClientMessage(playerid, COLOR_COLOR,"This is your car.");
   }
   else
   {
     SendClientMessage(playerid, COLOR_COLOR, "This car is reserved for [LSB]Johnson!");
     RemovePlayerFromVehicle(playerid);
   }
  }
  return 1;
}
Untested.
ty you for this g,

but i alredi got it from one of mi old gm's, but thankyou for your help

Johnson
Are you making this for Streetz ?

Or you make your own Server. :S
Reply
#6

Quote:
Originally Posted by [LSB
Erkan ]
Quote:
Originally Posted by MadnessJohnson
Quote:
Originally Posted by Rksss
pawn Код:
new mycar;

//@Ongamemodeinit
mycar = CreateVehicle(..

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
 if(vehicleid == mycar)
 {
   new PlayerName[MAX_PLAYER_NAME];
   GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
   if(strcmp(PlayerName, "[LSB]Johnson", true) == 0)
   {
     SendClientMessage(playerid, COLOR_COLOR,"This is your car.");
   }
   else
   {
    SendClientMessage(playerid, COLOR_COLOR, "This car is reserved for [LSB]Johnson!");
    RemovePlayerFromVehicle(playerid);
   }
 }
 return 1;
}
Untested.
ty you for this g,

but i alredi got it from one of mi old gm's, but thankyou for your help

Johnson
Are you making this for Streetz ?

Or you make your own Server. :S
for streetz, but fo games car ... why?
Reply
#7

This won't work I don't think. You need to have it under OnPlayerStateChange because OnPlayerEnterVehicle is called when the player hits enter near a vehicle. They could easily stop walking towards it. So they could hit enter and cancel it and receive this message. OnPlayerStateChange is only called once they are in the car and it is on.
Reply
#8

Quote:
Originally Posted by Rksss
pawn Код:
new mycar;

//@Ongamemodeinit
mycar = CreateVehicle(..

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
 if(vehicleid == mycar)
 {
   new PlayerName[MAX_PLAYER_NAME];
   GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
   if(strcmp(PlayerName, "[LSB]Johnson", true) == 0)
   {
    SendClientMessage(playerid, COLOR_COLOR,"This is your car.");
   }
   else
   {
    SendClientMessage(playerid, COLOR_COLOR, "This car is reserved for [LSB]Johnson!");
    RemovePlayerFromVehicle(playerid);
   }
 }
 return 1;
}
Untested.
1. pastebin
2. you cant remove a player from a vehicle if he isn't in one.
3. You are offering scripts and yourself as a scripter but you don't know this? shame on you
Reply
#9

Quote:
Originally Posted by [NT
SpeedDevil ]
3. You are offering scripts and yourself as a scripter but you don't know this? shame on you
LOL pwnt. That wasn't nice though, so you earn -2.4 Cuenits. Please be nicer next time, expecially to somebody as holy as Rksss.

~Cueball~
Reply
#10

Quote:
Originally Posted by Cueball
Quote:
Originally Posted by [NT
SpeedDevil ]
3. You are offering scripts and yourself as a scripter but you don't know this? shame on you
LOL pwnt. That wasn't nice though, so you earn -2.4 Cuenits. Please be nicer next time, expecially to somebody as holy as Rksss.

~Cueball~
now I only have 1.6 cuenits left

Rks holy? please explain yourself... no really!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)