My command dosent works,i need some help
#1

Код:
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))
    {
    SendClientMessage(playerid, 0xFF0000AA, "The faction has been changed");
    dini_IntSet(SERVER_USER_FILE, "Faction",PlayerInfo[playerid][pFaction] = amount);
    }
	}
	return 1;
}
So as u see its easy to understand this code,basically the server is checking if the user has a dini file,if it has,it will change its "pFaction" id to what i type after id(command is /setfaction [id] [ammount].
But for some strange reasons the command works but it does not change the value in the server's user file...what is wrong here?I did something wrong?
Reply
#2

try it this way

pawn Код:
PlayerInfo[playerid][pFaction] = amount;
dini_IntSet(SERVER_USER_FILE, "Faction",PlayerInfo[playerid][pFaction]);
Reply
#3

I tried,still dosent work
Reply
#4

So anyone can help me?
Reply
#5

So anyone pleasee
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)