Save Killstreak configuration with Y_ini
#1

Hi all,
How to save KillStreak configuration with y_ini?
Example: A player configures her killstreaks ;

3 Kill -> Restore Heal
3 Kill (alternative) -> Restore Armour

I would like that when its configuration is set, save in a file

Others example :

If selected Restore heal, every 3 kill, life is recharged.
If selected Restore armour, every 3 kill, armour is recharged.

The connection must remain saved, so that it stays in your account.

If you have not got it right explain it better, sorry for my english.
Thanks in advance
Reply
#2

pawn Код:
new KS[MAX_PLAYERS];
public OnPlayerDeath(playerid,killerid,reason)
{
    KS[killerid]++;
    KS[playerid] = 0;
    return 1;
}

stock SaveKS(playerid) // Use this when the player disconnected or where ever you use it!
{
     INI_WriteInt(file dest,"Killstreak",KS);
     INI_Close(File);
     return 1;
}
Reply
#3

hmm, But how do such configure :

I have selected Restore Heal 3 KillStreak, in the file :

3 KillStreak : 1 or 2 (1 : Heal, 2: Armour)

And in the onplayerdeath :

Код:
KillStreak[playerid] = 0;
if(killerid != INVALID_PLAYER_ID)
{
KillStreak[killerid] ++;
if(KillStreak[killerid] == 3)
{
SetPlayerHealth(playerid,100); //if selected Restore Health
// ... script check file cfg killstreak
SetPlayerArmour(playerid,100); //if selected restore armour
}
how can i do?
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)