[FilterScript] Smoke & Flare System
#1

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;
}
Reply
#2

NOT USEFULL

but 4/10
Reply
#3

i like this very cool.
Reply
#4

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

thanks, 6/10
Reply
#6

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

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
Reply
#8

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

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.
Reply
#10

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

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!");
    }
}
Reply
#12

thanks man
Reply
#13

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

Good Job. Very nice
Reply
#14

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.
Reply
#15

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.
Reply
#16

Nice! .
Reply
#17

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!
Reply
#18

Nice idea.
Reply
#19

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)