24.08.2013, 19:34
hey i am trying to save player skin so when the come back the have the skin the had last but i dont know how do it with this system here is some code that helps understand what i mean
this when i do /savestats
this when players first register
and this when player logged in
i tryed dini y_ini and stuff but wont work what can i do please help
this when i do /savestats
PHP код:
dUserSetINT(PlayerName(i)).("Score", GetPlayerScore(i));
PHP код:
if(udb_Create(PlayerName(playerid),inputtext))
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have registerd. Your stats will save when you leave the game.");
LogPlayer(playerid);
PLAYERLIST_authed[playerid] = true;
dUserSetINT(PlayerName(playerid)).("Score", 0);
dUserSetINT(PlayerName(playerid)).("Cash", 1500);
dUserSetINT(PlayerName(playerid)).("BankCash", 5000);
dUserSetINT(PlayerName(playerid)).("AdminLevel", 0);
dUserSetINT(PlayerName(playerid)).("Banned", 0);
dUserSetINT(PlayerName(playerid)).("WantedLevel", 0);
dUserSetINT(PlayerName(playerid)).("Warnings", 0);
dUserSetINT(PlayerName(playerid)).("PackCash", 0);
dUserSetINT(PlayerName(playerid)).("ArmyPermission", 0);
dUserSetINT(PlayerName(playerid)).("PackPot", 0);
dUserSetINT(PlayerName(playerid)).("PackPipe", 0);
dUserSetINT(PlayerName(playerid)).("PackCondom", 0);
dUserSetINT(PlayerName(playerid)).("PackSnack", 0);
dUserSetINT(PlayerName(playerid)).("PackWallet", 0);
dUserSetINT(PlayerName(playerid)).("PackExp", 0);
dUserSetINT(PlayerName(playerid)).("HasPack", 0);
dUserSetINT(PlayerName(playerid)).("RobSkill", 0);
dUserSetINT(PlayerName(playerid)).("TerrorSkill", 0);
new pIP[16]; GetPlayerIp(playerid, pIP, 16);
dUserSet(PlayerName(playerid)).("IP", pIP);
}
return true;
}
return 1;
}//End of Register Dialog
PHP код:
if(udb_CheckLogin(PlayerName(playerid),inputtext))
{
SetPVarInt(playerid, "AdminLevel", dUserINT(PlayerName(playerid)).("AdminLevel"));
SetPVarInt(playerid, "Banned", dUserINT(PlayerName(playerid)).("Banned"));
SetPVarInt(playerid, "BankCash", dUserINT(PlayerName(playerid)).("BankCash"));
SetPVarInt(playerid, "Cash", dUserINT(PlayerName(playerid)).("Cash"));
SetPVarInt(playerid, "WantedLevel", dUserINT(PlayerName(playerid)).("WantedLevel"));
SetPVarInt(playerid, "HasPack", dUserINT(PlayerName(playerid)).("HasPack"));
SetPVarInt(playerid, "Warnings", dUserINT(PlayerName(playerid)).("Warnings"));
SetPVarInt(playerid, "PackCash", dUserINT(PlayerName(playerid)).("PackCash"));
SetPVarInt(playerid, "ArmyPermission", dUserINT(PlayerName(playerid)).("ArmyPermission"));
SetPVarInt(playerid, "PackPipe", dUserINT(PlayerName(playerid)).("PackPipe"));
SetPVarInt(playerid, "PackWallet", dUserINT(PlayerName(playerid)).("PackWallet"));
SetPVarInt(playerid, "PackCondom", dUserINT(PlayerName(playerid)).("PackCondom"));
SetPVarInt(playerid, "PackExp", dUserINT(PlayerName(playerid)).("PackExp"));
SetPVarInt(playerid, "PackSnack", dUserINT(PlayerName(playerid)).("PackSnack"));
SetPVarInt(playerid, "PackPot", dUserINT(PlayerName(playerid)).("PackPot"));
SetPVarInt(playerid, "JailTime", dUserINT(PlayerName(playerid)).("JailTime"));
SetPVarInt(playerid, "RobSkill", dUserINT(PlayerName(playerid)).("RobSkill"));
SetPVarInt(playerid, "Elite", dUserINT(PlayerName(playerid)).("Elite"));
SetPVarInt(playerid, "TerrorSkill", dUserINT(PlayerName(playerid)).("TerrorSkill"));
/*SetPVarInt(playerid, "HouseOnePerson", dUserINT(PlayerName(playerid)).("HouseOnePerson"));
SetPVarInt(palyerid, "HouseTwoPerson", dUserINT(PlayerName(playerid)).("HouseTwoPerson"));
SetPVarInt(playerid, "HouseThreePerson", dUserINT(PlayerName(playerid)).("HouseThreePerson"));
SetPVarInt(playerid, "HouseFourPerson", dUserINT(PlayerName(playerid)).("HouseFourPerson"));
SetPVarInt(playerid, "HouseFivePerson", dUserINT(PlayerName(playerid)).("HouseFivePerson"));
SetPVarInt(playerid, "HouseSixPerson", dUserINT(PlayerName(playerid))."HouseSixPerson"));*/
SetPlayerScore(playerid, dUserINT(PlayerName(playerid)).("Score"));
SetPlayerWantedLevel(playerid, GetPVarInt(playerid, "WantedLevel"));
GivePlayerMoney(playerid, GetPVarInt(playerid, "Cash"));
new pIP[16]; GetPlayerIp(playerid, pIP, 16);
dUserSet(PlayerName(playerid)).("IP", pIP);
PLAYERLIST_authed[playerid] = true;
SpawnPlayer(playerid);
return SendClientMessage(playerid, COLOR_LIGHTBLUE, "[INFO]: "COL_RWHITE"You are now logged in. Your stats will save when you leave the server.");
}
LogPlayer(playerid);
}
return 1;
}//End of Dialog