How to do this
#1

Hi,
When im near a car, And i press "F"
It says: Welcome to vehicle ID: 1
But i only want it to say: Welcome to vehicle ID: 1
When the person is in the vehicle,
Not when the person is still on foot and is walking to get in the vehicle.
Reply
#2

OnPlayerStateChange
Reply
#3

Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}
TIP: if(newstate == PLAYER_STATE_DRIVER)
Reply
#4

Thankyou
Reply
#5

Erm jenkstax can u repost tht code plz thankyou,

EDIT: forgot to modify soz
Reply
#6

Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
format(string, sizeof(string), "Vehicle ID: %d", GetPlayerVehicleID(playerid));
SendClientMessage(playerid, color, string);
return 1;
}
return 1;
}
Reply
#7

pawn Код:
if(newstate == PLAYER_STATE_DRIVER)
    {
      if(vehicleid == XN001)
      {
        SendClientMessage(playerid, COLOR_BLUE, "Tail Number: XN001");
        }
        return 1;
        }
Код:
D:\Program Files\Rockstar Games\GTA San Andreas\SA-MP\gamemodes\sftdm.pwn(694) : error 017: undefined symbol "vehicleid"
Reply
#8

Код:
if(newstate == PLAYER_STATE_DRIVER)
{
  if(GetPlayerVehicleID(playerid) == XN001)
  {
    SendClientMessage(playerid, COLOR_BLUE, "Tail Number: XN001"); 
  }
return 1;
}
But i dont think that will work cuz that will return a number, did you use XN001 = AddStaticVehicle?
Reply
#9

yes i did
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)