23.05.2011, 12:23
How to save health and armour of a user to that users .ini file? I want to save it just before the player disconnects.
public OnPlayerDisconnect(playerid, reason)
{
new pName[MAX_PLAYER_NAME];
new string[64];
GetPlayerName(playerid,pName,sizeof(pName));
format(string,sizeof(string),"/scriptfiles/Users.ini",pName);
dini_IntSet(string,"Health",GetPlayerHealth(playerid));
dini_IntSet(string,"Armour",GetPlayerArmour(playerid));
return 1;
}
C:\Documents and Settings\Labas\Desktop\MPG 2.0 R2\gamemodes\MPG.pwn(125) : warning 202: number of arguments does not match definition C:\Documents and Settings\Labas\Desktop\MPG 2.0 R2\gamemodes\MPG.pwn(126) : warning 202: number of arguments does not match definition Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Warnings.
dini_IntSet(string,"Health",GetPlayerHealth(playerid)); dini_IntSet(string,"Armour",GetPlayerArmour(playerid));
public OnPlayerDisconnect(playerid, reason)
{
new file[128];
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,sizeof(pName));
format(string,sizeof(string),"/Users/%s.ini",pName);
dini_IntSet(file, "Health", GetPlayerHealth(playerid));
dini_IntSet(file, "Armour",GetPlayerArmour(playerid)]);
return true;
}
public OnPlayerDisconnect(playerid, reason)
{
new pName[MAX_PLAYER_NAME];
new string[64];
GetPlayerName(playerid,pName,sizeof(pName));
format(string,sizeof(string),"/scriptfiles/Users.ini",pName);
new Float:health;
new Floath:armour;
dini_IntSet(string,"Health",GetPlayerHealth(playerid,health));
dini_IntSet(string,"Armour",GetPlayerArmour(playerid,armour));
return 1;
}
dini_IntSet(file,"Wanted",GetPlayerWantedLevel(playerid)); dini_IntSet(file,"Health",GetPlayerHealth(playerid)); dini_IntSet(file,"Armour",GetPlayerArmour(playerid));