Damages - 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: Damages (
/showthread.php?tid=616241)
Damages -
GoldenLion - 02.09.2016
Hi, I have a damage saving system which shows how many times you were shot to where and by which gun using /injuries. It's all saving in a thing like this:
Код:
new Injury[MAX_PLAYERS][MAX_BODY_PARTS][MAX_WEAPONS];
How would it be possible to store everything inside "Injury" here?:
Код:
corpseInjuries[MAX_BODY_PARTS][MAX_WEAPONS]
I have that in enum called corpseData. I need this because I want people to be able to see the injuries of a corpse.
Re: Damages -
GoldenLion - 02.09.2016
I could do it like that:
Код:
for (new i = 0; i < MAX_BODY_PARTS; i++) {
for (new j = 0; j < MAX_WEAPONS; j++) {
CorpseInjury[id][i][j] = Injury[playerid][i][j];
}
}
Re: Damages -
jwh - 02.09.2016
You're doing CorpseInjury[id][i][j] = Injury[playerid][i][j];
But...
corpseInjuries is only a multidimensional array. You're setting its data like it was a three dimensional array.
Are you sure you didn't mean to define corpseInjuries like so?:
corpseInjuries[MAX_PLAYERS][MAX_BODY_PARTS][MAX_WEAPONS]
If not, then replace this:
CorpseInjury[id][i][j] = Injury[playerid][i][j];
by this:
CorpseInjury[i][j] = Injury[playerid][i][j];
Re: Damages -
GoldenLion - 03.09.2016
Mine works perfectly.