24.09.2013, 13:31
(
Последний раз редактировалось Youarex; 25.10.2013 в 10:38.
)
Simple textdraw to display team strength in the bottom right corner of the screen.
Few functions for ease of use: ShowRedTeamStrength(strenght); ShowBlueTeamStrength(strenght);
The rest you can figure out in the code. You have full rights to modify it:
pawn Код:/*
Generated using Zamaroht's TextDraw Editor Version 1.0.
Designed for SA-MP 0.3a.
Time and Date: 2013-9-24 @ 14:18:34
Author: Youarex
Few functions for ease of use:
ShowRedTeamStrength:
Set and display team red strength.
Parameters:
strength - Strength to be set.
Returns:
Doesn't return a specific value.
ShowRedTeamStrength(10);
ShowBlueTeamStrength:
Set and display team blue strength.
Parameters:
strength - Strength to be set.
Returns:
Doesn't return a specific value.
ShowBlueTeamStrength(10);
*/
#include <a_samp>
new Text:TeamStrength0;
new Text:TeamStrength1;
new Text:TeamStrength2;
new Text:TeamStrength3;
new Text:TeamStrength4;
new Text:TeamStrength5;
new Text:TeamsTextDraw;
public OnFilterScriptInit()
{
TeamStrength0 = TextDrawCreate(611.599975, 378.600006, " "); //r arms
TextDrawAlignment(TeamStrength0, 3);
TextDrawBackgroundColor(TeamStrength0, 255);
TextDrawFont(TeamStrength0, 1);
TextDrawLetterSize(TeamStrength0, 0.479999, -1.500000);
TextDrawColor(TeamStrength0, -16777036);
TextDrawSetOutline(TeamStrength0, 1);
TextDrawSetProportional(TeamStrength0, 1);
TextDrawSetSelectable(TeamStrength0, 0);
TeamStrength1 = TextDrawCreate(610.500000, 383.000000, " "); //r torso
TextDrawAlignment(TeamStrength1, 3);
TextDrawBackgroundColor(TeamStrength1, 255);
TextDrawFont(TeamStrength1, 1);
TextDrawLetterSize(TeamStrength1, 0.574998, -2.099998);
TextDrawColor(TeamStrength1, -16777066);
TextDrawSetOutline(TeamStrength1, 1);
TextDrawSetProportional(TeamStrength1, 1);
TextDrawSetSelectable(TeamStrength1, 0);
TeamStrength2 = TextDrawCreate(608.500000, 374.000000, " "); //r head
TextDrawAlignment(TeamStrength2, 3);
TextDrawBackgroundColor(TeamStrength2, 255);
TextDrawFont(TeamStrength2, 1);
TextDrawLetterSize(TeamStrength2, 0.397000, -1.500000);
TextDrawColor(TeamStrength2, -16777036);
TextDrawSetOutline(TeamStrength2, 1);
TextDrawSetProportional(TeamStrength2, 1);
TextDrawSetSelectable(TeamStrength2, 0);
TeamStrength3 = TextDrawCreate(611.500000, 416.000000, " "); //b arms
TextDrawAlignment(TeamStrength3, 3);
TextDrawBackgroundColor(TeamStrength3, 255);
TextDrawFont(TeamStrength3, 1);
TextDrawLetterSize(TeamStrength3, 0.479999, -1.500000);
TextDrawColor(TeamStrength3, 65480);
TextDrawSetOutline(TeamStrength3, 1);
TextDrawSetProportional(TeamStrength3, 1);
TextDrawSetSelectable(TeamStrength3, 0);
TeamStrength4 = TextDrawCreate(610.500000, 421.000000, " "); //b torso
TextDrawAlignment(TeamStrength4, 3);
TextDrawBackgroundColor(TeamStrength4, 255);
TextDrawFont(TeamStrength4, 1);
TextDrawLetterSize(TeamStrength4, 0.574998, -2.099997);
TextDrawColor(TeamStrength4, 65420);
TextDrawSetOutline(TeamStrength4, 1);
TextDrawSetProportional(TeamStrength4, 1);
TextDrawSetSelectable(TeamStrength4, 0);
TeamStrength5 = TextDrawCreate(608.500000, 412.000000, " "); //b head
TextDrawAlignment(TeamStrength5, 3);
TextDrawBackgroundColor(TeamStrength5, 255);
TextDrawFont(TeamStrength5, 1);
TextDrawLetterSize(TeamStrength5, 0.397000, -1.500000);
TextDrawColor(TeamStrength5, 65480);
TextDrawSetOutline(TeamStrength5, 1);
TextDrawSetProportional(TeamStrength5, 1);
TextDrawSetSelectable(TeamStrength5, 0);
TeamsTextDraw = TextDrawCreate(607.000000, 346.000000, "~w~Alpha Team~n~~n~~n~Beta Team~n~"); //team names
TextDrawAlignment(TeamsTextDraw, 3);
TextDrawBackgroundColor(TeamsTextDraw, 255);
TextDrawFont(TeamsTextDraw, 2);
TextDrawLetterSize(TeamsTextDraw, 0.299998, 1.399999);
TextDrawColor(TeamsTextDraw, -286331171);
TextDrawSetOutline(TeamsTextDraw, 1);
TextDrawSetProportional(TeamsTextDraw, 1);
TextDrawSetSelectable(TeamsTextDraw, 0);
return 1;
}
public OnFilterScriptExit()
{
TextDrawHideForAll(TeamStrength0);
TextDrawHideForAll(TeamStrength1);
TextDrawHideForAll(TeamStrength2);
TextDrawHideForAll(TeamStrength3);
TextDrawHideForAll(TeamStrength4);
TextDrawHideForAll(TeamStrength5);
TextDrawHideForAll(TeamsTextDraw);
TextDrawDestroy(TeamStrength0);
TextDrawDestroy(TeamStrength1);
TextDrawDestroy(TeamStrength2);
TextDrawDestroy(TeamStrength3);
TextDrawDestroy(TeamStrength4);
TextDrawDestroy(TeamStrength5);
TextDrawDestroy(TeamsTextDraw);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/show"))
{
ShowRedTeamStrength(10);
ShowBlueTeamStrength(10);
TextDrawShowForAll(TeamsTextDraw); //team names textdraw
}
if(!strcmp(cmdtext, "/hide"))
{
TextDrawHideForAll(TeamStrength0);
TextDrawHideForAll(TeamStrength1);
TextDrawHideForAll(TeamStrength2);
TextDrawHideForAll(TeamStrength3);
TextDrawHideForAll(TeamStrength4);
TextDrawHideForAll(TeamStrength5);
TextDrawHideForAll(TeamsTextDraw);
}
return 1;
}
ShowRedTeamStrength(strength)
{
#define MAX_STRENGTH 20
new rstr_arms[32] = "~r~", rstr_trso[32] = "~r~", rstr_head[64] = "~r~";
for(new i; i < strength; i++)
{
if(i < MAX_STRENGTH)
{
strcat(rstr_arms, "U");
strcat(rstr_trso, "Y");
strcat(rstr_head, " .");
}
else break;
}
#undef MAX_STRENGTH
TextDrawSetString(TeamStrength0, rstr_arms);
TextDrawShowForAll(TeamStrength0);
TextDrawSetString(TeamStrength1, rstr_trso);
TextDrawShowForAll(TeamStrength1);
TextDrawSetString(TeamStrength2, rstr_head);
TextDrawShowForAll(TeamStrength2);
}
ShowBlueTeamStrength(strength)
{
#define MAX_STRENGTH 20
new bstr_arms[32] = "~b~", bstr_trso[32] = "~b~", bstr_head[64] = "~b~";
for(new i; i < strength; i++)
{
if(i < MAX_STRENGTH)
{
strcat(bstr_arms, "U");
strcat(bstr_trso, "Y");
strcat(bstr_head, " .");
}
else break;
}
#undef MAX_STRENGTH
TextDrawSetString(TeamStrength3, bstr_arms);
TextDrawShowForAll(TeamStrength3);
TextDrawSetString(TeamStrength4, bstr_trso);
TextDrawShowForAll(TeamStrength4);
TextDrawSetString(TeamStrength5, bstr_head);
TextDrawShowForAll(TeamStrength5);
}