My command dosent works,i need some help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: My command dosent works,i need some help (
/showthread.php?tid=350674)
My command dosent works,i need some help -
Mikibey - 13.06.2012
Код:
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?
Re: My command dosent works,i need some help -
Jonny5 - 13.06.2012
try it this way
pawn Код:
PlayerInfo[playerid][pFaction] = amount;
dini_IntSet(SERVER_USER_FILE, "Faction",PlayerInfo[playerid][pFaction]);
Re: My command dosent works,i need some help -
Mikibey - 13.06.2012
I tried,still dosent work
Re: My command dosent works,i need some help -
Mikibey - 13.06.2012
So anyone can help me?
Re: My command dosent works,i need some help -
Mikibey - 13.06.2012
So anyone pleasee