Please Just Help Me Please Saving House Help -
Scripter12345 - 02.05.2012
It saves but none of the right things, its all a bunch of random numbers and not the numbers it meant to please help me please
This is what it saves
HousePrice = 78
HouseOwned = 111
HouseOwner = 78
HouseEnter = 1
HouseXPos = 0.000000
HouseYPos = 0.000000
HouseZPos = 0.000000
VirtualWorld = 70
pawn Код:
CMD:createhouse(playerid, params[])
{
new HousePrice;
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You must be a admin to use that command");
if(sscanf(params,"i", HousePrice)) return SendClientMessage(playerid, COLOR_GREEN, "/createhouse [houseprice]");
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
PlayerInfo[playerid][hPrice] = HousePrice;
PlayerInfo[playerid][hOwned] = 0;
PlayerInfo[playerid][XPos] = x;
PlayerInfo[playerid][YPos] = y;
PlayerInfo[playerid][ZPos] = z;
PlayerInfo[playerid][VirtualWorld] = GetPlayerVirtualWorld(playerid);
format(PlayerInfo[playerid][hOwner],24,"NoNameForThisHouse");
SendClientMessage(playerid, COLOR_GREEN, "House created");
PlayerInfo[playerid][hEnter] = AddStaticPickup(1273, -1, x, y, z, 0);
GetPlayerName(playerid,pname,sizeof(pname));
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"HousePrice", PlayerInfo[playerid][hPrice]);
INI_WriteInt(File,"HouseOwned", PlayerInfo[playerid][hOwned]);
INI_WriteInt(File,"HouseOwner", PlayerInfo[playerid][hOwner]);
INI_WriteInt(File,"HouseEnter", PlayerInfo[playerid][hEnter]);
INI_WriteFloat(File,"HouseXPos", PlayerInfo[playerid][XPos]);
INI_WriteFloat(File,"HouseYPos", PlayerInfo[playerid][YPos]);
INI_WriteFloat(File,"HouseZPos", PlayerInfo[playerid][ZPos]);
INI_WriteInt(File,"VirtualWorld", PlayerInfo[playerid][VirtualWorld]);
INI_Close(File);
return 1;
}
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
for(new i=0;i<47;i++) Weapon[playerid][i] = false;
GetPlayerPos(playerid,PlayerInfo[playerid][PosX],PlayerInfo[playerid][PosY],PlayerInfo[playerid][PosZ]);
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
INI_WriteFloat(File,"PosX",PlayerInfo[playerid][PosX]);
INI_WriteFloat(File,"PosY",PlayerInfo[playerid][PosY]);
INI_WriteFloat(File,"PosZ",PlayerInfo[playerid][PosZ]);
INI_WriteInt(File,"AdminLevel",PlayerData[playerid][AdminLevel]);
INI_WriteString(File,"AdminName",PlayerData[playerid][AdminName]);
INI_WriteInt(File,"AdminDuty",PlayerData[playerid][AdminDuty]);
INI_WriteInt(File,"AdminSkin",PlayerData[playerid][AdminSkin]);
INI_WriteInt(File,"OriginalSkin",PlayerData[playerid][OriginalSkin]);
INI_WriteString(File,"OriginalName",PlayerData[playerid][OriginalName]);
INI_WriteInt(File,"HousePrice", PlayerInfo[playerid][hPrice]);
INI_WriteInt(File,"HouseOwned", PlayerInfo[playerid][hOwned]);
INI_WriteInt(File,"HouseOwner", PlayerInfo[playerid][hOwner]);
INI_WriteInt(File,"HouseEnter", PlayerInfo[playerid][hEnter]);
INI_WriteFloat(File,"HouseXPos", PlayerInfo[playerid][XPos]);
INI_WriteFloat(File,"HouseYPos", PlayerInfo[playerid][YPos]);
INI_WriteFloat(File,"HouseZPos", PlayerInfo[playerid][ZPos]);
INI_WriteInt(File,"VirtualWorld", PlayerInfo[playerid][VirtualWorld]);
INI_Close(File);
}
Thank You
Please Help Me Please
Re: Please Just Help Me Please Saving House Help -
Azazelo - 02.05.2012
Try to hide OnPlayerDisconnect code by /* */ comment and see if this overwrite you createhouse command.