SA-MP Forums Archive
Stats needed - 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: Stats needed (/showthread.php?tid=482161)



Stats needed - OnY - 19.12.2013

EDITED


Re: Stats needed - OnY - 19.12.2013

Anyone ? Please i need fast for update..


Re: Stats needed - tyler12 - 19.12.2013

This might work, I haven't tested it with strings, floats etc, but it compiles.

pawn Код:
enum stats
{
    stat1,
    stat2[64],
    Float:stat3
}
new s[MAX_PLAYERS][stats];

stock copyStats(player,target)
{
    for(new i; stats:i < stats; i++)
    {
        s[target][stats:i] = s[player][stats:i];
    }
    return 1;
}

// or in a macro

#define copyStats(%0,%1) for(new i; stats:i < stats; i++) s[%1][stats:i] = s[%0][stats:i];