SA-MP Forums Archive
How to do this - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How to do this (/showthread.php?tid=64135)



How to do this - JoeDaDude - 02.02.2009

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.


Re: How to do this - harrold - 02.02.2009

OnPlayerStateChange


Re: How to do this - ICECOLDKILLAK8 - 02.02.2009

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



Re: How to do this - JoeDaDude - 02.02.2009

Thankyou


Re: How to do this - JoeDaDude - 02.02.2009

Erm jenkstax can u repost tht code plz thankyou,

EDIT: forgot to modify soz


Re: How to do this - ICECOLDKILLAK8 - 02.02.2009

Код:
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;
}



Re: How to do this - JoeDaDude - 02.02.2009

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"



Re: How to do this - ICECOLDKILLAK8 - 02.02.2009

Код:
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?


Re: How to do this - JoeDaDude - 02.02.2009

yes i did