Wysłany: 2013-06-18, 20:16
PITBULL6758
Wiek: 30 Na forum: 5971 dni Posty: 58
Nick w MP: BEZREGULY
Piwa : 5
Witam
Jak zrobi? ?eby jak gracz ma np 50hp/armor a zmieni mu sie nagle na 70 to admin dostaje komunikat ?e graczowi zmieni?o si? hp/armor
Wysłany: 2013-06-18, 22:32
IgrexolonO
Wiek: 34 Na forum: 6809 dni Posty: 1386
Piwa : 1062
OnGameModeInit:
Kod: SetTimer("@OnPlayerHealthChangeChecka", 1000, true);
Kod: new Float:oHP[MAX_PLAYERS];
forward @OnPlayerHealthChangeChecka();
@OnPlayerHealthChangeChecka()
{
for(new i;i<MAX_PLAYERS;i++)
{
if(!IsPlayerConnected(i)) return 1;
new Float:HP;
GetPlayerHealth(i, HP);
if(HP > oHP[i])
{
new message[128];
format(message, sizeof(message), "HP gracza %s uros?o z %.2f na %.2f", PlayerName(i), oHP, HP);
for(new y;y<MAX_PLAYERS;y++)
{
if(!IsPlayerAdmin(y)) return 1;
SendClientMessage(y, -1, message);
}
}
oHP[i] = HP;
}
return 1;
}
stock PlayerName(pid)
{
new n[24];
GetPlayerName(pid, n, 24);
return n;
}
[ Dodano : 2013-06-18, 22:35 ]
Oczywi?cie nie b?d? tu wspomina? o optymalizacji i innych g?wnach bo chyba u Ciebie te rzeczy wyst?puj? daleko za murzynami.
Wysłany: 2013-06-19, 08:28
PITBULL6758
Wiek: 30 Na forum: 5971 dni Posty: 58
Nick w MP: BEZREGULY
Piwa : 5
Kod: new Float:oHP[MAX_PLAYERS];
forward @OnPlayerHealthChangeChecka();
@OnPlayerHealthChangeChecka()
{
for(new i;i<MAX_PLAYERS;i++)
{
if(!IsPlayerConnected(i)) return 1;
new Float:HP;
GetPlayerHealth(i, HP);
if(HP > oHP[i])
{
new message[128];
format(message, sizeof(message), "HP gracza %s uros?o z %.2f na %.2f", PlayerName(i), oHP, HP);
for(new y;y<MAX_PLAYERS;y++)
{
if(!IsPlayerAdmin(y)) return 1;
SendClientMessage(y, -1, message);
}
}
oHP[i] = HP;
}
return 1;
}
stock PlayerName(pid)
{
new n[24];
GetPlayerName(pid, n, 24);
return n;
}
A to te? do OnGameModeInit? bo wklejam i same b??dy
Wysłany: 2013-06-19, 08:48
Gargulc
Wiek: 34 Na forum: 5196 dni Posty: 38
Nick w MP: Gargulc
Piwa : 12
To najlepiej na g?rze mapy:
Kod: new Float:oHP[MAX_PLAYERS];
A to.. gdziekolwiek:
Kod: forward @OnPlayerHealthChangeChecka();
@OnPlayerHealthChangeChecka()
{
for(new i;i<MAX_PLAYERS;i++)
{
if(!IsPlayerConnected(i)) return 1;
new Float:HP;
GetPlayerHealth(i, HP);
if(HP > oHP[i])
{
new message[128];
format(message, sizeof(message), "HP gracza %s uros?o z %.2f na %.2f", PlayerName(i), oHP, HP);
for(new y;y<MAX_PLAYERS;y++)
{
if(!IsPlayerAdmin(y)) return 1;
SendClientMessage(y, -1, message);
}
}
oHP[i] = HP;
}
return 1;
}
stock PlayerName(pid)
{
new n[24];
GetPlayerName(pid, n, 24);
return n;
}
Wysłany: 2013-06-19, 13:16
PITBULL6758
Wiek: 30 Na forum: 5971 dni Posty: 58
Nick w MP: BEZREGULY
Piwa : 5
Nie dzia?a nadal
kod:
Kod: #include <a_samp>
new Float:oHP[MAX_PLAYERS];
forward @OnPlayerHealthChangeChecka();
@OnPlayerHealthChangeChecka()
{
for(new i;i<MAX_PLAYERS;i++)
{
if(!IsPlayerConnected(i)) return 1;
new Float:HP;
GetPlayerHealth(i, HP);
if(HP > oHP[i])
{
new message[128];
format(message, sizeof(message), "HP gracza %s uros?o z %.2f na %.2f", PlayerName(i), oHP, HP);
for(new y;y<MAX_PLAYERS;y++)
{
if(!IsPlayerAdmin(y)) return 1;
SendClientMessage(y, -1, message);
}
}
oHP[i] = HP;
}
return 1;
}
stock PlayerName(pid)
{
new n[24];
GetPlayerName(pid, n, 24);
return n;
}
Wysłany: 2013-06-19, 15:13
Gargulc
Wiek: 34 Na forum: 5196 dni Posty: 38
Nick w MP: Gargulc
Piwa : 12
Nie dzia?a.. ale co nie dzia?a? Jakie? errory s?? Mo?e by? je tu pokaza?? Nie b?d? z kart wr??y? co jest ?le.. nawet jak bym umia?..
Wysłany: 2013-06-19, 15:49
PITBULL6758
Wiek: 30 Na forum: 5971 dni Posty: 58
Nick w MP: BEZREGULY
Piwa : 5
No poprostu skoczylem spadlo mi HP dalem sobie heal all i powinno wyskoczyc ze wykryto zmiane HP a nic nie wyskakuje
Wysłany: 2013-06-19, 16:04
Gargulc
Wiek: 34 Na forum: 5196 dni Posty: 38
Nick w MP: Gargulc
Piwa : 12
Kod: forward @OnPlayerHealthChangeChecka();
@OnPlayerHealthChangeChecka()
{
for(new i;i<MAX_PLAYERS;i++)
{
if(!IsPlayerConnected(i)) return 1;
new Float:HP;
GetPlayerHealth(i, HP);
if(HP > oHP[i])
{
new message[128];
format(message, sizeof(message), "HP gracza %s uros?o z %.2f na %.2f", PlayerName(i), oHP, HP);
for(new y;y<MAX_PLAYERS;y++)
{
if(!IsPlayerAdmin(y))continue;
SendClientMessage(y, -1, message);
}
}
oHP[i] = HP;
}
return 1;
}
Wysłany: 2013-06-19, 18:42
PITBULL6758
Wiek: 30 Na forum: 5971 dni Posty: 58
Nick w MP: BEZREGULY
Piwa : 5
Wysłany: 2013-06-19, 19:00
Gargulc
Wiek: 34 Na forum: 5196 dni Posty: 38
Nick w MP: Gargulc
Piwa : 12
A zalogowa?e? si? na admina? (rcon admina)
Wysłany: 2013-06-19, 19:03
PITBULL6758
Wiek: 30 Na forum: 5971 dni Posty: 58
Nick w MP: BEZREGULY
Piwa : 5
Ta,bo musia?em skorzysta? z AS
Wysłany: 2013-06-19, 19:41
Gargulc
Wiek: 34 Na forum: 5196 dni Posty: 38
Nick w MP: Gargulc
Piwa : 12
To powinno dzia?a?, bo sprawdza?em.
Kod: forward @OnPlayerHealthChangeChecka();
public @OnPlayerHealthChangeChecka(){
new Float:HP, message[128];
for(new i = 0, q = GetMaxPlayers(); i < q; i++){
if(!IsPlayerConnected(i))continue;
GetPlayerHealth(i, HP);
if(HP > oHP[i]){
format(message, sizeof(message), "HP gracza %s uros?o z %.2f na %.2f", PlayerName(i), oHP, HP);
for(new x = 0; x < q; x++){
if(!IsPlayerAdmin(x))continue;
SendClientMessage(x, -1, message);
}
}
oHP[i] = HP;
}
return 1;
}
Wysłany: 2013-06-19, 19:54
PITBULL6758
Wiek: 30 Na forum: 5971 dni Posty: 58
Nick w MP: BEZREGULY
Piwa : 5
We? w daj za??cznik tw?j kod .pwn i sprawdze gdzie blad popelnilem
Wysłany: 2013-06-19, 19:59
Gargulc
Wiek: 34 Na forum: 5196 dni Posty: 38
Nick w MP: Gargulc
Piwa : 12
Wszystko co Ci potrzebne jest ju? w tym temacie:
OnGameModeInit:
Kod: SetTimer("@OnPlayerHealthChangeChecka", 1000, true);
G?ra mapy:
Kod: new Float:oHP[MAX_PLAYERS];
No a to daj oboj?tnie gdzie:
Kod: forward @OnPlayerHealthChangeChecka();
public @OnPlayerHealthChangeChecka(){
new Float:HP, message[128];
for(new i = 0, q = GetMaxPlayers(); i < q; i++){
if(!IsPlayerConnected(i))continue;
GetPlayerHealth(i, HP);
if(HP > oHP[i]){
format(message, sizeof(message), "HP gracza %s uros?o z %.2f na %.2f", PlayerName(i), oHP, HP);
for(new x = 0; x < q; x++){
if(!IsPlayerAdmin(x))continue;
SendClientMessage(x, -1, message);
}
}
oHP[i] = HP;
}
return 1;
}
stock PlayerName(pid)
{
new n[24];
GetPlayerName(pid, n, 24);
return n;
}
Je?li jednak masz jakie? errory, to napisz jakie. Pami?taj ?e, aby wy?wietli?a Ci si? informacja o zmianie ?ycia, musisz by? zalogowany na rcona.
Wysłany: 2013-06-19, 20:05
PITBULL6758
Wiek: 30 Na forum: 5971 dni Posty: 58
Nick w MP: BEZREGULY
Piwa : 5
Ju? wiem gdzie b??d pope?ni?em dzia?a ;] piwka dla ciebie
[ Dodano : 2013-06-19, 20:24 ]
A jeszce OSTATNIE pytanie.Jak doda? ?eby pokazywa?o si? jeszcze ID gracza w komunikacie
Tagi: komunikat :: zmianie :: hp/armora
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: