Wysłany: 2012-05-08, 11:49
maxrate
Wiek: 32 Na forum: 5167 dni Posty: 76
Nick w MP: [PPP]Mati[HA]
Piwa : 25
Opisa? by kto? jak dodac.?
Tych pablicow nie mam w mapce
Kod: public OnFilterScriptInit
Kod: public OnFilterScriptExit
Dok?adny opis co gdzie i jak??
Z g?ry Dziekuje . +
Kod: #include <a_samp>
#define SLOTY 25
new Text:HP[SLOTY];
new Text:Armour[SLOTY];
public OnFilterScriptInit()
{
SetTimer("UpdateHPArmour", 1000, 1);
for(new i=0; i<SLOTY; i++)
{
HP[i] = TextDrawCreate(552,63, "_");
TextDrawBackgroundColor(HP[i], 255);
TextDrawFont(HP[i], 1);
TextDrawLetterSize(HP[i], 0.2, 1.0);
TextDrawColor(HP[i],0xFFFFFFFF);
TextDrawSetOutline(HP[i],1);
TextDrawSetProportional(HP[i],1);
Armour[i] = TextDrawCreate(552,41, "_");
TextDrawBackgroundColor(Armour[i], 255);
TextDrawFont(Armour[i], 1);
TextDrawLetterSize(Armour[i], 0.2, 1.0);
TextDrawColor(Armour[i],0xFFFFFFFF);
TextDrawSetOutline(Armour[i],1);
TextDrawSetProportional(Armour[i],1);
}
return 1;
}
public OnFilterScriptExit()
{
for(new i=0; i<SLOTY; i++)
{
TextDrawDestroy(HP[i]);
TextDrawDestroy(Armour[i]);
}
return 1;
}
public OnPlayerSpawn(playerid)
{
TextDrawShowForPlayer(playerid, HP[playerid]);
TextDrawShowForPlayer(playerid, Armour[playerid]);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
TextDrawHideForPlayer(playerid, HP[playerid]);
TextDrawHideForPlayer(playerid, Armour[playerid]);
return 1;
}
forward UpdateHPArmour();
public UpdateHPArmour()
{
new Float:Hp[SLOTY], Float:armour[SLOTY], string[8];
for(new i = 0, j = SLOTY; i < j; ++i)
{
GetPlayerHealth(i, Hp[i]);
format(string, sizeof(string), "%.0f", Hp[i]);
TextDrawSetString(HP[i], string);
GetPlayerArmour(i, armour[i]);
if(armour[i] < 1){
TextDrawHideForPlayer(i, Armour[i]);
}else{
format(string, sizeof(string), "%.0f", armour[i]);
TextDrawSetString(Armour[i], string);
TextDrawShowForPlayer(i, Armour[i]);
}
}
return 1;
}
Wysłany: 2012-05-08, 16:19
R a p T o R
Wiek: 32 Na forum: 5150 dni Posty: 11
Nick w MP: [PGS]RapToR
Piwa : 1
pisze w przegl?darce jak cos
G?ra mapki
include <a_samp>
potem na g?rze tez
#define SLOTY 25
new Text:HP[SLOTY];
new Text:Armour[SLOTY];
i reszte kodu na samym dole
Wysłany: 2012-05-08, 16:37
ToxiC.
Wiek: 28 Na forum: 5246 dni Posty: 3792
Piwa : 8590
R a p T o R , co to ma by? za pomoc..?
U?yj Funkcji GetPlayerHealth i GetPlayerArmour
czyli:
Na g?rze :
Kod:
new Text:HP[SLOTY];
new Text:Armour[SLOTY];
P??niej Definicje:
Kod:
w OnGameModeInit [public] wklejasz:
Kod:
SetTimer("odswiezanko", 1000, 1);
for(new i=0; i<SLOTY; i++)
{
HP[i] = TextDrawCreate(552,63, "_");
TextDrawBackgroundColor(HP[i], 255);
TextDrawFont(HP[i], 1);
TextDrawLetterSize(HP[i], 0.2, 1.0);
TextDrawColor(HP[i],0xFFFFFFFF);
TextDrawSetOutline(HP[i],1);
TextDrawSetProportional(HP[i],1);
Armour[i] = TextDrawCreate(552,41, "_");
TextDrawBackgroundColor(Armour[i], 255);
TextDrawFont(Armour[i], 1);
TextDrawLetterSize(Armour[i], 0.2, 1.0);
TextDrawColor(Armour[i],0xFFFFFFFF);
TextDrawSetOutline(Armour[i],1);
TextDrawSetProportional(Armour[i],1);
}
P??niej na dole mapy lub gdzie? w ?rodku dajesz:
Kod:
forward odswiezanko();
public odswiezanko()
{
new string[50];
for(new i = 0, j = SLOTY; i < j; ++i)
{
format(string, sizeof(string), "Zycie: %d", GetPlayerHealth[i]);
TextDrawSetString(HP[i], string);
format(string, sizeof(string), "Armor: %d", GetPlayerArmour[i]);
TextDrawSetString(Armour[i], string);
}
}
return 1;
}
P??niej W OnPlayerSpawn[publicku]
Kod:
TextDrawShowForPlayer(playerid, HP[playerid]);
TextDrawShowForPlayer(playerid, Armour[playerid]);
Powinno dzia?ac chyba, robilem na szybko
Tagi: jak :: dodac :: ilos :: armour :: mapki
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: