Bulletproof shield.
#2

That doesnt work as such...
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;
}
Reply


Messages In This Thread
Bulletproof shield. - by kepa333 - 15.03.2015, 20:57
Re: Bulletproof shield. - by Evocator - 15.03.2015, 21:11
Re: Bulletproof shield. - by kepa333 - 15.03.2015, 21:29
Re: Bulletproof shield. - by Smileys - 15.03.2015, 22:55
Re: Bulletproof shield. - by Sew_Sumi - 15.03.2015, 23:00
Re: Bulletproof shield. - by Crayder - 15.03.2015, 23:05
Re: Bulletproof shield. - by Smileys - 15.03.2015, 23:10
Re: Bulletproof shield. - by Abagail - 15.03.2015, 23:32
Re: Bulletproof shield. - by kepa333 - 16.03.2015, 15:59

Forum Jump:


Users browsing this thread: 1 Guest(s)