SA-MP Forums Archive
[FilterScript] Smoke & Flare System - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Smoke & Flare System (/showthread.php?tid=350009)

Pages: 1 2


Smoke & Flare System - Jhero - 10.06.2012

This is not a filterscript! You can add this into your script for it to function!

Smoke System

Screenshots:









pawn Код:
new PlantedSmokes[10];

CMD:placesmoke(playerid, params[])
{
    if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pMember] == 4)
    {
        new Float:playerPos[3], tmpstring[256];
        GetPlayerPos(playerid, playerPos[0], playerPos[1], playerPos[2]);
        if(FindEmptySlot() == -1) return SendClientMessage(playerid, COLOR_WHITE, "The smoke machine limit (10) has been reached, please delete some machines using /destroysmoke <1-10>");
        format(tmpstring, sizeof(tmpstring), "You have successfully placed a smoke machine! (ID: %i)", FindEmptySlot() + 1);
        SendClientMessage(playerid, COLOR_WHITE, tmpstring);
        PlantedSmokes[FindEmptySlot()] = CreateDynamicObject(2780, playerPos[0], playerPos[1], playerPos[2] - 1, 0, 0, 0);
        return 1;
    }
    else
    {
        return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use this command!");
    }
}

CMD:destroysmoke(playerid, params[])
{
    if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pMember] == 4)
    {
        new smokeid;
        if(sscanf(params, "i", smokeid))
        {
            return SendClientMessage(playerid, COLOR_WHITE, "Usage: /destroysmoke <id>");
        }
        else if (smokeid < 1 || smokeid > 10) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /destroysmoke <1-10>");
        DestroyDynamicObject(PlantedSmokes[smokeid - 1]);
        PlantedSmokes[smokeid - 1] = 0;
        return SendClientMessage(playerid, COLOR_WHITE, "You have successfully destroyed the smoke machine!");
    }
    else
    {
        return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use this command!");
    }
}

stock FindEmptySlot()
{
    new
        i = 0;
    while (i < sizeof (PlantedSmokes) && PlantedSmokes[i])
    {
        i++;
    }
    if (i == sizeof (PlantedSmokes)) return -1;
    return i;
}

Flare System

Screenshots:










pawn Код:
new PlantedFlares[10];

CMD:placeflare(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pMember] == 4)
    {
        new Float:playerPos[3], tmpstring[256];
        GetPlayerPos(playerid, playerPos[0], playerPos[1], playerPos[2]);
        ApplyAnimation(playerid, "BOMBER","BOM_Plant_Loop",4.0,0,0,0,0,0,1); // Plant bomb
        if(FindEmptySlot1() == -1) return SendClientMessage(playerid, COLOR_WHITE, "The flare limit (10) has been reached, please delete some flares using /destroyflare <1-10>");
        format(tmpstring, sizeof(tmpstring), "You have successfully placed a flare! (ID: %i)", FindEmptySlot1() + 1);
        SendClientMessage(playerid, COLOR_WHITE, tmpstring);
        PlantedFlares[FindEmptySlot1()] = CreateDynamicObject(18728, playerPos[0], playerPos[1], playerPos[2] - 1, 0, 0, 0);
        return 1;
    }
    else
    {
        return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use this command!");
    }
}

CMD:destroyflare(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pMember] == 4)
    {
        new flareid;
        if(sscanf(params, "i", flareid))
        {
            return SendClientMessage(playerid, COLOR_WHITE, "Usage: /destroyflare <id>");
        }
        else if (flareid < 1 || flareid > 10) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /destroyflare <1-10>");
        DestroyDynamicObject(PlantedFlares[flareid - 1]);
        PlantedFlares[flareid - 1] = 0;
        return SendClientMessage(playerid, COLOR_WHITE, "You have successfully destroyed the flare!");
    }
    else
    {
        return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use this command!");
    }
}

stock FindEmptySlot1()
{
    new
        i = 0;
    while (i < sizeof (PlantedFlares) && PlantedFlares[i])
    {
        i++;
    }
    if (i == sizeof (PlantedFlares)) return -1;
    return i;
}



Re: Smoke & Flare System - $HANI_DON - 11.06.2012

NOT USEFULL

but 4/10


Re: Smoke & Flare System - Dude_Lebowski - 11.06.2012

i like this very cool.


Re: Smoke & Flare System - Jhero - 11.06.2012

Quote:
Originally Posted by Dude_Lebowski
Посмотреть сообщение
i like this very cool.
Thanks.


Re : Smoke & Flare System - Vukilore - 11.06.2012

thanks, 6/10


Re: Smoke & Flare System - pasha97 - 11.06.2012

i dont see any use of it for me, but its nice


Re: Smoke & Flare System - -CaRRoT - 11.06.2012

That's really nice - Good Job , I Might use it , People who keep saying "not useful" and such shit don't know Anything About RP or how such things can be used - Again , Good Job


Re: Smoke & Flare System - MP2 - 11.06.2012

Quote:
Originally Posted by $HANI_DON
Посмотреть сообщение
NOT USEFULL
Agree.


Re: Smoke & Flare System - Jhero - 11.06.2012

Quote:
Originally Posted by Vukilore
Посмотреть сообщение
thanks, 6/10
Quote:
Originally Posted by pasha97
Посмотреть сообщение
i dont see any use of it for me, but its nice
Quote:
Originally Posted by Breto
Посмотреть сообщение
That's really nice - Good Job , I Might use it , People who keep saying "not useful" and such shit don't know Anything About RP or how such things can be used - Again , Good Job
Thanks.


Re: Smoke & Flare System - Littlehelper - 11.06.2012

Not useful at all, at least not for me.
However, good release as your first one.


Re: Smoke & Flare System - CarterIV - 11.06.2012

I have 1 erorr please help me [Sory for bad english]
Код:
C:\Documents and Settings\USER\Desktop\BR\gamemodes\BR.pwn(22688) : error 017: undefined symbol "params"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
1 Error.
Код:
if(strcmp(cmd, "/unistivatromet", true) == 0)
{
    if(PlayerInfo[playerid][pAdmin] >= 2 )
    {
        new flareid;
        if(sscanf(params, "i", flareid))
        {
            return SendClientMessage(playerid, COLOR_WHITE, "Usage: /unistivatromet <id>");
        }
        else if (flareid < 1 || flareid > 10) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /unistivatromet <1-10>");
        DestroyDynamicObject(PlantedFlares[flareid - 1]);
        PlantedFlares[flareid - 1] = 0;
        return SendClientMessage(playerid, COLOR_WHITE, "Uspjeљno ste uniљtili flare!");
    }
    else
    {
        return SendClientMessage(playerid, COLOR_GRAD1, "Nemate dopuљtenje koristiti ovu naredbu!");
    }
}



Re: Smoke & Flare System - Orhun_Kaya - 12.06.2012

thanks man


Re: Smoke & Flare System - aksharma97 - 12.06.2012

i dont like the smoke system, i like the flare system.

Good Job. Very nice


Re: Smoke & Flare System - Jhero - 12.06.2012

Quote:
Originally Posted by Orhun_Kaya
Посмотреть сообщение
thanks man
Quote:
Originally Posted by aksharma97
Посмотреть сообщение
i dont like the smoke system, i like the flare system.

Good Job. Very nice
Thanks.

@CarterIV - I'll script a fix for you.


Re: Smoke & Flare System - sherlock - 12.06.2012

Not bad, but you should remove the admin system part from it so noobs don't have to type it out or something XD the script itself is a simple one, but doesn't mean there is anything wrong with a simple script.


Re: Smoke & Flare System - davve95 - 14.06.2012

Nice! .


Re: Smoke & Flare System - Jhero - 15.06.2012

Quote:
Originally Posted by sherlock
Посмотреть сообщение
Not bad, but you should remove the admin system part from it so noobs don't have to type it out or something XD the script itself is a simple one, but doesn't mean there is anything wrong with a simple script.
Thanks, I'll remove the admin part.

Quote:
Originally Posted by davve95
Посмотреть сообщение
Nice! .
Thanks!


Re: Smoke & Flare System - Aleluja - 15.06.2012

Nice idea.


Re: Smoke & Flare System - Jhero - 15.06.2012

Quote:
Originally Posted by Aleluja
Посмотреть сообщение
Nice idea.
Thanks!


Re: Smoke & Flare System - coolfool - 16.06.2012

Been loving this on my RP server man! Keep up the good work!!!