SA-MP Forums Archive
OnPlayerTakeDamage, помогите - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Русский/Russian (https://sampforum.blast.hk/forumdisplay.php?fid=32)
+---- Thread: OnPlayerTakeDamage, помогите (/showthread.php?tid=299297)



OnPlayerTakeDamage, помогите - Stepan23 - 25.11.2011

PHP код:
public OnPlayerTakeDamage(playeridissueridFloatamountweaponid)
{
    if(
issuerid != INVALID_PLAYER_ID)
    {
        new 
string[128], victim[MAX_PLAYER_NAME], attacker[MAX_PLAYER_NAME];
        
GetPlayerName(playeridvictimsizeof (victim));
        
GetPlayerName(issueridattackersizeof (attacker));
        if(
weaponid == 22SetPlayerHealth(playerid40);
        if(
weaponid == 23SetPlayerHealth(playerid40);
        if(
weaponid == 24SetPlayerHealth(playerid58);
        if(
weaponid == 25SetPlayerHealth(playerid80);
        if(
weaponid == 26SetPlayerHealth(playerid80);
        if(
weaponid == 27SetPlayerHealth(playerid80);
        if(
weaponid == 28SetPlayerHealth(playerid61);
        if(
weaponid == 29SetPlayerHealth(playerid64);
        if(
weaponid == 30SetPlayerHealth(playerid70);
        if(
weaponid == 31SetPlayerHealth(playerid73);
        if(
weaponid == 32SetPlayerHealth(playerid64);
        if(
weaponid == 33SetPlayerHealth(playerid68);
        if(
weaponid == 34SetPlayerHealth(playerid88);
        
format(stringsizeof(string),"%s выстрелил в %s."attacker,victim );
        
ProxDetector(20.0playeridstringCOLOR_PURPLE);
    }
    return 
1;

Не могу разобраться со следующем:
1. Не могу сделать чтобы писало "выстрелил в", только для тех оружий которые я указал
2. Как сделать чтобы снимало не 40хп например, а отнимало каждый раз при выстрели по 40хп
Помогите разобраться


Re: OnPlayerTakeDamage, помогите - Alexander_Petrov - 25.11.2011

PHP код:
public OnPlayerTakeDamage(playeridissueridFloatamountweaponid

    if(
issuerid != INVALID_PLAYER_ID
    { 
        new 
string[128], victim[MAX_PLAYER_NAME], attacker[MAX_PLAYER_NAME], Float:php
        
GetPlayerName(playeridvictimsizeof (victim)); 
        
GetPlayerName(issueridattackersizeof (attacker));
        
GetPlayerHealth(playeridphp);
        if(
weaponid == 22SetPlayerHealth(playeridphp-40); 
        if(
weaponid == 23SetPlayerHealth(playeridphp-40); 
        if(
weaponid == 24SetPlayerHealth(playeridphp-58); 
        if(
weaponid == 25SetPlayerHealth(playeridphp-80); 
        if(
weaponid == 26SetPlayerHealth(playeridphp-80); 
        if(
weaponid == 27SetPlayerHealth(playeridphp-80); 
        if(
weaponid == 28SetPlayerHealth(playeridphp-61); 
        if(
weaponid == 29SetPlayerHealth(playeridphp-64); 
        if(
weaponid == 30SetPlayerHealth(playeridphp-70); 
        if(
weaponid == 31SetPlayerHealth(playeridphp-73); 
        if(
weaponid == 32SetPlayerHealth(playeridphp-64); 
        if(
weaponid == 33SetPlayerHealth(playeridphp-68); 
        if(
weaponid == 34SetPlayerHealth(playeridphp-88); 
        else return 
1;
        
format(stringsizeof(string),"%s выстрелил в %s."attacker,victim ); 
        
ProxDetector(20.0playeridstringCOLOR_PURPLE); 
    } 
    return 
1




Re: OnPlayerTakeDamage, помогите - Stepan23 - 25.11.2011

Все работает, токо не пишет "выстрелил в"
С этим помогите разобраться


Re: OnPlayerTakeDamage, помогите - White_116 - 25.11.2011

ты сообщение отформатировал но не отправил!


Re: OnPlayerTakeDamage, помогите - Crystal_Speed - 25.11.2011

ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);


Re: OnPlayerTakeDamage, помогите - Stepan23 - 25.11.2011

Так а как его отправить то?


Re: OnPlayerTakeDamage, помогите - White_116 - 25.11.2011

Quote:

ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);

Не вкурсе что за фунька но тут ошибочка
Quote:

ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL_E,COLOR_PURPLE);




Re: OnPlayerTakeDamage, помогите - Stepan23 - 25.11.2011

PHP код:
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL_E,COLOR_PURPLE); 
Это мне не как не поможет, вопрос все еще в силе


Re: OnPlayerTakeDamage, помогите - White_116 - 25.11.2011

SendClientMessageToAll();


Re: OnPlayerTakeDamage, помогите - Stepan23 - 25.11.2011

Да причем тут это?
Когда я скидывал свой код там писалось "выстелил в"
Когда я поставил код "Alexander_Petrov", перестало писать