22.10.2014, 20:37
Bom meu server esta on, a cada 1 level ganha 1 de score, mas tem kills e deaths alguem pode me ajuda num contador de kill aparecendo na tela do player??
new Kills[MAX_PLAYERS];
new Deaths[MAX_PLAYERS];
// callback OnPlayerDeath
Kills[killerid]++;
Deaths[playerid]++;
new PIDstring[50], TIDstring[50];
format(PIDstring, sizeof PIDstring, "Kills: %i Deaths: %i"Kills[playerid], Deaths[playerid]);
format(TIDstring, sizeof TIDstring, "Kills: %i Deaths: %i"Kills[killerid], Deaths[killerid]
TextDrawSetString(Textdraw[playerid], PIDstring);
TextDrawSetString(Textdraw[killerid], TIDstring);
usei o search aqui e achei um tente dar uma olhada
Crйditos: Wesley221 PHP код:
|
CreatePlayerTextDraw
enum e_PlayerStats
{
pMatou,
pMorreu
};
new pStats[MAX_PLAYERS][e_PlayerStats];
//Texts
new PlayerText:StatusBox[MAX_SLOTS];
new PlayerText:StatusInfo[MAX_SLOTS];
new PlayerText:StatusMatou[MAX_SLOTS];
new PlayerText:StatusMorreu[MAX_SLOTS];
new Updater;
//Ongamemodeinit
Updater = SetTimer("UpdateText",1000,true);
//Ongamemodeexit
KillTimer(Updater);
//OnPlayerConnect
StatusBox[playerid] = CreatePlayerTextDraw(playerid, 621.199951, 288.220001, "usebox");
PlayerTextDrawLetterSize(playerid, StatusBox[playerid], 0.000000, 7.564816);
PlayerTextDrawTextSize(playerid, StatusBox[playerid], 493.200012, 0.000000);
PlayerTextDrawAlignment(playerid, StatusBox[playerid], 1);
PlayerTextDrawColor(playerid, StatusBox[playerid], 0);
PlayerTextDrawUseBox(playerid, StatusBox[playerid], true);
PlayerTextDrawBoxColor(playerid, StatusBox[playerid], 102);
PlayerTextDrawSetShadow(playerid, StatusBox[playerid], 0);
PlayerTextDrawSetOutline(playerid, StatusBox[playerid], 0);
PlayerTextDrawFont(playerid, StatusBox[playerid], 0);
StatusInfo[playerid] = CreatePlayerTextDraw(playerid, 517.599975, 289.706604, "~h~~y~Status:");
PlayerTextDrawLetterSize(playerid, StatusInfo[playerid], 0.449999, 1.600000);
PlayerTextDrawAlignment(playerid, StatusInfo[playerid], 1);
PlayerTextDrawColor(playerid, StatusInfo[playerid], -1);
PlayerTextDrawSetShadow(playerid, StatusInfo[playerid], 0);
PlayerTextDrawSetOutline(playerid, StatusInfo[playerid], 1);
PlayerTextDrawBackgroundColor(playerid, StatusInfo[playerid], 51);
PlayerTextDrawFont(playerid, StatusInfo[playerid], 2);
PlayerTextDrawSetProportional(playerid, StatusInfo[playerid], 1);
StatusMatou[playerid] = CreatePlayerTextDraw(playerid, 508.799987, 310.613281, "Matou:");
PlayerTextDrawLetterSize(playerid, StatusMatou[playerid], 0.449999, 1.600000);
PlayerTextDrawAlignment(playerid, StatusMatou[playerid], 1);
PlayerTextDrawColor(playerid, StatusMatou[playerid], -1);
PlayerTextDrawSetShadow(playerid, StatusMatou[playerid], 0);
PlayerTextDrawSetOutline(playerid, StatusMatou[playerid], 1);
PlayerTextDrawBackgroundColor(playerid, StatusMatou[playerid], 51);
PlayerTextDrawFont(playerid, StatusMatou[playerid], 3);
PlayerTextDrawSetProportional(playerid, StatusMatou[playerid], 1);
StatusMorreu[playerid] = CreatePlayerTextDraw(playerid, 508.000000, 330.026519, "Morreu:");
PlayerTextDrawLetterSize(playerid, StatusMorreu[playerid], 0.449999, 1.600000);
PlayerTextDrawAlignment(playerid, StatusMorreu[playerid], 1);
PlayerTextDrawColor(playerid, StatusMorreu[playerid], -1);
PlayerTextDrawSetShadow(playerid, StatusMorreu[playerid], 0);
PlayerTextDrawSetOutline(playerid, StatusMorreu[playerid], 1);
PlayerTextDrawBackgroundColor(playerid, StatusMorreu[playerid], 51);
PlayerTextDrawFont(playerid, StatusMorreu[playerid], 3);
PlayerTextDrawSetProportional(playerid, StatusMorreu[playerid], 1);
pStats[playerid][pMatou] = 0;
pStats[playerid][pMorreu] = 0;
//Onplayerdisconnect
PlayerTextDrawDestroy(playerid, PlayerText:StatusBox[playerid]);
PlayerTextDrawDestroy(playerid, PlayerText:StatusInfo[playerid]);
PlayerTextDrawDestroy(playerid, PlayerText:StatusMatou[playerid]);
PlayerTextDrawDestroy(playerid, PlayerText:StatusMorreu[playerid]);
//OnPlayerSpawn
PlayerTextDrawShow(playerid, PlayerText:StatusBox[playerid]);
PlayerTextDrawShow(playerid, PlayerText:StatusInfo[playerid]);
PlayerTextDrawShow(playerid, PlayerText:StatusMatou[playerid]);
PlayerTextDrawShow(playerid, PlayerText:StatusMorreu[playerid]);
//Onplayerdeath
pStats[playerid][pMorreu]++;
if(killerid != 0xFFFF)
{
pStats[killerid][pMatou]++;
}
public UpdateText(playerid)
{
new
str[128];
format(str, sizeof(str), "Matou: ~h~~g~%d", pStats[playerid][pMatou]);
PlayerTextDrawSetString(playerid, StatusMatou[playerid], str);
format(str, sizeof(str), "Morreu: ~h~~r~%d", pStats[playerid][pMorreu]);
PlayerTextDrawSetString(playerid, StatusMorreu[playerid], str);
return 1;
}
A textdraw nгo foi criada e vai dar erro, variбvel Textdraw nгo foi criada. E teria que usar o uma textdraw para o jogador que seria:
pawn Код:
|
Fiz um aqui para vocк bem simples...
Imagem de como ficou: http://i.imgur.com/XFOiNVW.png Cуdigo: pawn Код:
|
Fiz um aqui para vocк bem simples...
Imagem de como ficou: http://i.imgur.com/XFOiNVW.png Cуdigo: pawn Код:
|