15.03.2015, 21:11
That doesnt work as such...
SetPlayerAttachedObject returns 0 on success and 1 on fail, you need to assign a boolean;
SetPlayerAttachedObject returns 0 on success and 1 on fail, you need to assign a boolean;
Код:
new
bool:Shielded[MAX_PLAYERS]
;
public OnPlayerConnect(playerid)
{
Shielded[playerid] = false;
return 1;
}
if(strcmp(cmd, "/dshild", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (IsPlayerInRangeOfPoint(playerid, 6, 257.1108,78.0250,1003.6406))
{
if(!IsANg(playerid))
{
SendClientMessage(playerid,COLOR_GREY," Only army deltaforce can use this equipment.");
return 1;
}
SetPlayerAttachedObject(playerid, 8, 18637, 4, 0.3, 0, 0, 0, 170, 270, 1, 1, 1);
Shielded[playerid] = true;
return 1;
}
}
}
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
if(hittype == BULLET_HIT_TYPE_PLAYER)
{
if(Shielded[hitid]) return 0; //desync the bullet if the player has a shield.
}
return 1;
}

