danut Posted June 22, 2013 Report Share Posted June 22, 2013 SAlut SAMP.Am un bug la heal, cand trag in cineva scade si creste la loc.Am mai reparat bugul asta, am adaugat functia OnPlayerGiveDamage, dar nu o mai gasesc.O fi de la OnPlayerTakeDamage?public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid){ if(issuerid == INVALID_PLAYER_ID) { RealHealth[playerid] -= amount; SetPlayerHealthEx(playerid,RealHealth[playerid]); } if(issuerid != INVALID_PLAYER_ID) { SetPlayerHealthEx(playerid,RealHealth[playerid]); if(GetPlayerCameraMode(issuerid) != 53 || !IsPlayerConnected(issuerid)) return 1; if(weaponid == 24 || weaponid == 25) { { new targetplayer = GetPlayerTargetPlayer(issuerid); if(targetplayer == INVALID_PLAYER_ID) { new name[50]; new string[256]; GetPlayerName(issuerid,name,50); format(string,256,"AdmWarning: %s (%d) might be using joypad (/recon %d)",name,issuerid,issuerid); ABroadCast(COLOR_LIGHTRED,string,1); return 1; } } } } return 1;} Link to comment Share on other sites More sharing options...
roscatu Posted June 26, 2013 Report Share Posted June 26, 2013 Poi ii logic ca ii creste la loc din moment ce tu setezi sa ii dai viata de fiecare cand tragi in el. Iar cele doua trebuie inversate dupa parerea mea.Deoarece " if(issuerid == INVALID_PLAYER_ID) " inseamna ca player sa sinucis, if(issuerid != INVALID_PLAYER_ID) inseamna ca a fost ucis de cineva. Link to comment Share on other sites More sharing options...
danut Posted June 28, 2013 Author Report Share Posted June 28, 2013 Am facut ce ai zis, viata mai face ceva probleme dar nu asa de rau.Cand omor pe cineva, nu-l baga in jail.Cand am un contract pe cineva si il omor, nu se intampla nimic.Imi puteti da si mie functia OnPlayerGiveDamage? Link to comment Share on other sites More sharing options...
Staff Posted June 28, 2013 Report Share Posted June 28, 2013 http://wiki.sa-mp.com/wiki/OnPlayerGiveDamage]http://wiki.sa-mp.com/wiki/OnPlayerGiveDamage [glow=blue,2,300]SAMP.[glow=yellow,2,300]RSP-GAME[glow=red,2,300].NET[/glow][/glow][/glow] Link to comment Share on other sites More sharing options...
roscatu Posted June 28, 2013 Report Share Posted June 28, 2013 Am facut ce ai zis, viata mai face ceva probleme dar nu asa de rau.Cand omor pe cineva, nu-l baga in jail.Cand am un contract pe cineva si il omor, nu se intampla nimic.Imi puteti da si mie functia OnPlayerGiveDamage?Ar trebui sa verifici daca viata in cel care trage este 0 sau minima 5-10. Si atunci il bagi la jail :) Link to comment Share on other sites More sharing options...
Question
danut
SAlut SAMP.
Am un bug la heal, cand trag in cineva scade si creste la loc.
Am mai reparat bugul asta, am adaugat functia OnPlayerGiveDamage, dar nu o mai gasesc.
O fi de la OnPlayerTakeDamage?
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
if(issuerid == INVALID_PLAYER_ID)
{
RealHealth[playerid] -= amount;
SetPlayerHealthEx(playerid,RealHealth[playerid]);
}
if(issuerid != INVALID_PLAYER_ID)
{
SetPlayerHealthEx(playerid,RealHealth[playerid]);
if(GetPlayerCameraMode(issuerid) != 53 || !IsPlayerConnected(issuerid)) return 1;
if(weaponid == 24 || weaponid == 25)
{
{
new targetplayer = GetPlayerTargetPlayer(issuerid);
if(targetplayer == INVALID_PLAYER_ID)
{
new name[50];
new string[256];
GetPlayerName(issuerid,name,50);
format(string,256,"AdmWarning: %s (%d) might be using joypad (/recon %d)",name,issuerid,issuerid);
ABroadCast(COLOR_LIGHTRED,string,1);
return 1;
}
}
}
}
return 1;
}
Link to comment
Share on other sites
4 answers to this question
Recommended Posts