Ask about earthquakes system
#1

Someone have earthquakes system? I see on LSRP they have a earthquake system , I think earthquakes just from mapping and I see when in any area before isn't broken and when earthquake occurred, after earthquakes some area is broken , how did they do that?

If you have please give me ...
Reply
#2

They did it by scripting, and having patience.
Reply
#3

Yes, they have a the best scripter , did It's possible for create?
Reply
#4

We have a ****** system as well - Click me
Reply
#5

Not found , just mapping? Its possible or not If when before area isn't broken and when we turn on earthquakes system with admin cmd and then area will be broken after eathquakes?
Reply
#6

"The best scripter" - lol. My ass can do this too.
Reply
#7

Quote:
Originally Posted by Kindred
Посмотреть сообщение
"The best scripter" - lol. My ass can do this too.
OK, do it then.
Reply
#8

Just watched a video of it, I think it's a combination of setplayerdrunklevel and play with SetPlayerPos and possibly gravity.
Reply
#9

Mapper is no problem, problem on Its possible or not If we make it for when before earthquaker and all map is fine and then when we turn on earthquaker system and some map, we mapping will be broken after earthquaker?
Reply
#10

Quote:
Originally Posted by LocMax
Посмотреть сообщение
Just watched a video of it, I think it's a combination of setplayerdrunklevel and play with SetPlayerPos and possibly gravity.
And also for after earthquake some map on my mapping is broken
Reply
#11

Basically delete the road, then add objects like 10 meter below.

A really high amount of drunk level when quake is happening, the cars will be jumping around.
Reply
#12

Its possible for make the system when some map is fine earlier and when we turn on the earthquake system and after earthquake , some my mapping is broken?
Reply
#13

Quote:
Originally Posted by TheFirst
Посмотреть сообщение
Its possible for make the system when some map is fine earlier and when we turn on the earthquake system and after earthquake , some my mapping is broken?
SetPlayerDrunkLevel and a timer to create the objects once the earthquake has stopped.
Reply
#14

Quote:
Originally Posted by TheFirst
Посмотреть сообщение
Its possible for make the system when some map is fine earlier and when we turn on the earthquake system and after earthquake , some my mapping is broken?
Yeah, you can load the changes using a public or stock function which gets called after your earthquake ends.

As for the earthquake, it's kind of simple to do. Making an exact replica might be difficult but you can always create something similar.

[ame]http://www.youtube.com/watch?v=2Vne9IKB7rw[/ame]

My code might not be the best but you could use it as an example.

pawn Код:
#include <a_samp>
#include <zcmd>

new Float: playerPrevPos[MAX_PLAYERS][3];
new playerQuakeProg[MAX_PLAYERS];
new playerQuakeTimer[MAX_PLAYERS];

CMD:earthquake(playerid)
{
    new Float:Pos[3];

    SendClientMessage(playerid, -1, "Earthquake started");

    GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
    PlayAudioStreamForPlayer(playerid, "http://damianc.us/anniversary/earthquake_sound.mp3");

    SetPlayerDrunkLevel(playerid, 5001);
    SetPlayerWeather(playerid, 19);

    playerPrevPos[playerid][0] = Pos[0];
    playerPrevPos[playerid][1] = Pos[1];
    playerPrevPos[playerid][2] = Pos[2];

    SetPlayerVelocity(playerid, 0.0, 0.0, 0.05);
    playerQuakeTimer[playerid] = SetTimer("VelocityModeOne", 500, true);

    return 1;
}

forward VelocityModeOne(playerid);
public VelocityModeOne(playerid)
{
    if(playerQuakeProg[playerid] == 0)
    {
        if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
        {
            SetPlayerPos(playerid, playerPrevPos[playerid][0], playerPrevPos[playerid][1], playerPrevPos[playerid][2]);
        }
       
        else if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            SetVehiclePos(GetPlayerVehicleID(playerid), playerPrevPos[playerid][0], playerPrevPos[playerid][1], playerPrevPos[playerid][2]);
        }

        playerQuakeProg[playerid] = 1;
    }
   
    else if(playerQuakeProg[playerid] > 0)
    {
        switch(random(3))
        {
            case 0:
            {
                if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) SetPlayerVelocity(playerid, 0.03, 0.0, 0.05);
                else if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) SetVehicleVelocity(GetPlayerVehicleID(playerid), 0.03, 0.0, 0.05);
            }

            case 1:
            {
                if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) SetPlayerVelocity(playerid, 0.05, 0.0, 0.02);
                else if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) SetVehicleVelocity(GetPlayerVehicleID(playerid), 0.05, 0.0, 0.02);
            }
           
            case 2:
            {
                if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) SetPlayerVelocity(playerid, 0.01, 0.05, 0.03);
                else if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) SetVehicleVelocity(GetPlayerVehicleID(playerid), 0.05, 0.0, 0.02);
            }
        }

        SetPlayerDrunkLevel(playerid, 50000);
        playerQuakeProg[playerid] += 1;

        if(playerQuakeProg[playerid] > 6)
        {
            KillTimer(playerQuakeTimer[playerid]);
            SetTimer("VelocityModeTwo", 500, false);
        }
    }

    return 1;
}

forward VelocityModeTwo(playerid);
public VelocityModeTwo(playerid)
{
    SetPlayerDrunkLevel(playerid, 0);
    SetPlayerWeather(playerid, 0);

    playerQuakeProg[playerid] = 0;
    StopAudioStreamForPlayer(playerid);

    SendClientMessage(playerid, -1, "Earthquake ended");

    return 1;
}
Reply
#15

Quote:
Originally Posted by Mionee
Посмотреть сообщение
Yeah, you can load the changes using a public or stock function which gets called after your earthquake ends.

As for the earthquake, it's kind of simple to do. Making an exact replica might be difficult but you can always create something similar.

http://www.youtube.com/watch?v=2Vne9IKB7rw

My code might not be the best but you could use it as an example.

pawn Код:
#include <a_samp>
#include <zcmd>

new Float: playerPrevPos[MAX_PLAYERS][3];
new playerQuakeProg[MAX_PLAYERS];
new playerQuakeTimer[MAX_PLAYERS];

CMD:earthquake(playerid)
{
    new Float:Pos[3];

    SendClientMessage(playerid, -1, "Earthquake started");

    GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
    PlayAudioStreamForPlayer(playerid, "http://damianc.us/anniversary/earthquake_sound.mp3");

    SetPlayerDrunkLevel(playerid, 5001);
    SetPlayerWeather(playerid, 19);

    playerPrevPos[playerid][0] = Pos[0];
    playerPrevPos[playerid][1] = Pos[1];
    playerPrevPos[playerid][2] = Pos[2];

    SetPlayerVelocity(playerid, 0.0, 0.0, 0.05);
    playerQuakeTimer[playerid] = SetTimer("VelocityModeOne", 500, true);

    return 1;
}

forward VelocityModeOne(playerid);
public VelocityModeOne(playerid)
{
    if(playerQuakeProg[playerid] == 0)
    {
        if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
        {
            SetPlayerPos(playerid, playerPrevPos[playerid][0], playerPrevPos[playerid][1], playerPrevPos[playerid][2]);
        }
       
        else if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            SetVehiclePos(GetPlayerVehicleID(playerid), playerPrevPos[playerid][0], playerPrevPos[playerid][1], playerPrevPos[playerid][2]);
        }

        playerQuakeProg[playerid] = 1;
    }
   
    else if(playerQuakeProg[playerid] > 0)
    {
        switch(random(3))
        {
            case 0:
            {
                if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) SetPlayerVelocity(playerid, 0.03, 0.0, 0.05);
                else if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) SetVehicleVelocity(GetPlayerVehicleID(playerid), 0.03, 0.0, 0.05);
            }

            case 1:
            {
                if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) SetPlayerVelocity(playerid, 0.05, 0.0, 0.02);
                else if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) SetVehicleVelocity(GetPlayerVehicleID(playerid), 0.05, 0.0, 0.02);
            }
           
            case 2:
            {
                if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) SetPlayerVelocity(playerid, 0.01, 0.05, 0.03);
                else if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) SetVehicleVelocity(GetPlayerVehicleID(playerid), 0.05, 0.0, 0.02);
            }
        }

        SetPlayerDrunkLevel(playerid, 50000);
        playerQuakeProg[playerid] += 1;

        if(playerQuakeProg[playerid] > 6)
        {
            KillTimer(playerQuakeTimer[playerid]);
            SetTimer("VelocityModeTwo", 500, false);
        }
    }

    return 1;
}

forward VelocityModeTwo(playerid);
public VelocityModeTwo(playerid)
{
    SetPlayerDrunkLevel(playerid, 0);
    SetPlayerWeather(playerid, 0);

    playerQuakeProg[playerid] = 0;
    StopAudioStreamForPlayer(playerid);

    SendClientMessage(playerid, -1, "Earthquake ended");

    return 1;
}
Just effect? and how about after earthquake map is broken?
Reply
#16

Quote:
Originally Posted by TheFirst
Посмотреть сообщение
Just effect? and how about after earthquake map is broken?
What do you mean?

EDIT: You can remove the effect removers by editing the last public function.

pawn Код:
forward VelocityModeTwo(playerid);
public VelocityModeTwo(playerid)
{
    SetPlayerDrunkLevel(playerid, 0); // remove this
    SetPlayerWeather(playerid, 0); // remove this

    playerQuakeProg[playerid] = 0;
    StopAudioStreamForPlayer(playerid);

    SendClientMessage(playerid, -1, "Earthquake ended");

    // Mapping function redirect here

    return 1;
}
Reply
#17

Or they just put sticky bombs (satchel chargers) under the map and use command to blow them up.
Reply
#18

Quote:
Originally Posted by Mionee
Посмотреть сообщение
What do you mean?

EDIT: You can remove the effect removers by editing the last public function.

pawn Код:
forward VelocityModeTwo(playerid);
public VelocityModeTwo(playerid)
{
    SetPlayerDrunkLevel(playerid, 0); // remove this
    SetPlayerWeather(playerid, 0); // remove this

    playerQuakeProg[playerid] = 0;
    StopAudioStreamForPlayer(playerid);

    SendClientMessage(playerid, -1, "Earthquake ended");

    // Mapping function redirect here

    return 1;
}
Oh alright, I like it, with effect will be nice.

I mean when I put my mapping for earthquake and when I start earthquake... so when earthquake finished some map is broken with my mapping* do you understand me?
Reply
#19

Quote:
Originally Posted by TheFirst
Посмотреть сообщение
Just effect? and how about after earthquake map is broken?
You have to map it. Download a map editor and remove map parts and add other objects in that place. And yes, you can toggle it if you script it like that.

Also, creating invisible explosions without damage near the player's position also adds a cool shaking effect.
Reply
#20

Quote:
Originally Posted by Basssiiie
Посмотреть сообщение
You have to map it. Download a map editor and remove map parts and add other objects in that place. And yes, you can toggle it if you script it like that.

Also, creating invisible explosions without damage near the player's position also adds a cool shaking effect.
So Its possible for when invisible explosions and some my mapping will be broken 'right? like this
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)