09.06.2011, 19:35
- Baixe esta include: https://sampforum.blast.hk/showthread.php?tid=195439
- Coloque isto no topo do GM:
PHP код:#include <OPSP>
new Escudo[MAX_PLAYERS];
- Use este comando:
PHP код:if(strcmp(cmdtext,"/escudo",true) == 0)
{
if(Escudo[playerid] == 0)
{
SetPlayerAttachedObject(playerid,1,18637,13,0.35,0.0,0.0,0.0,0.0,180.0);
SetPlayerAttachedObject(playerid,2,18642,7,0.1,0.0,-0.11,0.0,-90.0,90.0);
SendClientMessage(playerid, 0xFFFFFFFF," Vocк pegou seu escudo!");
Escudo[playerid] = 1;
}
else
{
RemovePlayerAttachedObject(playerid, 1);
RemovePlayerAttachedObject(playerid, 2);
SendClientMessage(playerid, 0xFFFFFFFF," Vocк retirou seu escudo!");
Escudo[playerid] = 0;
}
return 1;
}
- Entгo crie esta callback no seu GM:
PHP код:public OnPlayerShootPlayer(Shooter,Target,Float:HealthLost,Float:ArmourLost)
{
if(Escudo[Target] == 1)
{
new Float:vida;
GetPlayerHealth(Target, vida);
SetPlayerHealth(Target, vida);
return 1;
}
return 1;
}