21.06.2011, 15:11
1.
Okay. Why I am getting on next log in if player logged out with 100 HP?
Here is code how I save it.
2.
Whats wrong with this command? Command just doesn't work.
Okay. Why I am getting on next log in if player logged out with 100 HP?
Код:
This is taken from players info file .ini, after logging off with 100hp. Health=1.000000 Armour=1.000000
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
new Float: health;
new Float: armour;
new name[MAX_PLAYER_NAME], file[256];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), SERVER_USER_FILE, name);
if(gPlayerLogged[playerid] == 1)
{
dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][pAdmin]);
dini_FloatSet(file, "Health",GetPlayerHealth(playerid, health));
dini_FloatSet(file, "Armour",GetPlayerArmour(playerid, armour));
dini_IntSet(file, "Cash",GetPlayerMoney(playerid));
dini_IntSet(file, "Level",GetPlayerScore(playerid));
}
gPlayerLogged[playerid] = 0;
return 1;
}
2.
Whats wrong with this command? Command just doesn't work.

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext,"/heal",true))
{
new pID, health;
if(PlayerInfo[playerid][pAdmin] >= 0)
if(!sscanf(cmdtext, "ui", pID, health))
{
SetPlayerHealth(pID, health);
SendClientMessage(playerid, -1, "You have successfully set players health!");
}
else return SendClientMessage(playerid, -1, "Usage: /heal [PlayerID][Amount]");
return 1;
}
return 1;
}