SA-MP Forums Archive
Save SetArmourPlayer - 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: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Save SetArmourPlayer (/showthread.php?tid=490397)



Save SetArmourPlayer - Proxysteve - 26.01.2014

Use this code to give the armor to users, but I would have armor on him and if the user exits and falls within the server the armor stays with him, help me!

Код HTML:
#define FILTERSCRIPT

#include <a_samp>
#define COLOR_SLATEGRAY 0x708090FF
#define COLOR_LIMEGREEN 0x32CD32FF

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp("/setarmatura", cmdtext, false, 12) == 0)
    {
        if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000AA, "Non sei autorizzato a usare questo comando");
        else if((cmdtext[12] != ' ') || (cmdtext[13] == ' ') || (cmdtext[13] == '\0'))
            return SendClientMessage(playerid, 0xFF0000AA, "Usa: /setarmatura [playerid]");

        new
            targetid = strval(cmdtext[13]);

        if(!IsPlayerConnected(targetid))
            return SendClientMessage(playerid, 0xFF0000AA, "PlayerID non trovato");

        SetPlayerArmour(targetid, 100.0);
        SendClientMessage(playerid, COLOR_LIMEGREEN, "Armatura settata");
        return 1;
    }
    return 0;
}