19.07.2011, 15:42
(
Last edited by JaTochNietDan; 19/07/2011 at 04:17 PM.
Reason: Use the edit button.
)
now i get
and if i remove all the curly brackets i get
Thanks, i also removed all the curly brackets from that, is that against programming conventions? but it worked so im going to leave it.
however now it isn't running the code in on player death, it is supposed to insert the string from the array into the message.
nevermind i fixed it, reason 19-21 are invalid as they don't mean anything
Code:
error 008: must be a constant expression; assumed zero
Code:
error 018: initialization data exceeds declared size
Quote:
You're forgetting about the cell for the string characters to be stored in!
pawn Code:
|
however now it isn't running the code in on player death, it is supposed to insert the string from the array into the message.
Code:
public OnPlayerDeath(playerid, killerid, reason) { new string[96], deadplayer[MAX_PLAYER_NAME], killer[MAX_PLAYER_NAME]; GetPlayerName( playerid, deadplayer, sizeof(deadplayer)); GetPlayerName( killerid, killer, sizeof(killer)); if (IsPlayerConnected(killerid)) { format(string, sizeof(string), "%s killed %s, with a %s\r\n", killer, deadplayer, DeathReason[reason]); } else { format(string, sizeof(string), "%s had died from %s\r\n", deadplayer, DeathReason[reason]); } SendClientMessageToAll( COLOR_RED, string); new File:deathlog = fopen("Logs/Death Log.txt", io_append); fwrite(deathlog, string); fclose(deathlog); return 1; }