SetArmourPlayer DEFINE
#1

I would like that when a user leaves the server the user who has the armor on him not lost, use this script as filterscript to give armor users, but if you're entering the server lose the armor, please 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;
}
Reply
#2

To do this you will need to save the player's armour in some form.

In OnPlayerSpawn you will load/set the player's armour.
In OnPlayerDisconnect you will save the player's armour.

There are a lot of systems that can save/load user data.

Here's a few:
dini
yini

Alternatively, you could use a mysql plugin
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)