Szerző Téma: Kill számláló  (Megtekintve 764 alkalommal)

Kill számláló
« Dátum: 2013. június 15. - 07:12:33 »
0 Show voters
Sziasztok!
Szükségem volna egy olyan textdrawra,ami mutatja,hogy hány embert öltél meg és hányszor haltál meg!
Elõre is köszi annak,aki tudna segíteni!
Üdv!

Kill számláló
« Válasz #1 Dátum: 2013. június 15. - 11:52:41 »
+1 Show voters

#include <a_samp>
new PlayerText:Textdraw0[MAX_PLAYERS];
new kills[MAX_PLAYERS];
new deaths[MAX_PLAYERS];
public OnFilterScriptInit()
{
print(\"\\n--------------------------------------\");
print(\" Kill TextDraw by RedDev (founded by Red-Eye)\");
print(\"--------------------------------------\\n\");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
 
public OnPlayerConnect(playerid)
{
new str[100];
format(str,sizeof(str),\"Kills: %i | Deaths: %i\",kills[playerid],deaths[playerid]);
Textdraw0[playerid] = CreatePlayerTextDraw(playerid, 237.000106, 9.540741, str);
PlayerTextDrawLetterSize(playerid, Textdraw0[playerid], 0.449999, 1.600000);
PlayerTextDrawAlignment(playerid, Textdraw0[playerid], 1);
PlayerTextDrawColor(playerid, Textdraw0[playerid], -1);
PlayerTextDrawSetShadow(playerid, Textdraw0[playerid], 0);
PlayerTextDrawSetOutline(playerid, Textdraw0[playerid], 1);
PlayerTextDrawBackgroundColor(playerid, Textdraw0[playerid], 51);
PlayerTextDrawFont(playerid, Textdraw0[playerid], 2);
PlayerTextDrawSetProportional(playerid, Textdraw0[playerid], 1);
PlayerTextDrawShow(playerid,Textdraw0[playerid]);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
kills[playerid] = 0;
deaths[playerid] = 0;
return 1;
}
 
public OnPlayerDeath(playerid, killerid, reason)
{
new str[100];
if(killerid != INVALID_PLAYER_ID)
{
kills[killerid]++;
format(str,sizeof(str),\"Kills: %i | Deaths: %i\",kills[killerid],deaths[killerid]);
PlayerTextDrawSetString(killerid,Textdraw0[killerid],str);
}
deaths[playerid]++;
format(str,sizeof(str),\"Kills: %i | Deaths: %i\",kills[playerid],deaths[playerid]);
PlayerTextDrawSetString(playerid,Textdraw0[playerid],str);
return 1;
}

 
majd nézd meg jó e, csak gyorsba dobtam össze és nem teszteltem nya byebi  :smokin:

Kill számláló
« Válasz #2 Dátum: 2013. június 16. - 06:18:43 »
0 Show voters
Idézetet írta: Red-Eye date=1371289961\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"38449\" data-ipsquote-contentclass=\"forums_Topic


#include <a_samp>
new PlayerText:Textdraw0[MAX_PLAYERS];
new kills[MAX_PLAYERS];
new deaths[MAX_PLAYERS];
public OnFilterScriptInit()
{
print(\"\\n--------------------------------------\");
print(\" Kill TextDraw by RedDev (founded by Red-Eye)\");
print(\"--------------------------------------\\n\");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
 
public OnPlayerConnect(playerid)
{
new str[100];
format(str,sizeof(str),\"Kills: %i | Deaths: %i\",kills[playerid],deaths[playerid]);
Textdraw0[playerid] = CreatePlayerTextDraw(playerid, 237.000106, 9.540741, str);
PlayerTextDrawLetterSize(playerid, Textdraw0[playerid], 0.449999, 1.600000);
PlayerTextDrawAlignment(playerid, Textdraw0[playerid], 1);
PlayerTextDrawColor(playerid, Textdraw0[playerid], -1);
PlayerTextDrawSetShadow(playerid, Textdraw0[playerid], 0);
PlayerTextDrawSetOutline(playerid, Textdraw0[playerid], 1);
PlayerTextDrawBackgroundColor(playerid, Textdraw0[playerid], 51);
PlayerTextDrawFont(playerid, Textdraw0[playerid], 2);
PlayerTextDrawSetProportional(playerid, Textdraw0[playerid], 1);
PlayerTextDrawShow(playerid,Textdraw0[playerid]);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
kills[playerid] = 0;
deaths[playerid] = 0;
return 1;
}
 
public OnPlayerDeath(playerid, killerid, reason)
{
new str[100];
if(killerid != INVALID_PLAYER_ID)
{
kills[killerid]++;
format(str,sizeof(str),\"Kills: %i | Deaths: %i\",kills[killerid],deaths[killerid]);
PlayerTextDrawSetString(killerid,Textdraw0[killerid],str);
}
deaths[playerid]++;
format(str,sizeof(str),\"Kills: %i | Deaths: %i\",kills[playerid],deaths[playerid]);
PlayerTextDrawSetString(playerid,Textdraw0[playerid],str);
return 1;
}

 
majd nézd meg jó e, csak gyorsba dobtam össze és nem teszteltem nya byebi  :smokin:
 
Kössz mester ;)

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal