HELP : Y_INI SAVIN HEALTH / ARMOUR
#3

Quote:
Originally Posted by khRamin78
Посмотреть сообщение
you have to put something like this method

PHP код:

/*this is not that importent just for clearness do 
INI_WriteFloat(File,"Health",0.0);
INI_WriteFloat(File,"Armour",0.0);
if you want
*/
// Global value new FirstSpawn[MAX_PLAYERS];
OnPlayerConnect(playerid)
{
    
FirstSpawn[playerid] = 1; // to avoid setting player health each time they spawn
    
return 1;
}
OnPlayerSpawn(playerid)
{
    if(
FirstSpawn[playerid] == 1) // to avoid setting player health each time they spawn
    
{
        
FirstSpawn[playerid] = 0; // to avoid setting player health each time they spawn
        
SetPlayerHealth(playerid,PlayerInfo[playerid][pHealth]);
        
SetPlayerArmour(playerid,PlayerInfo[playerid][pArmour]);
    }
    return 
1;
} 

I've tried that code but didnt work (ERROR). so what must i do?

Quote:

public OnPlayerConnect(playerid)
{
new sdialog[128], rdialog[128];

if(!IsValidName(playerid)) return Kick(playerid);

SetPlayerColor(playerid, -1);

GetPlayerIp(playerid, PlayerInfo[playerid][pIP], 16);

if(fexist(UserPath(playerid)))
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
format(sdialog, sizeof(sdialog), "Welcome back, %s\n\n If you wish to login, please enter your password below.", GetName(playerid));
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Login", sdialog, "Login","Quit");
}
else
{
FirstSpawn[playerid] = 1;
format(rdialog, sizeof(rdialog), "Name: %s\n\n Enter your desired password below to register!", GetName(playerid));
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Register", rdialog ,"Register","Quit");
}
return 1;
}

Quote:

public OnPlayerSpawn(playerid)
{
if(FirstSpawn[playerid] == 1)
{
FirstSpawn[playerid] = 0;
SetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
SetPlayerArmour(playerid, PlayerInfo[playerid][pArmour]);
}
else
{
SetPlayerPos(playerid, PlayerInfo[playerid][posX], PlayerInfo[playerid][posY], PlayerInfo[playerid][posZ]);
SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
SetPlayerFacingAngle(playerid, PlayerInfo[playerid][posA]);
SetPlayerInterior(playerid, PlayerInfo[playerid][pInterior]);
SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pVW]);
SetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
SetPlayerArmour(playerid, PlayerInfo[playerid][pArmour]);
GivePlayerMoney(playerid, PlayerInfo[playerid][pMoney]);
}
return 1;
}

Reply


Messages In This Thread
HELP : Y_INI SAVIN HEALTH / ARMOUR - by hatcis - 14.11.2018, 07:54
Re: HELP : Y_INI SAVIN HEALTH / ARMOUR - by khRamin78 - 14.11.2018, 08:15
Re: HELP : Y_INI SAVIN HEALTH / ARMOUR - by hatcis - 14.11.2018, 12:39
Re: HELP : Y_INI SAVIN HEALTH / ARMOUR - by khRamin78 - 14.11.2018, 15:00
Re: HELP : Y_INI SAVIN HEALTH / ARMOUR - by khRamin78 - 14.11.2018, 15:02

Forum Jump:


Users browsing this thread: 1 Guest(s)