Name Color Saving?
#1

How to Save Player's Color Name?
Reply
#2

Код:
/*
Colour Save
*/

#include <a_samp>
#include <dini>

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Colour Save!");
    print("--------------------------------------\n");
    return 1;
}

#endif


public OnPlayerCommandText(playerid, cmdtext[])
{
    new file[256],name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), "%s.ini", name);

    if (strcmp("/cc 1", cmdtext, true, 10) == 0)
    {
        SetPlayerColor(playerid, 0xff0000ff);
        SendClientMessage(playerid, 0xff0000ff, "%s has changed the colour");
        return 1;
    }
    if (strcmp("/color save", cmdtext, true, 10) == 0)
    {
        if(dini_Int(file,"alreadysaved") != 0) return SendClientMessage(playerid,0xff0000ff,"Sorry , but you already saved your color once!");
        if(!dini_Int(file,"alreadysaved"))
        {
             dini_IntSet(file,"savedcolour",GetPlayerColor(playerid));
             dini_IntSet(file,"alreadysaved",1);
        }
        return 1;
    }
    return 0;
}
Reply
#3

@Blackazur use Colour code as string and not integer ^^

pawn Код:
dini_Set(file,"savedcolour",GetPlayerColor(playerid));
Reply
#4

Quote:
Originally Posted by MouseBreaker
Посмотреть сообщение
@Blackazur use Colour code as string and not integer ^^
No. Just no.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)