|
Nгo tem esse objeto.
Crie o Actor e defina a animaзгo de morte. |
enum crInfo {
crID,
crCTime
};
new Corpos[100][crInfo];
public OnGameModeInit()
{
SetTimer("UpdateActors", 1000, true);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
new Float:x, Float:y, Float:z, Float:a;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, a);
CriarCorpo(GetPlayerSkin(playerid), x, y, z, a, 40 * 60);
return 1;
}
forward UpdateActors();
public UpdateActors()
{
for(new i = 0; i < sizeof(Corpos); i++)
{
if(Corpos[i][crCTime] != 0)
{
if(gettime() >= Corpos[i][crCTime])
{
DeletarCorpo(i);
}
}
}
return 1;
}
stock CriarCorpo(skin, Float:x, Float:y, Float:z, Float:rotation, segundos)
{
for(new i = 0; i < sizeof(Corpos); i++)
{
if(Corpos[i][crCTime] == 0)
{
Corpos[i][crID] = CreateActor(skin, x, y, z, rotation);
Corpos[i][crCTime] = gettime() + segundos;
SetActorInvulnerable(Corpos[i][crID], true);
ApplyActorAnimation(Corpos[i][crID], ...);
}
}
return 1;
}
stock DeletarCorpo(key)
{
Corpos[key][crCTime] = 0;
DestroyActor(Corpos[key][crID]);
return 1;
}
|
Код:
enum crInfo {
crID,
crCTime
};
new Corpos[100][crInfo];
public OnGameModeInit()
{
SetTimer("UpdateActors", 1000, true);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
new Float:x, Float:y, Float:z, Float:a;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, a);
CriarCorpo(GetPlayerSkin(playerid), x, y, z, a, 40 * 60);
return 1;
}
forward UpdateActors();
public UpdateActors()
{
for(new i = 0; i < sizeof(Corpos); i++)
{
if(Corpos[i][crCTime] != 0)
{
if(gettime() >= Corpos[i][crCTime])
{
DeletarCorpo(i);
}
}
}
return 1;
}
stock CriarCorpo(skin, Float:x, Float:y, Float:z, Float:rotation, segundos)
{
for(new i = 0; i < sizeof(Corpos); i++)
{
if(Corpos[i][crCTime] == 0)
{
Corpos[i][crID] = CreateActor(skin, x, y, z, rotation);
Corpos[i][crCTime] = gettime() + segundos;
SetActorInvulnerable(Corpos[i][crID], true);
ApplyActorAnimation(Corpos[i][crID], ...);
}
}
return 1;
}
stock DeletarCorpo(key)
{
Corpos[key][crCTime] = 0;
DestroyActor(Corpos[key][crID]);
return 1;
}
|
vc sempre me ajuda, e obg pela a ajuda dos outros tb
|
tu sabes algum anim que o cara fica morto no chгo, procurei e n achei, to procurando pro actor
|
ApplyActorAnimation(/*ID Actor*/, "PED", "KO_shot_front", 4.1, 0, 1, 1, 1, 1);
|
PHP код:
|

|
enum crInfo { crID, crCTime }; new Corpos[100][crInfo]; public OnGameModeInit() { SetTimer("UpdateActors", 1000, true); return 1; } public OnPlayerDeath(playerid, killerid, reason) { new Float , Float:y, Float:z, Float:a;GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid, a); CriarCorpo(GetPlayerSkin(playerid), x, y, z, a, 40 * 60); return 1; } forward UpdateActors(); public UpdateActors() { for(new i = 0; i < sizeof(Corpos); i++) { if(Corpos[i][crCTime] != 0) { if(gettime() >= Corpos[i][crCTime]) { DeletarCorpo(i); } } } return 1; } stock CriarCorpo(skin, Float , Float:y, Float:z, Float:rotation, segundos){ for(new i = 0; i < sizeof(Corpos); i++) { if(Corpos[i][crCTime] == 0) { Corpos[i][crID] = CreateActor(skin, x, y, z, rotation); Corpos[i][crCTime] = gettime() + segundos; SetActorInvulnerable(Corpos[i][crID], true); ApplyActorAnimation(Corpos[i][crID], ...); } } return 1; } stock DeletarCorpo(key) { Corpos[key][crCTime] = 0; DestroyActor(Corpos[key][crID]); return 1; } |
stock CriarCorpo(skin, Float:x, Float:y, Float:z, Float:rotation, segundos)
{
for(new i = 0; i < sizeof(Corpos); i++)
{
if(Corpos[i][crCTime] == 0)
{
Corpos[i][crID] = CreateActor(skin, x, y, z, rotation);
Corpos[i][crCTime] = gettime() + segundos;
SetActorInvulnerable(Corpos[i][crID], true);
ApplyActorAnimation(Corpos[i][crID], ...);
break;
}
}
return 1;
}