public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart) { if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9) //weaponid == 34 <- sniper , bodypart == 9 <- cabeзa { new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); CreateExplosion(x, y, z, 12, 10.0); SetPlayerHealth(playerid, 0.0); GameTextForAll("~n~~n~~n~~n~~n~~n~~B~~H~HEAD ~W~~H~SHOT ~R~~H~BABY !", 5000, 3); SendClientMessage(playerid,-1, "{F55454}[INFO]: Vocк acaba de levar 1 Headshot ."); ContarHeadShot[issuerid] ++; } new Float:HP; GetPlayerHealth(playerid, HP); if(weaponid == 34) SetPlayerHealth(playerid, HP-49); //SniperRifle
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
if(0 <= GetPlayerVirtualWorld(playerid) <= 2)
{
if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9) //weaponid == 34 <- sniper , bodypart == 9 <- cabeзa
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
CreateExplosion(x, y, z, 12, 10.0);
SetPlayerHealth(playerid, 0.0);
GameTextForAll("~n~~n~~n~~n~~n~~n~~B~~H~HEAD ~W~~H~SHOT ~R~~H~BABY !", 5000, 3);
SendClientMessage(playerid,-1, "{F55454}[INFO]: Vocк acaba de levar 1 Headshot .");
ContarHeadShot[issuerid] ++;
}
new Float:HP;
GetPlayerHealth(playerid, HP);
if(weaponid == 34) SetPlayerHealth(playerid, HP-49); //SniperRifle
}
return true;
}
if(GetPlayerVirtualWorld(playerid) > 2) return true;
if(GetPlayerVirtualWorld(playerid) <= 2) return true;
O certo acho que seria:
pawn Код:
|
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
if(GetPlayerVirtualWorld(playerid) > 2) return 1;//caso nгo estiver no VW 0, 1 ou 2, nгo vai executar o code abaixo...
if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9) //weaponid == 34 <- sniper , bodypart == 9 <- cabeзa
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
CreateExplosion(x, y, z, 12, 10.0);
SetPlayerHealth(playerid, 0.0);
GameTextForAll("~n~~n~~n~~n~~n~~n~~B~~H~HEAD ~W~~H~SHOT ~R~~H~BABY !", 5000, 3);
SendClientMessage(playerid,-1, "{F55454}[INFO]: Vocк acaba de levar 1 Headshot .");
ContarHeadShot[issuerid] ++;
}
new Float:HP;
GetPlayerHealth(playerid, HP);
if(weaponid == 34) SetPlayerHealth(playerid, HP-49); //SniperRifle
return true;
}
O certo acho que seria:
pawn Код:
|