Código:
#include <a_samp>
#include <a_actor>
#include <streamer>
#pragma tabsize 0
new BrucedG;
public OnGameModeInit()
{
print("\n----------------------------------");
print("By [TSVR]_LeleziN_");
print("----------------------------------\n");
BrucedG = CreateActor(106,499.4700,-78.0576,998.7578,355.6133);
new Float:x, Float:y, Float:z;
GetActorPos(BrucedG, x, y, z);
SetActorPos(BrucedG, 499.4700,-78.0576,998.7578);
SetActorFacingAngle(BrucedG, 355.6133);
SetActorVirtualWorld(BrucedG, 1);
if(GetActorVirtualWorld(BrucedG) == 1)
{
print("Ator 'BrucedG' válido, barmen safado");
}
SetActorInvulnerable(BrucedG, false);
if(IsActorInvulnerable(BrucedG))
{
//print("O Ator é invulnerável, não sofrerá dano.");
}
else
{
//print("O Ator é vulnerável, vamos matar esse fi de rapariga.");
}
SetActorHealth(BrucedG, 100);
new Float:Health_Actor;
GetActorHealth(BrucedG, Health_Actor);
printf("A vida do Ator ID %d é %.2f", BrucedG, Renato, Ericky, Renan, Health_Actor);
ApplyActorAnimation(BrucedG, "ped","IDLE_chat", 4.1,1,0,0,1,0);
return 1;
}
public OnGameModeExit()
{
DestroyActor(BrucedG);
return 1;
}
public OnPlayerUpdate(playerid)
{
new AtorMirado = GetPlayerTargetActor(playerid);
if(IsValidActor(AtorMirado) && GetPlayerWeapon(playerid) != 0)
{
new WeaponName[24], String[128];
GetWeaponName(GetPlayerWeapon(playerid), WeaponName, sizeof(WeaponName));
//format(String, sizeof(String), "{00FF00}Você está mirando para o Actor de ID {FF8000}%d {00FF00}com a arma {FF8000}%s", AtorMirado, WeaponName);
//SendClientMessage(playerid, -1, String);
}
return 1;
}
public OnPlayerGiveDamageActor(playerid, damaged_actorid, Float: amount, weaponid, bodypart)
{
new StringActor[150], WeaponName[24];
GetWeaponName(weaponid, WeaponName, sizeof (WeaponName));
if(!IsActorInvulnerable(damaged_actorid))
{
new Float:Actor_Health;
GetActorHealth(damaged_actorid, Actor_Health);
SetActorHealth(damaged_actorid, Actor_Health-amount);
//format(StringActor, sizeof(StringActor), "ActorID: %d | VW: %d | Arma: %s | BodyPartID: %d | Dano: %.0f | Vida: %.0f", damaged_actorid, GetActorVirtualWorld(damaged_actorid), WeaponName, bodypart, amount, Actor_Health-amount);
//SendClientMessage(playerid, -1, StringActor);
}
return 1;
}
public OnActorStreamIn(actorid, forplayerid)
{
//new String[40];
//format(String, sizeof(String), "Ator ID %d entrou no seu campo de visão.", actorid);
//SendClientMessage(forplayerid, 0xFFFFFFFF, String);
return 1;
}
public OnActorStreamOut(actorid, forplayerid)
{
//new String[40];
//format(String, sizeof(String), "Ator ID %d saiu do seu campo de visão.", actorid);
//SendClientMessage(forplayerid, 0xFFFFFFFF, String);
return 1;
}
forward ReviveActor(ActorID);
public ReviveActor(ActorID)
{
SetActorPos(BrucedG, 499.4700,-78.0576,998.7578);
SetActorPos(Renato, 674.7385,-475.2978,16.3359);
SetActorPos(Ericky, 673.3713,-473.2091,16.5363);
SetActorPos(Renan, 670.7799,-474.4863,16.5363);
return 1;
}
stock SetAllActorsVirtualWorld(vworld)
{
for(new i = 0; i <= GetActorPoolSize(); ++i)
{
if(IsValidActor(i)) SetActorVirtualWorld(i, vworld);
}
return 1;
}
stock ClearAllActorsAnimations()
{
for(new i = 0; i <= GetActorPoolSize(); ++i)
{
if(IsValidActor(i))
{
ClearActorAnimations(i);
}
}
return 1;
}