12.03.2011, 13:03
(
Последний раз редактировалось antonio112; 12.03.2011 в 15:29.
Причина: Problem solved
)
Heya ! I`m having some problems with faction vehicles. So, the script is like this:
First, global array for LSPD vehicles
Then, created the vehicles:
Everything fine till now. Now here comes the problem, when someone gets in a LSPDCar and his GetPVarInt( playerid, "Faction" ) isn`t 1 it should remove the player from the vehicle but it`s not working.
Anyone has any idea why it`s not working?
First, global array for LSPD vehicles
pawn Код:
new LSPDCar[ 12 ];
pawn Код:
public OnGameModeInit()
{
LSPDCar[ 0 ] = AddStaticVehicle( 596, 1570.4307, -1710.5015, 5.6118, 359.0704, 0, 1 ); // LSPDCruiser1
LSPDCar[ 1 ] = AddStaticVehicle( 596, 1574.4824, -1710.7050, 5.6126, 359.5297, 0, 1 ); // LSPDCruiser2
LSPDCar[ 2 ] = AddStaticVehicle( 596, 1578.6796, -1710.6199, 5.6113, 358.9721, 0, 1 ); // LSPDCruiser3
LSPDCar[ 3 ] = AddStaticVehicle( 596, 1583.5558, -1710.6246, 5.6117, 358.6743, 0, 1 ); // LSPDCruiser4
LSPDCar[ 4 ] = AddStaticVehicle( 596, 1587.4552, -1710.6227, 5.6123, 359.9478, 0, 1 ); // LSPDCruiser5
LSPDCar[ 5 ] = AddStaticVehicle( 596, 1591.5229, -1710.7249, 5.6120, 0.7387, 0, 1 ); // LSPDCruiser6
LSPDCar[ 6 ] = AddStaticVehicle( 596, 1602.0529, -1683.9634, 5.6110, 90.7847, 0, 1 ); // PDCruiser7
LSPDCar[ 7 ] = AddStaticVehicle( 596, 1601.9954, -1688.0194, 5.6131, 89.2227, 0, 1 ); // PDCruiser8
LSPDCar[ 8 ] = AddStaticVehicle( 596, 1601.7228, -1692.0026, 5.6109, 88.5967, 0, 1 ); // PDCruiser9
LSPDCar[ 9 ] = AddStaticVehicle( 596, 1601.3859, -1696.0682, 5.6096, 90.4116, 0, 1 ); // PDCruiser10
LSPDCar[ 10 ] = AddStaticVehicle( 596, 1600.9125, -1700.1434, 5.6098, 89.4584, 0, 1 ); // PDCruiser11
LSPDCar[ 11 ] = AddStaticVehicle( 596, 1601.4318, -1704.2673, 5.6122, 90.6356, 0, 1 ); // PDCruiser12
return 1;
}
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new vid = GetPlayerVehicleID( playerid );
if( vid == LSPDCar[ 11 ] )
{
if( newstate == 2 && GetPVarInt( playerid, "Faction" ) != 1 )
{
RemovePlayerFromVehicle( playerid );
SendClientMessage( playerid, -1, "You don`t have the keys for this car." );
}
}
return 1;
}