05.02.2018, 07:49
All wrong:
You're using format incorrectly.
OP:
format() the string in a holder then use strcat to concatenate the two. Example:
In that example, you would show szPrimaryStr as the dialogs text.
Regarding OnPlayerDeath,
you need to add a statement to check if the killerID is not INVALID_PLAYER_ID when it's relevant. i.e:
If a player suicides, killerID will be 65535 and you'll end up accessing an out of bound index.
You're using format incorrectly.
Quote:
PHP код:
|
format() the string in a holder then use strcat to concatenate the two. Example:
PHP код:
CMD:woo( playerid, params[] ) {
new szPrimaryStr[ 600 ], szSubStr[ 128 ];
format( szSubStr, sizeof szSubStr, "My player ID is : %i\n", playerid );
strcat( szPrimaryStr, szSubStr );
return 1;
}
Regarding OnPlayerDeath,
you need to add a statement to check if the killerID is not INVALID_PLAYER_ID when it's relevant. i.e:
PHP код:
if( killerid != INVALID_PLAYER_ID ) {
gPlayerKills[ killerid ] ++;
}