OnPlayerEnterVehicle Problem[Need Help] -
Tigerbeast11 - 05.11.2009
Hi!
I have this defined at the top of my script:
And this...
pawn Код:
Car = AddStaticVehicle(445,-2030.2690,156.5357,28.7109,181.0816,43,43); // car pos
Also this...
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
  if(Car)
  {
   SendClientMessage(playerid,COLOR_ORANGE,"Server: You have the car, take it back to base");
   new pname[MAX_PLAYER_NAME];
   new string[128];
    GetPlayerName(playerid,pname,sizeof(pname));
    format(string,sizeof(string),"Server: %s (id:%d) has the car and is now taking it back to base!",pname,playerid);
    SendClientMessageToAll(COLOR_ORANGE,string);
  }
  return 1;
}
The problem is... it sends the message to everyone everytime they enter any car.
I only want this message to be sent when they get into the car defined as "car". Plz help me with this as it is so confusing :S
P.S If you need more info or dont understand, just ask
Re: OnPlayerEnterVehicle Problem[Need Help] -
0ne - 05.11.2009
Why did u do the function:
SendCientMessage
ToAll
you need only SendClientMessage(playerid,COLOR_ORANGE,string);
Re: OnPlayerEnterVehicle Problem[Need Help] -
dice7 - 05.11.2009
AddStaticVehicle doesn't return the vehicles id. Use CreateVehicle() or AddStaticVehicleEx().
And
Re: OnPlayerEnterVehicle Problem[Need Help] -
cyber_punk - 05.11.2009
try this,
Quote:
Originally Posted by dice7
AddStaticVehicle doesn't return the vehicles id. Use CreateVehicle() or AddStaticVehicleEx().
And
|
damn you beat me.
Re: OnPlayerEnterVehicle Problem[Need Help] -
Tigerbeast11 - 05.11.2009
Ok! That helped, but now, I only want the vehicle to respawn 5 secs after someone exits it...
Re: OnPlayerEnterVehicle Problem[Need Help] -
dice7 - 05.11.2009
SetTimerEx + SetVehicleToRespawn
Re: OnPlayerEnterVehicle Problem[Need Help] -
Tigerbeast11 - 05.11.2009
How would I use them, like what sort of function would I have to make?
Re: OnPlayerEnterVehicle Problem[Need Help] -
MadeMan - 05.11.2009
Quote:
Originally Posted by dice7
AddStaticVehicle doesn't return the vehicles id.
|
AddStaticVehicle does return vehicleid.
Quote:
Originally Posted by Tigerbeast11
Ok! That helped, but now, I only want the vehicle to respawn 5 secs after someone exits it...
|
Just use AddStaticVehicleEx.
https://sampwiki.blast.hk/wiki/AddStaticVehicleEx
Re: OnPlayerEnterVehicle Problem[Need Help] -
Tigerbeast11 - 06.11.2009
Ok!
I have done everything!
But I have one more question. i have to teams, attackers who steal the car and defenders who protect it... How can i make it so that if a defender presses enter near a car, he dies?
How can i stop the defender from getting in the car? No, i will not use "RemovePlayerFromVehicle", i want to stop the player from entering the vehicle in the first place!
Re: OnPlayerEnterVehicle Problem[Need Help] -
First_Place - 15.12.2009
Quote:
Originally Posted by Tigerbeast11
Ok!
I have done everything!
But I have one more question. i have to teams, attackers who steal the car and defenders who protect it... How can i make it so that if a defender presses enter near a car, he dies?
How can i stop the defender from getting in the car? No, i will not use "RemovePlayerFromVehicle", i want to stop the player from entering the vehicle in the first place!
|
LOL I randomly came to this topic to make a gamemode to you