DCMD need help
#1

So i've tried to make a DCMD command that can change an user dini's enum to a certain value.
Example "Setfaction 12 1300" [id] [Factionid]
and in users Faction to be set at 1300
I have made some code,it works,it compiles with no error,but when i type the command the Faction value does not change...Please can you guys give me an advice on how i should code it in order to work?


My code
Код:
dcmd_setfaction(playerid, params[])
{
	new
	giveplayerid,
	amount;
	if (sscanf(params, "ud", giveplayerid, amount)) SendClientMessage(playerid, 0xFF0000AA, "Usage: /setfaction [playerid] [factionid]");
	else if (giveplayerid == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xFF0000AA, "Player not found");
	else
	{
    new name[MAX_PLAYER_NAME], file[256];
    GetPlayerName(playerid, name, sizeof(name));
    format(file, sizeof(file), SERVER_USER_FILE, name);
    if (!dini_Exists(file))
    {
    SendClientMessage(playerid, 0xFF0000AA, "Player is not registred");
    }
    if(fexist(file))
    {
	PlayerInfo[playerid][pFaction] = amount;
	dini_IntSet(SERVER_USER_FILE, "Faction",PlayerInfo[playerid][pFaction]);
    }
	}
   return 1;
}
Reply


Messages In This Thread
DCMD need help - by Mikibey - 13.06.2012, 20:55
Re: DCMD need help - by Kindred - 13.06.2012, 21:05
Re: DCMD need help - by Mikibey - 13.06.2012, 21:09
Re: DCMD need help - by Mikibey - 13.06.2012, 21:13
Re: DCMD need help - by Kindred - 13.06.2012, 21:18
Re: DCMD need help - by Mikibey - 13.06.2012, 21:27
Re: DCMD need help - by Mikibey - 13.06.2012, 21:29
Re: DCMD need help - by Kindred - 13.06.2012, 21:33
Re: DCMD need help - by Mikibey - 13.06.2012, 21:37

Forum Jump:


Users browsing this thread: 2 Guest(s)