SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts

Reply
 
Thread Tools Display Modes
Old 29/06/2012, 06:07 AM   #1
Sig Hansen
Banned
 
Join Date: Jun 2012
Location: WC
Posts: 241
Reputation: 40
Default [FS]Mine System

This fs add to your server the ability to install mine.

Commands:
/ mine-mine setting

-Each player can have only 1 minute. Following a mine can be placed after the first burst.
-After installation, run 10 second timer, after which the mine is activated and after every player will be on it, it will work.


PasteBin: http://pastebin.com/bhH6jEm3

Leave me a comment + rep, Thank You
Sig Hansen is offline   Reply With Quote
Old 29/06/2012, 06:35 AM   #2
newbienoob
Gangsta
 
Join Date: Jan 2012
Location: Somewhere over the rainbow in the gold pot!
Posts: 976
Reputation: 138
Default Re: [FS]Mine System

Looks similar to this
http://forum.sa-mp.com/showthread.php?t=292233
newbienoob is offline   Reply With Quote
Old 29/06/2012, 06:38 AM   #3
Sig Hansen
Banned
 
Join Date: Jun 2012
Location: WC
Posts: 241
Reputation: 40
Default Re: [FS]Mine System

But is a diffrent.....
Sig Hansen is offline   Reply With Quote
Old 29/06/2012, 06:41 AM   #4
newbienoob
Gangsta
 
Join Date: Jan 2012
Location: Somewhere over the rainbow in the gold pot!
Posts: 976
Reputation: 138
Default Re: [FS]Mine System

"Your" script

pawn Code:
/*
 ==================================================
 |[FS]Mine by Sig Hansen and Shane Beddow         |
 ==================================================
*/


#include <a_samp>

#define WHITE   0xFFFFFFFF

new countpos[MAX_PLAYERS];
new timer[MAX_PLAYERS];
new Text3D:laber[MAX_PLAYERS];
new mine[MAX_PLAYERS][2];
new status[MAX_PLAYERS];
new minePickup[MAX_PLAYERS];

public OnFilterScriptInit()
{
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext,"/mine",true)==0)
    {
        if (IsPlayerInAnyVehicle(playerid))
        {
            SendClientMessage(playerid, WHITE, " You're in the car, so you are prohibited from using the command!!");
            return 1;
        }
        if(status[playerid] == 1)
        {
            SendClientMessage(playerid, WHITE, " You have already established a mine!");
            return 1;
        }
        new Float:X, Float:Y, Float:Z;
        GetPlayerPos(playerid, X, Y, Z);
        mine[playerid][0] = CreateObject(2992, X, Y, Z-0.85, 0.0, 0.0, 0.0);
        mine[playerid][1] = CreateObject(19290, X, Y, Z-0.85, 0.0, 0.0, 0.0);
        status[playerid] = 1;
        countpos[playerid] = 11;
        dtext(playerid);
        return 1;
    }
    return 0;
}



forward dtext(playerid);
public dtext(playerid)
{
    timer[playerid] = SetTimerEx("dtext", 1000, 0, "i", playerid);
    new Float:X, Float:Y, Float:Z;
    GetObjectPos(mine[playerid][0], X, Y, Z);
    if(countpos[playerid] == 11)
    {
        laber[playerid] = Create3DTextLabel("to activate the left: \n10 seconds!",0x00F900AA,X,Y,Z+1,40.0,0);
        countpos[playerid] = 10;
    }
    else if(countpos[playerid] == 10)
    {
        Update3DTextLabelText(laber[playerid], 0x64F801AA, "to activate the left: \n9 seconds!");
        countpos[playerid] = 9;
    }
    else if(countpos[playerid] == 9)
    {
        Update3DTextLabelText(laber[playerid], 0xBAF801AA, "to activate the left: \n8 seconds!");
        countpos[playerid] = 8;
    }
    else if(countpos[playerid] == 8)
    {
        Update3DTextLabelText(laber[playerid], 0xDAF900AA, "to activate the left: \n7 seconds!");
        countpos[playerid] = 7;
    }
    else if(countpos[playerid] == 7)
    {
        Update3DTextLabelText(laber[playerid], 0xFCEB18AA, "to activate the left: \n6 seconds!");
        countpos[playerid] = 6;
    }
    else if(countpos[playerid] == 6)
    {
        Update3DTextLabelText(laber[playerid], 0xFCCE18AA, "to activate the left: \n5 seconds!");
        countpos[playerid] = 5;
    }
    else if(countpos[playerid] == 5)
    {
        Update3DTextLabelText(laber[playerid], 0xFBA71AAA, "to activate the left: \n4 seconds!");
        countpos[playerid] = 4;
    }
    else if(countpos[playerid] == 4)
    {
        Update3DTextLabelText(laber[playerid], 0xFA6F1BAA, "to activate the left: \n3 seconds!");
        countpos[playerid] = 3;
    }
    else if(countpos[playerid] == 3)
    {
        Update3DTextLabelText(laber[playerid], 0xFA421BAA, "to activate the left: \n2 seconds!");
        countpos[playerid] = 2;
    }
    else if(countpos[playerid] == 2)
    {
        Update3DTextLabelText(laber[playerid], 0xFF0F0FAA, "to activate the left: \n1 second!");
        countpos[playerid] = 1;
    }
    else if(countpos[playerid] == 1)
    {

        KillTimer(timer[playerid]);
        Delete3DTextLabel(laber[playerid]);
        countpos[playerid] = 0;
        minePickup[playerid] = CreatePickup(0, 1, X, Y, Z, -1);
    }
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(!IsPlayerConnected(i)) {continue;}
        if(status[i] == 0) {continue;}
        if(pickupid == minePickup[i])
        {
            new Float:X, Float:Y, Float:Z;
            GetObjectPos(mine[i][0], X, Y, Z);
            CreateExplosion(X, Y, Z, 7, 1);
            DestroyPickup(minePickup[i]);
            DestroyObject(mine[i][0]);
            DestroyObject(mine[i][1]);
            status[i] = 0;
        }
    }
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    if(status[playerid] == 1)
    {
        DestroyPickup(minePickup[playerid]);
        DestroyObject(mine[playerid][0]);
        DestroyObject(mine[playerid][1]);
        status[playerid] = 0;
        KillTimer(timer[playerid]);
        Delete3DTextLabel(laber[playerid]);
    }
    return 1;
}

Original script
pawn Code:
//-----Mines---
forward dtext(playerid);
forward vdtext(playerid);

//------Mines--------
new countpos[MAX_PLAYERS];
new timer[MAX_PLAYERS];
new Text3D:laber[MAX_PLAYERS];
new mine[MAX_PLAYERS][2];
new status[MAX_PLAYERS];
new minePickup[MAX_PLAYERS];

new vcountpos[MAX_PLAYERS];
new vtimer[MAX_PLAYERS];
new Text3D:vlaber[MAX_PLAYERS];
new vmine[MAX_PLAYERS][2];
new vstatus[MAX_PLAYERS];
new vminePickup[MAX_PLAYERS];

public dtext(playerid)
{
    timer[playerid] = SetTimerEx("dtext", 1000, 0, "i", playerid);
    new Float:X, Float:Y, Float:Z;
    GetObjectPos(mine[playerid][0], X, Y, Z);
    if(countpos[playerid] == 11)
    {
        laber[playerid] = Create3DTextLabel("to activate the left: \n10 seconds!",0x00F900AA,X,Y,Z+1,40.0,0);
        countpos[playerid] = 10;
    }
    else if(countpos[playerid] == 10)
    {
        Update3DTextLabelText(laber[playerid], 0x64F801AA, "to activate the left: \n9 seconds!");
        countpos[playerid] = 9;
    }
    else if(countpos[playerid] == 9)
    {
        Update3DTextLabelText(laber[playerid], 0xBAF801AA, "to activate the left: \n8 seconds!");
        countpos[playerid] = 8;
    }
    else if(countpos[playerid] == 8)
    {
        Update3DTextLabelText(laber[playerid], 0xDAF900AA, "to activate the left: \n7 seconds!");
        countpos[playerid] = 7;
    }
    else if(countpos[playerid] == 7)
    {
        Update3DTextLabelText(laber[playerid], 0xFCEB18AA, "to activate the left: \n6 seconds!");
        countpos[playerid] = 6;
    }
    else if(countpos[playerid] == 6)
    {
        Update3DTextLabelText(laber[playerid], 0xFCCE18AA, "to activate the left: \n5 seconds!");
        countpos[playerid] = 5;
    }
    else if(countpos[playerid] == 5)
    {
        Update3DTextLabelText(laber[playerid], 0xFBA71AAA, "to activate the left: \n4 seconds!");
        countpos[playerid] = 4;
    }
    else if(countpos[playerid] == 4)
    {
        Update3DTextLabelText(laber[playerid], 0xFA6F1BAA, "to activate the left: \n3 seconds!");
        countpos[playerid] = 3;
    }
    else if(countpos[playerid] == 3)
    {
        Update3DTextLabelText(laber[playerid], 0xFA421BAA, "to activate the left: \n2 seconds!");
        countpos[playerid] = 2;
    }
    else if(countpos[playerid] == 2)
    {
        Update3DTextLabelText(laber[playerid], 0xFF0F0FAA, "to activate the left: \n1 second!");
        countpos[playerid] = 1;
    }
    else if(countpos[playerid] == 1)
    {

        KillTimer(timer[playerid]);
        Delete3DTextLabel(laber[playerid]);
        countpos[playerid] = 0;
        minePickup[playerid] = CreatePickup(0, 1, X, Y, Z, -1);
    }
    return 1;
}
public vdtext(playerid)
{
    vtimer[playerid] = SetTimerEx("vdtext", 1000, 0, "i", playerid);
    new Float:X, Float:Y, Float:Z;
    GetObjectPos(vmine[playerid][0], X, Y, Z);
    if(vcountpos[playerid] == 11)
    {
        vlaber[playerid] = Create3DTextLabel("to activate the left: \n10 seconds!",0x00F900AA,X,Y,Z+1,40.0,0);
        vcountpos[playerid] = 10;
    }
    else if(vcountpos[playerid] == 10)
    {
        Update3DTextLabelText(vlaber[playerid], 0x64F801AA, "to activate the left: \n9 seconds!");
        vcountpos[playerid] = 9;
    }
    else if(vcountpos[playerid] == 9)
    {
        Update3DTextLabelText(vlaber[playerid], 0xBAF801AA, "to activate the left: \n8 seconds!");
        vcountpos[playerid] = 8;
    }
    else if(vcountpos[playerid] == 8)
    {
        Update3DTextLabelText(vlaber[playerid], 0xDAF900AA, "to activate the left: \n7 seconds!");
        vcountpos[playerid] = 7;
    }
    else if(vcountpos[playerid] == 7)
    {
        Update3DTextLabelText(vlaber[playerid], 0xFCEB18AA, "to activate the left: \n6 seconds!");
        vcountpos[playerid] = 6;
    }
    else if(vcountpos[playerid] == 6)
    {
        Update3DTextLabelText(vlaber[playerid], 0xFCCE18AA, "to activate the left: \n5 seconds!");
        vcountpos[playerid] = 5;
    }
    else if(vcountpos[playerid] == 5)
    {
        Update3DTextLabelText(vlaber[playerid], 0xFBA71AAA, "to activate the left: \n4 seconds!");
        vcountpos[playerid] = 4;
    }
    else if(vcountpos[playerid] == 4)
    {
        Update3DTextLabelText(vlaber[playerid], 0xFA6F1BAA, "to activate the left: \n3 seconds!");
        vcountpos[playerid] = 3;
    }
    else if(vcountpos[playerid] == 3)
    {
        Update3DTextLabelText(vlaber[playerid], 0xFA421BAA, "to activate the left: \n2 seconds!");
        vcountpos[playerid] = 2;
    }
    else if(vcountpos[playerid] == 2)
    {
        Update3DTextLabelText(vlaber[playerid], 0xFF0F0FAA, "to activate the left: \n1 second!");
        vcountpos[playerid] = 1;
    }
    else if(vcountpos[playerid] == 1)
    {

        KillTimer(vtimer[playerid]);
        Delete3DTextLabel(vlaber[playerid]);
        vcountpos[playerid] = 0;
        vminePickup[playerid] = CreatePickup(0, 14, X, Y, Z, -1);
    }
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(!IsPlayerConnected(i)) {continue;}
        if(status[i] == 0) {continue;}
        if(pickupid == minePickup[i])
        {
            new Float:X, Float:Y, Float:Z;
            GetObjectPos(mine[i][0], X, Y, Z);
            CreateExplosion(X, Y, Z, 4, 1);
            CreateExplosion(X, Y, Z, 12, 1);
            DestroyPickup(minePickup[i]);
            DestroyObject(mine[i][0]);
            DestroyObject(mine[i][1]);
            status[i] = 0;
            GameTextForPlayer(playerid,"~r~You have stepped on a mine!",6000,1);
        }
    }
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(!IsPlayerConnected(i)) {continue;}
        if(vstatus[i] == 0) {continue;}
        if(pickupid == vminePickup[i])
        {
            new Float:X, Float:Y, Float:Z;
            GetObjectPos(vmine[i][0], X, Y, Z);
            CreateExplosion(X, Y, Z, 7, 1);
            DestroyPickup(vminePickup[i]);
            DestroyObject(vmine[i][0]);
            vstatus[i] = 0;
            GameTextForPlayer(playerid,"~r~You have driven over a mine!",6000,1);
        }
    }
    return 1;
}

CMD:vmine(playerid, params[])
{
        if (IsPlayerInAnyVehicle(playerid))
        {
            SendClientMessage(playerid, WHITE, " You're in the car, so you are prohibited from using the command!!");
            return 1;
        }
        if(vstatus[playerid] == 1)
        {
            SendClientMessage(playerid, WHITE, " You have already established a mine!");
            return 1;
        }
        new Float:X, Float:Y, Float:Z;
        GetPlayerPos(playerid, X, Y, Z);
        vmine[playerid][0] = CreateObject(1213, X, Y, Z-0.85, 0.0, 0.0, 0.0);
        vstatus[playerid] = 1;
        vcountpos[playerid] = 11;
        vdtext(playerid);
        return 1;
    }
CMD:mine(playerid, params[])
    {
        if (IsPlayerInAnyVehicle(playerid))
        {
            SendClientMessage(playerid, WHITE, " You're in the car, so you are prohibited from using the command!!");
            return 1;
        }
        if(status[playerid] == 1)
        {
            SendClientMessage(playerid, WHITE, " You have already established a mine!");
            return 1;
        }
        new Float:X, Float:Y, Float:Z;
        GetPlayerPos(playerid, X, Y, Z);
        mine[playerid][0] = CreateObject(1213, X, Y, Z-0.85, 0.0, 0.0, 0.0);
        status[playerid] = 1;
        countpos[playerid] = 11;
        dtext(playerid);
        return 1;
    }
newbienoob is offline   Reply With Quote
Old 29/06/2012, 06:44 AM   #5
Sig Hansen
Banned
 
Join Date: Jun 2012
Location: WC
Posts: 241
Reputation: 40
Default Re: [FS]Mine System

So you just don't like new people script for SAMP? Because you are Huge Clocker this doesn't mean you rule....
Sig Hansen is offline   Reply With Quote
Old 29/06/2012, 06:49 AM   #6
newbienoob
Gangsta
 
Join Date: Jan 2012
Location: Somewhere over the rainbow in the gold pot!
Posts: 976
Reputation: 138
Default Re: [FS]Mine System

Quote:
Originally Posted by Sig Hansen View Post
So you just don't like new people script for SAMP?
I didn't say that. But.. I don't like if someone stole other people's work. Oh btw, what happened to this?
http://forum.sa-mp.com/showthread.php?t=355155
Deleted?
newbienoob is offline   Reply With Quote
Old 29/06/2012, 11:39 AM   #7
justsomeguy
High-roller
 
justsomeguy's Avatar
 
Join Date: Apr 2010
Location: In your router..
Posts: 2,981
Reputation: 730
Default Re: [FS]Mine System

Quote:
Originally Posted by Sig Hansen View Post
So you just don't like new people script for SAMP? Because you are Huge Clocker this doesn't mean you rule....
No, he is not saying that, *Noobvoice*:"But he does have more posts! Sow he is better!".
He is kinda right, your script IS very simular, wich is suspicious.
Don't start flaming instantly, this will only get you banned.
__________________
Random Quote: "One more time and I'm gonna snap, one more time and I'm gonna snap.."-Lady Gaga.
Quote:
Originally Posted by Mean View Post
I'm pretty sure I'm alive.
justsomeguy is offline   Reply With Quote
Old 29/06/2012, 12:57 PM   #8
pasha97
Gangsta
 
pasha97's Avatar
 
Join Date: Feb 2012
Location: Voronezh,Russia
Posts: 676
Reputation: 53
Default Re: [FS]Mine System

coola & great!
__________________
Ultra Fun FreePlay:

pasha97 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[FilterScript] Police Car Mine System v1.0 Faisal_khan Filterscripts 35 09/09/2012 11:13 AM
Va Rog ma ajutati si pe mine? BoSs_S Română/Romanian 3 01/10/2011 07:20 PM
[FilterScript] Mine System! Igorek Filterscripts 10 12/04/2011 11:51 AM
Ma ajutati si pe mine va rog? Fly62 Română/Romanian 4 10/05/2010 06:22 PM
help with mine command iggy1 Help Archive 3 02/05/2010 09:50 PM


All times are GMT. The time now is 11:44 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.