public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(IsPlayerInVehicle(playerid, 522))
{
SendClientMessage(playerid,0xFFFFFFFFF,"Antifall has been automatically activated on your NRG-500!");
}
if(IsPlayerInVehicle(playerid, 521))
{
SendClientMessage(playerid,0xFFFFFFFFF,"Antifall has been automatically activated on your FCR-900!");
}
if(IsPlayerInVehicle(playerid, 461))
{
SendClientMessage(playerid,0xFFFFFFFFF,"Antifall has been automatically activated on your PCJ-600!");
}
if(IsPlayerInVehicle(playerid, 448))
{
SendClientMessage(playerid,0xFFFFFFFFF,"Antifall has been automatically activated on your Pizza-Boy!");
}
if(IsPlayerInVehicle(playerid, 462))
{
SendClientMessage(playerid,0xFFFFFFFFF,"Antifall has been automatically activated on your Faggio!");
}
if(IsPlayerInVehicle(playerid, 463))
{
SendClientMessage(playerid,0xFFFFFFFFF,"Antifall has been automatically activated on your Freeway!");
}
if(IsPlayerInVehicle(playerid, 468))
{
SendClientMessage(playerid,0xFFFFFFFFF,"Antifall has been automatically activated on your Sanchez!");
}
if(IsPlayerInVehicle(playerid, 523))
{
SendClientMessage(playerid,0xFFFFFFFFF,"Antifall has been automatically activated on your HPV-1000!");
}
if(IsPlayerInVehicle(playerid, 581))
{
SendClientMessage(playerid,0xFFFFFFFFF,"Antifall has been automatically activated on your BF-400!");
}
if(IsPlayerInVehicle(playerid, 586))
{
SendClientMessage(playerid,0xFFFFFFFFF,"Antifall has been automatically activated on your Wayfarer!");
}
return 1;
}
public
OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
switch(GetVehicleModel(GetPlayerVehicleID(playerid)))
{
case 522: SendClientMessage(playerid,0xFFFFFFFFF,"Antifall has been automatically activated on your NRG-500!");
case 521: SendClientMessage(playerid,0xFFFFFFFFF,"Antifall has been automatically activated on your FCR-900!");
}
}
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 522)
{
SendClientMessage(playerid,0xFFFFFFFFF,"Antifall has been automatically activated on your NRG-500!");
}
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 521)
{
SendClientMessage(playerid,0xFFFFFFFFF,"Antifall has been automatically activated on your FCR-900!");
}
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 461)
{
SendClientMessage(playerid,0xFFFFFFFFF,"Antifall has been automatically activated on your PCJ-600!");
}
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 448)
{
SendClientMessage(playerid,0xFFFFFFFFF,"Antifall has been automatically activated on your Pizza-Boy!");
}
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 462)
{
SendClientMessage(playerid,0xFFFFFFFFF,"Antifall has been automatically activated on your Faggio!");
}
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 463)
{
SendClientMessage(playerid,0xFFFFFFFFF,"Antifall has been automatically activated on your Freeway!");
}
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 468)
{
SendClientMessage(playerid,0xFFFFFFFFF,"Antifall has been automatically activated on your Sanchez!");
}
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 523)
{
SendClientMessage(playerid,0xFFFFFFFFF,"Antifall has been automatically activated on your HPV-1000!");
}
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 581)
{
SendClientMessage(playerid,0xFFFFFFFFF,"Antifall has been automatically activated on your BF-400!");
}
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 586)
{
SendClientMessage(playerid,0xFFFFFFFFF,"Antifall has been automatically activated on your Wayfarer!");
}
return 1;
}
Try:
pawn Код:
|
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 522)
{
SendClientMessage(playerid,0xFFFFFFFFF,"Antifall has been automatically activated on your NRG-500!");
}
else if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 521)
{
SendClientMessage(playerid,0xFFFFFFFFF,"Antifall has been automatically activated on your FCR-900!");
}
else if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 461)
{
SendClientMessage(playerid,0xFFFFFFFFF,"Antifall has been automatically activated on your PCJ-600!");
}
else if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 448)
{
SendClientMessage(playerid,0xFFFFFFFFF,"Antifall has been automatically activated on your Pizza-Boy!");
}
else if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 462)
{
SendClientMessage(playerid,0xFFFFFFFFF,"Antifall has been automatically activated on your Faggio!");
}
else if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 463)
{
SendClientMessage(playerid,0xFFFFFFFFF,"Antifall has been automatically activated on your Freeway!");
}
else if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 468)
{
SendClientMessage(playerid,0xFFFFFFFFF,"Antifall has been automatically activated on your Sanchez!");
}
else if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 523)
{
SendClientMessage(playerid,0xFFFFFFFFF,"Antifall has been automatically activated on your HPV-1000!");
}
else if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 581)
{
SendClientMessage(playerid,0xFFFFFFFFF,"Antifall has been automatically activated on your BF-400!");
}
else if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 586)
{
SendClientMessage(playerid,0xFFFFFFFFF,"Antifall has been automatically activated on your Wayfarer!");
}
}
return 1;
}
pawn Код:
|
This shall work fine either. I haven't tested it, but it's ok I think.
EDIT: Tested and working fine. |