OnPlayerEnterVehicle Problem[Need Help]
#1

Hi!

I have this defined at the top of my script:
pawn Код:
new Car;
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
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)