SA-MP Forums Archive
script help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: script help (/showthread.php?tid=596456)



script help - GeneralAref - 18.12.2015

how to make if player fire on teammate send massage hold your fire?


Re: script help - TwinkiDaBoss - 18.12.2015

Simple.
PHP код:
public OnPlayerGiveDamage(playeriddamagedidFloatamountweaponidbodypart) {
    if(
GetPlayerTeam(playerid) == GetPlayerTeam(damagedid)) {
        
SendClientMessage(playerid,COLOR_RED,"Hold your fire");
    }
    return 
true;

If you are not using SetPlayerTeam change it into your variable. Not sure if its going to work with GetPlayerTeam as there is no team fire but yeah there u go an example


Re: script help - GeneralAref - 18.12.2015

and how to make if enemy player shoot him with sniper send massage sniper!!.


Re: script help - TwinkiDaBoss - 18.12.2015

Quote:
Originally Posted by GeneralAref
Посмотреть сообщение
and how to make if enemy player shoot him with sniper send massage sniper!!.
PHP код:
public OnPlayerGiveDamage(playeriddamagedidFloatamountweaponidbodypart) {
    if(
GetPlayerTeam(playerid) == GetPlayerTeam(damagedid)) {
        
SendClientMessage(playerid,COLOR_RED,"Hold your fire");
    }
    if(
GetPlayerWeapon(playerid) == 34) {
        
SendClientMessage(damagedid,COLOR_RED,"You have been shot by a sniper");
    }
    return 
true;




Re: script help - GeneralAref - 18.12.2015

thanks