21.02.2009, 16:06
Ok this is mine TextDraw stats but it only works for id 0 and 1-200 is showing the same as id 0.. how to fix this.. and smal credits to [FS]| .:[ - Vehicle Name Display by Seif - ]:.|[FS]..
And sorry for bad English
Код:
#include <a_samp> #define GREEN 0x21DD00FF #define ORANGE 0xF97804FF #define RED 0xE60000FF forward statsc(); new Text:Vehicle[MAX_PLAYERS]; new str[256]; new killed[MAX_PLAYERS]; new killer[MAX_PLAYERS]; public OnFilterScriptInit() { print(""); print(""); print(""); SetTimer("statsc",300,1); for(new playerid = 0; playerid < MAX_PLAYERS; playerid++) { Vehicle[playerid] = TextDrawCreate(10.0, 425.0,":"); TextDrawAlignment(Vehicle[playerid],0); TextDrawBackgroundColor(Vehicle[playerid],0x000000ff); TextDrawFont(Vehicle[playerid],1); TextDrawLetterSize(Vehicle[playerid],0.499999,1.100000); TextDrawColor(Vehicle[playerid],0xffffffff); TextDrawSetOutline(Vehicle[playerid],1); TextDrawSetProportional(Vehicle[playerid],1); TextDrawSetShadow(Vehicle[playerid],1); } return 1; } public OnPlayerDeath(playerid, killerid, reason) { killed[playerid]++; killer[killerid]++; return 1; } public OnFilterScriptExit() { for(new i = 0;i < MAX_PLAYERS; i++) { TextDrawHideForPlayer(i,Vehicle[i]); } return 1; } public statsc() { for(new i=0;i<MAX_PLAYERS;i++) { if (IsPlayerConnected(i)) { TextDrawHideForPlayer(i,Vehicle[i]); format(str, sizeof(str), "Stats: Killed %d Death %d" , killer, killed); TextDrawSetString(Vehicle[i],str); TextDrawShowForPlayer(i,Vehicle[i]); } } return 1; } public OnPlayerConnect(playerid) { killed[playerid] = 0; killer[playerid] = 0; statsc(); TextDrawShowForPlayer(playerid,Vehicle[playerid]); return 1; }