SA-MP Forums Archive
[FilterScript] Equip - 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] Equip (/showthread.php?tid=220112)



Equip - OKStyle - 03.02.2011

Decided to make a little script idea which served as the work of the police ... I think a good idea to make a pickup at a police station near the lockers with clothes, standing on a given outfit ...

Sreens:


Changelog:

1.0:
* Add Armour on body.
1.1:
* Add Armour in game;
* Add system relations object and armor.
2.0
* Add swat helmet;
* Add shield;
* Add rubber stick.
2.1:
* Add Taser.
2.2:
* Add /equipoff command.

2.3
* Fix some troubles with uneqip.

pawn Код:
/*
*   Created:    02.02.11
*   Author:     OKStyle
*   Description:    Armour 2.3
*/

#include <a_samp>
#define COLOR_INTERFACE_BODY 0xFDE39DAA
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/equip", true, 6) == 0)
    {
        if(GetPVarInt(playerid, "Equipped") != 0) return SendClientMessage(playerid, COLOR_INTERFACE_BODY, "You are already equipped!");
        if(GetPlayerSkin(playerid) < 280 || GetPlayerSkin(playerid) > 288) return SendClientMessage(playerid, COLOR_INTERFACE_BODY, "This command is available only to the servants of the law.");
        SetPlayerAttachedObject(playerid, 1, 19142,  1, 0.1,  0.05, 0.0,  0.0,   0.0,   0.0);
        SetPlayerAttachedObject(playerid, 2, 19141,  2, 0.11, 0.0,  0.0,  0.0,   0.0,   0.0);
        SetPlayerAttachedObject(playerid, 3, 18637, 13, 0.35, 0.0,  0.0,  0.0,   0.0, 180.0);
        SetPlayerAttachedObject(playerid, 4, 18642,  7, 0.1,  0.0, -0.11, 0.0, -90.0,  90.0);
        GivePlayerWeapon(playerid, 3, 1);
        SetPlayerArmour(playerid, 100.0);
        SetPVarInt(playerid, "Equipped", 1);
        SendClientMessage(playerid, COLOR_INTERFACE_BODY, "You outfits.");
        return 1;
    }
    if(strcmp(cmdtext, "/equipoff", true, 9) == 0)
    {
        if(GetPVarInt(playerid, "Equipped") != 1) return SendClientMessage(playerid, COLOR_INTERFACE_BODY, "You already unequipped!");
        new Float:ap;
        GetPlayerArmour(playerid, ap);
        if(ap > 0)
        {
            RemovePlayerAttachedObject(playerid, 1);
            SetPlayerArmour(playerid, 0.0);
        }
        RemovePlayerAttachedObject(playerid, 2);
        RemovePlayerAttachedObject(playerid, 3);
        RemovePlayerAttachedObject(playerid, 4);
        new weapons[13][2];
        for (new i; i < 13; i++)
        {
            GetPlayerWeaponData(playerid, i, weapons[i][0], weapons[i][1]);
        }
        ResetPlayerWeapons(playerid);
        for (new i; i < 13; i++)
        {
            if(i == 1) continue;
            GivePlayerWeapon(playerid, weapons[i][0], weapons[i][1]);
        }
        SetPVarInt(playerid, "Equipped", 0);
        SendClientMessage(playerid, COLOR_INTERFACE_BODY, "You undressed and disarmed.");
        return 1;
    }
    return 0;
}
public OnPlayerUpdate(playerid)
{
    if(GetPVarInt(playerid, "Equipped") == 1)
    {
        RemovePlayerAttachedObject(playerid, 1);
        new Float:ap;
        GetPlayerArmour(playerid, ap);
        if(ap > 0) SetPlayerAttachedObject(playerid, 1, 19142,  1, 0.1,  0.05, 0.0,  0.0,   0.0,   0.0);
    }
    return 1;
}
public OnFilterScriptExit()
{
    for(new i, j = GetMaxPlayers(); i != j; i++)
    {
        if(!IsPlayerConnected(i)) continue;
        if(IsPlayerNPC(i)) continue;
        if(GetPVarInt(playerid, "Equipped") != 1) continue;
        RemovePlayerAttachedObject(i, 1);
        RemovePlayerAttachedObject(i, 2);
        RemovePlayerAttachedObject(i, 3);
        RemovePlayerAttachedObject(i, 4);
    }
    return 1;
}



Re: Equip - [M.A]Angel[M.A] - 03.02.2011

Nice job.


Re: Equip - LordCumiRing - 03.02.2011

Whoaaa coool!


Re: Equip - davbad1 - 03.02.2011

Nice.


Re: Equip - GobL1N - 19.02.2011

Nice.


Re: Equip - DartakousLien - 19.02.2011

Very nice!
Like


Respuesta: Equip - 0_o.mati.o_0 - 19.02.2011

Nice FS, added to my server


Re: Equip - gostza111 - 19.03.2011

public OnPlayerUpdate(playerid)
{
new Float:ap;
GetPlayerArmour(playerid,ap);
if(ap>0)
{
SetPlayerAttachedObject(playerid,1,19142,1,0.1,0.0 5,0.0,0.0,0.0,0.0);
SetPlayerAttachedObject(playerid,2,19141,2,0.11,0. 0,0.0,0.0,0.0,0.0);
SetPlayerAttachedObject(playerid,3,18637,13,0.35,0 .0,0.0,0.0,0.0,180.0);
SetPlayerAttachedObject(playerid,4,18642,7,0.1,0.0 ,-0.11,0.0,-90.0,90.0);
}
if(ap<1)
{
RemovePlayerAttachedObject(playerid,1);
}
return 1;
}

Fix Code Object Object Spawn Automatic


Re: Equip - Mr.Youssef - 07.04.2011

cool it's work ty


Re: Equip - SpiderWalk - 17.05.2011

Cool work i am your fan


AW: Equip - Forbidden - 01.06.2011

Cool^^,but its not hard to script this


Re: Equip - OKStyle - 11.10.2011

Due to the increasing incidence of theft of my script, updated the first post topics, adding the necessary command, modifying the logic of work and opportunities.


Re: Equip - backnot - 03.01.2012

D:\DOCUME~1\Alexx\MYDOCU~1\NEWFOL~1\equip.pwn(71) : error 017: undefined symbol "playerid"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.
71:
Код:
if(GetPVarInt(playerid, "Equipped") != 1)  continue;



Re: Equip - marcelocent - 19.05.2013

#13
use "i" instead of "Playerid".

if(GetPVarInt(i, "Equipped") != 1) continue;


Re: Equip - edgargreat - 19.05.2013

Nice epuip system, usable.