Headshot work hlmet not working lel - 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: Headshot work hlmet not working lel (
/showthread.php?tid=611784)
Headshot work hlmet not working lel -
Younes44 - 10.07.2016
headshot working perfect,but when player buy helmet, headshot not working because helmet didn't destroy when i shot on head twice.. also when player dead headshot not gone
Код:
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, ""cred"Briefcase", ""cgreen"Health - "cwhite"5000$\n"cgreen"Armour - "cwhite"5500$\n"cred"Weapons\n"cgrey"Minigun Deathmatch\n"cgrey"C-Bug Deathmath\n"cgrey"Sniper Deathmatch\n"cred"Disguise Kits: 3 - 7000$\n"cred"Anti-Tear Gas Mask - 5500$\n"cgrey"Helmet -- $5500", "Select", "Cancel");
return 1;
}
public OnPlayerTakeDamage(playerid,issuerid, Float: amount, weaponid, bodypart)
{
if(issuerid != INVALID_PLAYER_ID && gHelmet[playerid] == true) return GameTextForPlayer(issuerid,"~r~Player have helmet protection",5000,3);
if(issuerid != INVALID_PLAYER_ID && AntiSK[playerid] == 1) return 0;
if((weaponid == 34/*|| weaponid == 32 || weaponid == 31 || weaponid == 30 || weaponid == 29 || weaponid == 28 || weaponid == 27 || weaponid == 26*/ || weaponid == 33) && issuerid != INVALID_PLAYER_ID && bodypart == 9)
{
SetPlayerHealth(playerid,0.0);
GameTextForPlayer(playerid,"~r~YOU GOT HEADSHOT~n~Type /buy To get Helmet",5000,3);
GameTextForPlayer(issuerid,"~r~wOw. Perfect Shot",5000,3);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
PlayerPlaySound(issuerid, 1052, 0.0, 0.0, 0.0);
RemovePlayerAttachedObject(playerid, 1);
}
any solution ??
Re: Headshot work hlmet not working lel -
PrO.GameR - 11.07.2016
if(issuerid != INVALID_PLAYER_ID && gHelmet[playerid] == true)
-> you need to remove the helmet here
PHP код:
(issuerid != INVALID_PLAYER_ID && gHelmet[playerid] == true)
{
gHelmet[playerid]=false; // << There, as simple as that
return GameTextForPlayer(issuerid,"~r~Player have helmet protection",5000,3);
}
Stop copy pasting code from random places, seriously.