Kod: Tümünü seç
/////////////////////ASSIST CODE HERE///////////
new assisters[4] = { 0, 0, 0, 0 }
new iassisters = 0
new ilastplayer = iassist[ team ]
// We just need the last player to kick the ball
// 0 means it has passed 15 at least once
if ( ilastplayer == 0 )
ilastplayer = 15
else
ilastplayer--
if ( assist[ ilastplayer ] != 0 ) {
new i, x, bool:canadd, playerid
for(i=0; i<16; i++) {
// Stop if we've already found 4 assisters
if ( iassisters == MAX_ASSISTERS )
break
playerid = assist[ i ]
// Skip if player is invalid
if ( playerid == 0 )
continue
// Skip if kicker is counted as an assister
if ( playerid == assist[ ilastplayer ] )
continue
canadd = true
// Loop through each assister value
for(x=0; x<3; x++)
// make sure we can add them
if ( playerid == assisters[ x ] ) {
canadd = false
break
}
// Skip if they've already been added
if ( canadd == false )
continue
// They didn't kick the ball last, and they haven't been added, add them
assisters[ iassisters++ ] = playerid
}
// This gives each person an assist, xp, and prints that out to them
new c, pass
for(c=0; c<iassisters; c++) {
pass = assisters[ c ]
Event_Record(pass, ASSIST, -1, EXP_ASSIST)
client_print( pass, print_chat, "%L",pass,"EXP_FOR_ASSIST",EXP_ASSIST)
}
}
iassist[ 0 ] = 0
/////////////////////ASSIST CODE HERE///////////
Kod: Tümünü seç
#define MAX_ASSISTERS 3