28.05.2014, 22:00
Alguйm poderia me arrumar o /info para mostra quantos matou e morreu ?
em zcmd obg + rep
em zcmd obg + rep
public OnPlayerDeath(playerid, killerid, reason)
{
PlayerInfo[playerid][morreu]++;
PlayerInfo[killerid][matou]++;
return 1;
}
CMD:info(playerid)
{
new str[64];
format(str, sizeof(str), "Matou: %i | Morreu: %i", PlayerInfo[playerid][matou], PlayerInfo[playerid][morreu]);
SendClientMessage(playerid, -1, str);
return 1;
}
Й um cуdigo tгo simples que nгo precisa explicar muito...
PlayerInfo[playerid][morreu]++ => ++ acrescenta um, mesma coisa que isso: PlayerInfo[playerid][morreu]+= 1 ou isso: PlayerInfo[playerid][morreu] = PlayerInfo[playerid][morreu] + 1 Substitua o PlayerInfo pelo seu enum... pawn Код:
|
enum PlayerInfo
{
enum Player
{
var,
var,
var
}
new PlayerInfo[MAX_PLAYERS][Player];
C:\Users\Leandro\Desktop\TreinoX1.pwn(327) : error 028: invalid subscript (not an array or too many subscripts): "pInfo"
C:\Users\Leandro\Desktop\TreinoX1.pwn(327) : warning 215: expression has no effect
C:\Users\Leandro\Desktop\TreinoX1.pwn(327) : error 001: expected token: ";", but found "]"
C:\Users\Leandro\Desktop\TreinoX1.pwn(327) : error 029: invalid expression, assumed zero
C:\Users\Leandro\Desktop\TreinoX1.pwn(327) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
pInfo[playerid][morreu]++;
PlayerInfo[playerid][morreu]++;