12.04.2010, 15:11
Hello! I just started learning textdraw, so i tried makeing a Death Streak, Kills, and Kill Streak, textdraw.
But i have some minor problems.
The kill counter works perfect, but i need a way to reset "kill Streaks" so i'd like to know that.
and the Death streak, first of all it dosen't count upwards when you die, and it has to be resetted too, but i can prob do that myself if i learn it on the kill streaks :b
So here is my codes:
Top:
OnGameModeInnit:
OnPlayerSpawn:
OnPlayerDeath:
Can any1 help me how to "reset" a textdraw to 0 on death and than it begins to count up again.
And does any1 see the problem with deaths, since it wont count when you die?
-Best Regards Naxix
But i have some minor problems.
The kill counter works perfect, but i need a way to reset "kill Streaks" so i'd like to know that.
and the Death streak, first of all it dosen't count upwards when you die, and it has to be resetted too, but i can prob do that myself if i learn it on the kill streaks :b
So here is my codes:
Top:
Код:
new Text:Kill_Streak[MAX_PLAYERS]; new Text:Kill[MAX_PLAYERS]; new Text:Deaths[MAX_PLAYERS]; new Death[MAX_PLAYERS]; new kills[MAX_PLAYERS]; new killstreak[MAX_PLAYERS];
Код:
for(new i=0;i<MAX_PLAYERS;i++) { Kill_Streak[i] = TextDrawCreate(11.000000,288.000000,"Kill Streak: 0"); TextDrawAlignment(Kill_Streak[i],0); TextDrawBackgroundColor(Kill_Streak[i],0x000000ff); TextDrawFont(Kill_Streak[i],1); TextDrawLetterSize(Kill_Streak[i],0.699999,1.600000); TextDrawColor(Kill_Streak[i],0x00ff0099); TextDrawSetOutline(Kill_Streak[i],1); TextDrawSetProportional(Kill_Streak[i],1); TextDrawSetShadow(Kill_Streak[i],1); } for(new i=0;i<MAX_PLAYERS;i++) { Kill[i] = TextDrawCreate(11.000000,273.000000,"Kills: 0"); // 273 normalt TextDrawAlignment(Kill[i],0); TextDrawBackgroundColor(Kill[i],0x000000ff); TextDrawFont(Kill[i],1); TextDrawLetterSize(Kill[i],0.699999,1.600000); TextDrawColor(Kill[i],0x00ff0099); TextDrawSetOutline(Kill[i],1); TextDrawSetProportional(Kill[i],1); TextDrawSetShadow(Kill[i],1); } for(new i=0;i<MAX_PLAYERS;i++) { Deaths[i] = TextDrawCreate(11.000000,258.000000,"Deaths: 0"); // 273 normalt TextDrawAlignment(Deaths[i],0); TextDrawBackgroundColor(Deaths[i],0x000000ff); TextDrawFont(Deaths[i],1); TextDrawLetterSize(Deaths[i],0.699999,1.600000); TextDrawColor(Deaths[i],0x00ff0099); TextDrawSetOutline(Deaths[i],1); TextDrawSetProportional(Deaths[i],1); TextDrawSetShadow(Deaths[i],1);
Код:
TextDrawShowForPlayer(playerid,Kill_Streak[playerid]); TextDrawShowForPlayer(playerid,Kill[playerid]); TextDrawShowForPlayer(playerid,Deaths[playerid]);
Код:
new szString[128]; killstreak[killerid]++; format(szString,sizeof(szString),"Kill Streak: %d",killstreak[killerid]); TextDrawSetString(Kill_Streak[killerid],szString); new szxString[128]; kills[killerid]++; format(szxString,sizeof(szxString),"Kills: %d",kills[killerid]); TextDrawSetString(Kill[killerid],szxString); new DString[128]; Death[playerid]++; format(DString,sizeof(DString),"Deaths: %d",Death[playerid]); TextDrawSetString(Deaths[playerid],DString);
And does any1 see the problem with deaths, since it wont count when you die?
-Best Regards Naxix