Portal SAMP
Commands /swat and /delswat - Versão de Impressão

+- Portal SAMP (https://portalsamp.com)
+-- Fórum: SA-MP (https://portalsamp.com/forumdisplay.php?fid=5)
+--- Fórum: Non-Portuguese (https://portalsamp.com/forumdisplay.php?fid=34)
+---- Fórum: English (https://portalsamp.com/forumdisplay.php?fid=40)
+---- Tópico: Commands /swat and /delswat (/showthread.php?tid=2118)



Commands /swat and /delswat - Cowboy - 20/02/2022

Hello, everyone. I decided to make simple commands(DC_CMD/Pawn.CMD) for equipment SWAT. With the help of these commands, a helmet, body armor and a shield will be added to your character's hand. For all skins
[Imagem: sa-mp-12.png]

[Imagem: sa-mp-13.png]


Código:
#define ARMOUR_INDEX 4
#define ADMIN_SWAT 7
#define ADMIN_HELMETSW 8
#define ADMIN_ARMOUR 3
#define BRONIK_TERM 2
Public OnPlayerConnect

Código:
_DSWAT(playerid);
to Commands

Código:
stock _SWAT(playerid)
{
    SetPlayerAttachedObject(playerid, ADMIN_SWAT, 18637, 14, 0.0, 0.0, 0.0, 0.0, 180.0, 180.0);
    SetPlayerAttachedObject(playerid, ADMIN_ARMOUR , 19142, 1,0.08,0.04,0.00,0.0,0.0,-7.4);
    SetPlayerAttachedObject(playerid, ADMIN_HELMETSW,19141,2,0.122000,-0.008000,0.0,0.0,0.0,0.0,1.0,1.0,1.0);
    return 1;
}
stock _DSWAT(playerid)
{
    RemovePlayerAttachedObject(playerid, ADMIN_ARMOUR);
    RemovePlayerAttachedObject(playerid, ADMIN_SWAT);
    RemovePlayerAttachedObject(playerid, ADMIN_HELMETSW);
    return 1;
}
CMD:swat(playerid, params[])
{
    // your check for admin or policeman
    if(sscanf(params, "u", params[0])) return SendClientMessage(playerid, -1, "Used /swat [id player]");
    _SWAT(params[0]);
    return 1;
}
CMD:delswat(playerid, params[])
{
    // your check for admin or policeman
    if(sscanf(params, "u", params[0])) return SendClientMessage(playerid, -1, "Used /delswat [id player]");
    _DSWAT(params[0]);
    return 1;
}
Thanks for attention 


RE: Commands /swat and /delswat - Cowboy - 21/02/2022

would like to hear comments


RE: Commands /swat and /delswat - xbruno1000x - 21/02/2022

Pre-set positions will likely cause bugs in some skins. Using EditAttachedObject player can adapt to any skin.

Doc:
https://open.mp/docs/scripting/functions/EditAttachedObject


RE: Commands /swat and /delswat - Cowboy - 22/02/2022

Good idea, thanks