Only for no admin duty saving health.
#1

I have save system with health and armor, and when next time connect, player will be have old health and armor. but , when admin going on admin duty, server set him health and armor to 99999,i want make when is player on duty, server dont saving him health and armor to player .ini file, will be have old health and armor.

i make this, but, dont working.

Код:
public SavePlayer(playerid)
{
    if(IsLogged[playerid] == true){
	{
	new Float:health, Float:armour;
	GetPlayerHealth(playerid, health);
	GetPlayerArmour(playerid, armour);

	//
    new INI:File = INI_Open(UserPath(playerid));
    INI_SetTag(File,"data");
    INI_WriteInt(File,"Cash",PlayerInfo[playerid][pCash]);
    PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
    INI_WriteInt(File,"Level",GetPlayerScore(playerid));
    INI_WriteInt(File,"BankCash",PlayerInfo[playerid][pBankCash]);
    INI_WriteInt(File,"BankCard",PlayerInfo[playerid][pBankCard]);
    INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
    INI_WriteInt(File,"VIP",PlayerInfo[playerid][pVIP]);
   	{
   	if(gaDuty[playerid] != 0) {
    INI_WriteFloat(File, "Health", health);
    INI_WriteFloat(File, "Armour", armour);
    }
    }
    INI_WriteFloat(File, "SpawnX", PlayerInfo[playerid][pSpawnX]);
    INI_WriteFloat(File, "SpawnY", PlayerInfo[playerid][pSpawnY]);
    INI_WriteFloat(File, "SpawnZ", PlayerInfo[playerid][pSpawnZ]);
    INI_WriteFloat(File, "SpawnFacingAngle", PlayerInfo[playerid][pSpawnFacingAngle]);
    INI_Close(File);
	}
	}
	return 1;
}
sorry for my bad english. thanks
Reply
#2

bumb
Reply
#3

PHP код:
public SavePlayer(playerid)
{
    if(
IsLogged[playerid] != true)
        return 
0;
        
    new
        
Float:health,
        
Float:armour
        
;
    
GetPlayerHealth(playeridhealth);
    
GetPlayerArmour(playeridarmour);
    new
        
INI:File INI_Open(UserPath(playerid));
        
    
INI_SetTag(File,"data");
    
INI_WriteInt(File,"Cash",PlayerInfo[playerid][pCash]);
    
PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
    
INI_WriteInt(File,"Level",GetPlayerScore(playerid));
    
INI_WriteInt(File,"BankCash",PlayerInfo[playerid][pBankCash]);
    
INI_WriteInt(File,"BankCard",PlayerInfo[playerid][pBankCard]);
    
INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
    
INI_WriteInt(File,"VIP",PlayerInfo[playerid][pVIP]);
       if(
gaDuty[playerid] != true)// Yes
    
{
        
INI_WriteFloat(File"Health"health);
        
INI_WriteFloat(File"Armour"armour);
    }
    
INI_WriteFloat(File"SpawnX"PlayerInfo[playerid][pSpawnX]);
    
INI_WriteFloat(File"SpawnY"PlayerInfo[playerid][pSpawnY]);
    
INI_WriteFloat(File"SpawnZ"PlayerInfo[playerid][pSpawnZ]);
    
INI_WriteFloat(File"SpawnFacingAngle"PlayerInfo[playerid][pSpawnFacingAngle]);
    
INI_Close(File);
    return 
1;

and create a variable to storing the HP before are duty and other to ARMOUR.
Reply
#4

Quote:
Originally Posted by _Zume
Посмотреть сообщение
PHP код:
public SavePlayer(playerid)
{
    if(
IsLogged[playerid] != true)
        return 
0;
        
    new
        
Float:health,
        
Float:armour
        
;
    
GetPlayerHealth(playeridhealth);
    
GetPlayerArmour(playeridarmour);
    new
        
INI:File INI_Open(UserPath(playerid));
        
    
INI_SetTag(File,"data");
    
INI_WriteInt(File,"Cash",PlayerInfo[playerid][pCash]);
    
PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
    
INI_WriteInt(File,"Level",GetPlayerScore(playerid));
    
INI_WriteInt(File,"BankCash",PlayerInfo[playerid][pBankCash]);
    
INI_WriteInt(File,"BankCard",PlayerInfo[playerid][pBankCard]);
    
INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
    
INI_WriteInt(File,"VIP",PlayerInfo[playerid][pVIP]);
       if(
gaDuty[playerid] != true)// Yes
    
{
        
INI_WriteFloat(File"Health"health);
        
INI_WriteFloat(File"Armour"armour);
    }
    
INI_WriteFloat(File"SpawnX"PlayerInfo[playerid][pSpawnX]);
    
INI_WriteFloat(File"SpawnY"PlayerInfo[playerid][pSpawnY]);
    
INI_WriteFloat(File"SpawnZ"PlayerInfo[playerid][pSpawnZ]);
    
INI_WriteFloat(File"SpawnFacingAngle"PlayerInfo[playerid][pSpawnFacingAngle]);
    
INI_Close(File);
    return 
1;

and create a variable to storing the HP before are duty and other to ARMOUR.
thanks , but error,

warning 213: tag mismatch

on

if(gaDuty[playerid] != true)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)