02.01.2010, 23:30
hey,
I have a problem with a dynamic faction system. Basically it save a faction ID in the players table in the database. The thing is it wont save when they log-out. I'll show you what i have so far. I don't see why this wont work:
it's on the playerfile stuff that dosent save the rest does
And ofcourse I have the feild in the database.
Heres a SS of the database : http://nl.tinypic.com/r/1e9k77/6
If someone could help me track down why it wont save it would be a large help.
I have a problem with a dynamic faction system. Basically it save a faction ID in the players table in the database. The thing is it wont save when they log-out. I'll show you what i have so far. I don't see why this wont work:
it's on the playerfile stuff that dosent save the rest does
pawn Код:
enum pInfo
{
bool:SpawnDance,
Float:SpawnAngle,
SpawnTimer,
pSQLId,
pPassword[128],
pRank,
pReborn,
pExp,
pVan,
pKills,
pTKills,
pGrenadekill,
pMp5kill,
pKnucklekill,
pDeaths,
pAdmin,
pGM,
pPremium,
pCash,
pWarns,
pMenugoal,
pHeligoal,
pArmourgoal,
pMapgoal,
pMuted,
pJail,
Factionid
};
pawn Код:
dcmd_acceptinvite(playerid, params[])
{
#pragma unused params
if(Finvite[playerid] >= 1)
{
new BlurBlur[256];
format(BlurBlur, sizeof(BlurBlur), "%d", Finvite[playerid]);
new string[256];
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
new membercount = djInt(BlurBlur,"Members");
djSetInt(BlurBlur,"Members", (membercount+1));
PlayerInfo[playerid][Factionid] = Finvite[playerid];
format(string, sizeof(string), "%s has joined the faction", sendername);
SendClientMessageToFaction(GREY, string, Finvite[playerid]);
Finvite[playerid] = 0;
SavePlayer(playerid);
LSPDTeam[playerid] = 0;
MafiaTeam[playerid] = 0;
return 1;
}
else return SendClientMessage(playerid, RED, "You dont have a faction invitentation");
}
pawn Код:
public SavePlayer(playerid)
{
CheckSQL();
new query[512];
format(query,sizeof(query),"UPDATE `players` SET rank=%d,reborn=%d,exp=%d,van=%d,kills=%d,tkills=%d,gkill=%d,mp5kill=%d,kkill=%d,mgoal=%d,hgoal=%d,agoal=%d,mapgoal=%d,deaths=%d,admin=%d,gm=%d,premium=%d,money=%d Factionid =%d WHERE playerid=%d",
PlayerInfo[playerid][pRank],PlayerInfo[playerid][pReborn],PlayerInfo[playerid][pExp],PlayerInfo[playerid][pVan],PlayerInfo[playerid][pKills],PlayerInfo[playerid][pTKills],PlayerInfo[playerid][pGrenadekill],PlayerInfo[playerid][pMp5kill],
PlayerInfo[playerid][pKnucklekill],PlayerInfo[playerid][pMenugoal],PlayerInfo[playerid][pHeligoal],PlayerInfo[playerid][pArmourgoal],PlayerInfo[playerid][pMapgoal],PlayerInfo[playerid][pDeaths],PlayerInfo[playerid][pAdmin],
PlayerInfo[playerid][pGM],PlayerInfo[playerid][pPremium],PlayerInfo[playerid][pCash],PlayerInfo[playerid][Factionid], PlayerInfo[playerid][pSQLId]);
mysql_query(query);
return 1;
}
Heres a SS of the database : http://nl.tinypic.com/r/1e9k77/6
If someone could help me track down why it wont save it would be a large help.