- 0
Faction vehicles
-
Similar Content
-
- 0 replies
- 122 views
-
- 13 replies
- 1,690 views
-
-
Recently Browsing 0 members
- No registered users viewing this page.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.
Question
antonio112
Salutare ! Am ceva probleme cu masinile factiunilor. Deci, scriptul e cam asa:
Mai intai, global array pt masinile de politie:
[pawn]
new LSPDCar[ 12 ];
[/pawn]
Pe urma, am creat masinile:
[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]
Totul e bine pana aici. Acum urmeaza problema, cand cineva intra in masina de politie si GetPVarInt( playerid, "Faction" ) nu e 1 , ar trebui sa`l scoata din masina ... dar nu functioneaza.
[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;
}
[/pawn]
Aveti vreo idee de ce nu functioneaza?
Link to comment
Share on other sites
9 answers to this question
Recommended Posts