// Resynchronize an actor.
forward ResyncActor(actorid);
// Respawns an actor.
forward RespawnActor(actorid);
// Checks if the actor is dead.
forward IsActorDead(actorid);
// Sets an actor's respawn time (after death).
forward SetActorRespawnTime(actorid, time);
// Checks if a player is in range of an actor.
forward IsPlayerInRangeOfActor(playerid, actorid, Float:radius = 5.0);
// Attaches a 3D text label to an actor.
forward Text3D:Attach3DTextLabelToActor(actorid, text[], color, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:distance = 10.0, worldid = 0, testlos = 0);
// Sets an actor's name(3D text label)
forward SetActorName(actorid, name[]);
// Gets an actor's name
forward GetActorName(actorid);
// Toggle an actor's name(Show/Hide 3D text label. Only works when the actor's name is already set(SetActorName)
forward ToggleActorName(actorid,bool:toggle);
// Sets an actor's color(Colors 3D text label only)
forward SetActorColor(actorid, color);
// Sets an actor's chat bubble
forward SetActorChatBubble(actorid, text[], color, Float:drawdistance, expiretime);
// Called when an actor dies.
forward OnActorDeath(actorid, killerid, reason);
// Called when an actor spawns.
forward OnActorSpawn(actorid);
// Called when a player aims at an actor.
forward OnPlayerTargetActor(playerid, newtarget, oldtarget);
public OnActorDeath(actorid, killerid, reason)
{
SetActorRespawnTime(actorid, 5000);
}
gActor = CreateActor(255, 0.0, 0.0, 10.0, 90.0);
gAttachedLabel = Attach3DTextLabelToActor(gActor, "I am an actor!\nPress {FFFF00}'Y'{FFFFFF} to interact with me!", 0xFFFFFFFF, 0.0, 0.0, 0.3, 10.0, 0);
public OnPlayerTargetActor(playerid, newtarget, oldtarget)
{
if (newtarget != INVALID_ACTOR_ID)
{
ApplyActorAnimation(newtarget, "PED", "handsup", 4.1, 0, 0, 0, 0, 0);
}
if (oldtarget != INVALID_ACTOR_ID)
{
ClearActorAnimations(oldtarget);
}
}
- Added native SetActorName(actorid,name[])
- Added native GetActorName(actorid)
- Added native ToggleActorName(actorid,bool:toggle)
- Added native SetActorColor(actorid, color)
- Added native SetActorChatBubble(actorid, text[], color, Float:drawdistance, expiretime)
SetActorName(actorid, name[]); GetActorName(actorid, const name[], len); ToggleActorName(actorid, toggle); SetActorChatBubble(actorid, text[], color, Float:drawdistance, expiretime);
Code:
SetActorName(actorid, name[]); GetActorName(actorid, const name[], len); ToggleActorName(actorid, toggle); SetActorChatBubble(actorid, text[], color, Float:drawdistance, expiretime); |
- Added native SetActorName(actorid,name[])
- Added native GetActorName(actorid)
- Added native ToggleActorName(actorid,bool:toggle)
- Added native SetActorColor(actorid, color)
- Added native SetActorChatBubble(actorid, text[], color, Float:drawdistance, expiretime)
Am glad someone with more experience has taken the task to keep this include maintained/updated, keep it up!
|
I don't know why but none of those functions are working with me...
|
You can use the callback OnPlayerGiveDamageActor for that.
|
I was just testing this... But the functions are simply not working. No errors tho.
Like: Attach3DTextLabelToActor does not create the label. SetActorName the same. RespawnActor destroys the actor but the actor don't respawn. I just tested these 3 functions. |
If you put the actor name SetActorName(myActor, "Test"); under OnActorRespawn it doesnt add it. When the Actor dies it removes the name.
|
static s_AnimationLibraries[][] = { !"AIRPORT", !"ATTRACTORS", !"BAR", !"BASEBALL", !"BD_FIRE", !"BEACH", !"BENCHPRESS", !"BF_INJECTION", !"BIKED", !"BIKEH", !"BIKELEAP", !"BIKES", !"BIKEV", !"BIKE_DBZ", !"BMX", !"BOMBER", !"BOX", !"BSKTBALL", !"BUDDY", !"BUS", !"CAMERA", !"CAR", !"CARRY", !"CAR_CHAT", !"CASINO", !"CHAINSAW", !"CHOPPA", !"CLOTHES", !"COACH", !"COLT45", !"COP_AMBIENT", !"COP_DVBYZ", !"CRACK", !"CRIB", !"DAM_JUMP", !"DANCING", !"DEALER", !"DILDO", !"DODGE", !"DOZER", !"DRIVEBYS", !"FAT", !"FIGHT_B", !"FIGHT_C", !"FIGHT_D", !"FIGHT_E", !"FINALE", !"FINALE2", !"FLAME", !"FLOWERS", !"FOOD", !"FREEWEIGHTS", !"GANGS", !"GHANDS", !"GHETTO_DB", !"GOGGLES", !"GRAFFITI", !"GRAVEYARD", !"GRENADE", !"GYMNASIUM", !"HAIRCUTS", !"HEIST9", !"INT_HOUSE", !"INT_OFFICE", !"INT_SHOP", !"JST_BUISNESS", !"KART", !"KISSING", !"KNIFE", !"LAPDAN1", !"LAPDAN2", !"LAPDAN3", !"LOWRIDER", !"MD_CHASE", !"MD_END", !"MEDIC", !"MISC", !"MTB", !"MUSCULAR", !"NEVADA", !"ON_LOOKERS", !"OTB", !"PARACHUTE", !"PARK", !"PAULNMAC", !"PED", !"PLAYER_DVBYS", !"PLAYIDLES", !"POLICE", !"POOL", !"POOR", !"PYTHON", !"QUAD", !"QUAD_DBZ", !"RAPPING", !"RIFLE", !"RIOT", !"ROB_BANK", !"ROCKET", !"RUSTLER", !"RYDER", !"SCRATCHING", !"SHAMAL", !"SHOP", !"SHOTGUN", !"SILENCED", !"SKATE", !"SMOKING", !"SNIPER", !"SPRAYCAN", !"STRIP", !"SUNBATHE", !"SWAT", !"SWEET", !"SWIM", !"SWORD", !"TANK", !"TATTOOS", !"TEC", !"TRAIN", !"TRUCK", !"UZI", !"VAN", !"VENDING", !"VORTEX", !"WAYFARER", !"WEAPONS", !"WUZI", !"WOP", !"GFUNK", !"RUNNINGMAN" }; |
static s_AnimationLibraries[][] = {
{!"AIRPORT"}, {!"ATTRACTORS"}, {!"BAR"}, {!"BASEBALL"},
...