SA-MP Forums Archive
Save Killstreak configuration with Y_ini - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Save Killstreak configuration with Y_ini (/showthread.php?tid=379647)



Save Killstreak configuration with Y_ini - PryX0G3n - 22.09.2012

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


Re: Save Killstreak configuration with Y_ini - Kitten - 23.09.2012

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;
}



Re: Save Killstreak configuration with Y_ini - PryX0G3n - 23.09.2012

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?