16.06.2011, 04:19
Well, I made a reserved car script, and I wanted to know how I would go at adding another one.
Код:
// This is a comment // uncomment the line below if you want to write a filterscript #define FILTERSCRIPT #define COLOR_RED 0xAA3333AA #include <a_samp> #if defined FILTERSCRIPT new Tyler; public OnFilterScriptInit() { Tyler = AddStaticVehicle(562,-1959.1219,288.1400,35.1337,89.6646,145,145); AddVehicleComponent(Tyler, 1036); AddVehicleComponent(Tyler, 1040); AddVehicleComponent(Tyler, 1034); AddVehicleComponent(Tyler, 1172); AddVehicleComponent(Tyler, 1149); AddVehicleComponent(Tyler, 1035); AddVehicleComponent(Tyler, 1146); AddVehicleComponent(Tyler, 1079); return 1; } public OnPlayerStateChange(playerid, newstate, oldstate) { new PlayerName[24]; GetPlayerName(playerid, PlayerName, sizeof(PlayerName)); if(newstate == PLAYER_STATE_DRIVER) { new Vehicle = GetPlayerVehicleID(playerid); if(Vehicle == Tyler) { if(strcmp(PlayerName,"Tyler[DGZ]",true)) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, 0xAA3333AA, "This car is reserved for: Tyler[DGZ]"); } } } return 1; } public OnVehicleSpawn(vehicleid) { AddVehicleComponent(Tyler, 1036); AddVehicleComponent(Tyler, 1040); AddVehicleComponent(Tyler, 1034); AddVehicleComponent(Tyler, 1172); AddVehicleComponent(Tyler, 1149); AddVehicleComponent(Tyler, 1035); AddVehicleComponent(Tyler, 1146); AddVehicleComponent(Tyler, 1079); } #endif