Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // TIMER:
- static void SAMPGDK_CALL Set_CameraPos(int, void *) {
- for(int playerid = NULL; playerid <= MAX_PLAYERS; playerid++) {
- SetPlayerInterior(playerid, NULL);
- SetPlayerFacingAngle(playerid, 90.0f);
- SetPlayerPos(playerid, -1399.0179f, 2640.7385f, 55.6875f);
- SetPlayerCameraPos(playerid, -1410.462402f, 2640.7385f, 55.6875f);
- SetPlayerCameraLookAt(playerid, -1410.462402f, 2640.7385f, 55.6875f, CAMERA_CUT);
- ApplyAnimation(playerid, "RAPPING", "RAP_B_Loop", 4.0, 1, 0, 0, 0, 0);
- }
- }
- // Public functions:
- PUBLIC OnGameModeInit() {
- for(int i = 0; i <= 299; i++) {
- AddPlayerClass(i, -1399.0179f, 2640.7385f, 55.6875f, 0.0, 0, 0, 0, 0, 0, 0);
- }
- return true;
- }
- PUBLIC OnPlayerConnect(int playerid) {
- PlayAudioStreamForPlayer(playerid, "http://alldev.eu/mp3/april_showers.mp3");
- InterpolateCameraPos(playerid, -1635.208984f, 2274.272460f, 101.468925f, -1428.462402f, 2642.478271f, 66.434036f, INTERPOLATIONTIME, CAMERA_CUT);
- InterpolateCameraLookAt(playerid, -1633.167846f, 2278.822753f, 101.109863f, -1423.579956f, 2642.294677f, 65.371879f, INTERPOLATIONTIME, CAMERA_CUT);
- Set_CameraPos_Timer[playerid] = SetTimer(Set_CameraPos, INTERPOLATIONTIME, false);
- return true;
- }
- PUBLIC OnPlayerUpdate(int playerid) {
- GetPlayerName(playerid, Name[playerid], sizeof(Name[playerid]));
- GetVehicleHealth(GetPlayerVehicleID(playerid), &Health[playerid]);
- IsPlayerInAnyVehicle(playerid)? sprintf(str[playerid], "\n[%s]\n%0.1f km/h\n%0.1f/1000.0", &gVehicleNames[GetVehicleModel(GetPlayerVehicleID(playerid)) - 400], GetSpeed(playerid), Health[playerid]), UpdatePlayer3DTextLabelText(playerid, Speed3DText[playerid], -1, str[playerid]): false;
- return true;
- }
- PUBLIC OnPlayerStateChange(int playerid, int newstate, int oldstate) {
- newstate == PLAYER_STATE_DRIVER? Speed3DText[playerid] = CreatePlayer3DTextLabel(playerid, "Infernus\n666 KM/H", -1, 0, 0, 0, 15.0, INVALID_PLAYER_ID, GetPlayerVehicleID(playerid), 1): false;
- oldstate == PLAYER_STATE_DRIVER? DeletePlayer3DTextLabel(playerid, Speed3DText[playerid]): false;
- return true;
- }
- PUBLIC OnPlayerKeyStateChange(int playerid, int newkeys, int oldkeys) {
- if((newkeys & KEY_FIRE) && !(oldkeys & KEY_FIRE) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {
- if(IsValidObject(CarFireObject[playerid]) == 0) {
- CarFireObject[playerid] = CreateObject(18694, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 500.0f);
- AttachObjectToVehicle(CarFireObject[playerid], GetPlayerVehicleID(playerid), 0.0f, -2.3f, 1.2f, 180.0f, 0.0f, 0.0f);
- }
- AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
- !IsPlayerInAnyVehicle(playerid)? RemoveVehicleComponent(GetPlayerVehicleID(playerid), 1010), DestroyObject(CarFireObject[playerid]): false;
- return true;
- }
- else if((oldkeys & KEY_FIRE) && !(newkeys & KEY_FIRE) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {
- DestroyObject(CarFireObject[playerid]);
- RemoveVehicleComponent(GetPlayerVehicleID(playerid), 1010);
- return true;
- }
- BindKey("submission") {
- IsPlayerInAnyVehicle(playerid)?
- RepairVehicle(GetPlayerVehicleID(playerid)),
- GameTextForPlayer(playerid,"~y~Pojazd naprawiony!", 2000, 5),
- PlayerPlaySound(playerid, 1133, 0.0f, 0.0f, 0.0f):
- false;
- }
- return true;
- }
- PUBLIC OnPlayerRequestClass(int playerid, int classid) {
- switch(GetPVarInt(playerid, "Dance")) {
- case 0: ApplyAnimation(playerid, "DANCING", "dnce_M_a", 4.1f, 1, 1, 1, 1, 1, 1); break;
- case 1: ApplyAnimation(playerid, "DANCING", "dnce_M_b", 4.1f, 1, 1, 1, 1, 1, 1); break;
- case 2: ApplyAnimation(playerid, "DANCING", "dnce_M_c", 4.1f, 1, 1, 1, 1, 1, 1); break;
- case 3: ApplyAnimation(playerid, "DANCING", "dnce_M_d", 4.1f, 1, 1, 1, 1, 1, 1); break;
- case 4: ApplyAnimation(playerid, "DANCING", "dnce_M_e", 4.1f, 1, 1, 1, 1, 1, 1); break;
- }
- SetPVarInt(playerid, "Dance", GetPVarInt(playerid, "Dance") < 4? GetPVarInt(playerid, "Dance") + 1: 0);
- return true;
- }
- PUBLIC OnPlayerSpawn(int playerid) {
- KillTimer(Set_CameraPos_Timer[playerid]);
- SetCameraBehindPlayer(playerid);
- StopAudioStreamForPlayer(playerid);
- SetPlayerFacingAngle(playerid, 90.0f);
- SetPlayerPos(playerid, -1399.0179f, 2640.7385f, 55.6875f);
- SetPlayerWorldBounds(playerid, 20000.0000, -20000.0000, 20000.0000, -20000.0000);
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement