[HELP] /makevip command
#1

i have this command:
Код:
dcmd_makevip(playerid, params[])
{
    if(gPlayerInfo[playerid][PLAYER_LEVEL] < gCommands[MAKEVIP])
    {
        SendClientMessage(playerid, COLOR_RED, "You must be an Owner to use that command!");
    }
    else
    {
        new tmp[256], index, id;
        tmp = strtok(params, index);

        if(!strlen(tmp))
        {
            SendClientMessage(playerid, COLOR_ORANGE, "[MAKEVIP] Usage: /makevip [ID]");
        }
		else
		{
			id = strval(tmp);
            if(!IsPlayerConnected(id))
            {
                SendClientMessage(playerid, COLOR_ORANGE, "[MAKEVIP] That player is not connected.");
            }
            else
            {
				new owner[MAX_PLAYER_NAME];
				new string[128];
                GetPlayerName(playerid, owner, sizeof(owner));
                format(string, sizeof(string), "You got ~p~VIP ~w~from Owner: ~r~%s", owner);
				SendClientMessage(id, COLOR_LIGHTBLUE,string);
                new file[100];
                format(file, sizeof(file), PlayerFile, gPlayerInfo[playerid][PLAYER_NAME]);
                dini_IntSet(file, "Vip", 1);
                
            }
        }
    }
    return 1;
}
i tried to put value vip=1 inside admin/users/Player.ini folder soo it can store if player is or not vip, but i didnt work, you guys have any idea?
Reply
#2

gPlayerInfo[playerid][Vip] Do you have this in your Player enum? If you have it then

Replace this
pawn Код:
new file[100];
format(file, sizeof(file), PlayerFile, gPlayerInfo[playerid][PLAYER_NAME]);
dini_IntSet(file, "Vip", 1);
With this
pawn Код:
gPlayerInfo[playerid][Vip] = 1;
Reply
#3

i fixed it, thanks all
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)