Big Clucker
Join Date: Dec 2010
Posts: 122
Reputation: 3
|
Spawn where you last died in a forced animation
Hello, I've tried creating a script where when you die, you spawn in a forced animation, frozen and you can accept death with a command straight away, the problem is when the chose player dies, they are teleported under some farm in Blueberry, and if they kill themselves with a command, they teleport where they last died as CJ skin, fall on the ground with the animation I've chosen but after they fall, after a second or two they get up, frozen and still as CJ, upon dying again when in the death screen the same thing happens. I'm desperately in need of help as I ran out of ideas on what to do, thank you in advance.
PHP Code:
new Float:X;
new Float:Y;
new Float:Z;
new injured;
public
OnPlayerSpawn(playerid)
{
SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 1);
SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 1);
SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, 1);
if(injured == 1)
{
SetPlayerPos(playerid, X, Y, Z);
SetPlayerHealth(playerid, 20);
TogglePlayerControllable(playerid, 0);
ApplyAnimation(playerid, "KNIFE", "KILL_Knife_Ped_Die", 4.1, 0, 1, 1, 0, 0, 1);
Create3DTextLabel("DEAD BODY", COLOR_RED, X, Y, Z, 20.0, 0, 0);
SendClientMessage(playerid, COLOR_GREEN, "You have been resurrected to see another day, enjoy it...peasant");
return 1;
}
return
1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
injured = 1;
GetPlayerPos(playerid, X, Y, Z);
SendClientMessage(playerid, COLOR_RED, "You have been slaughtered, not even god could help you");
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/accept",cmdtext,true) == 0)
{
injured = 0;
SpawnPlayer(playerid);
SendClientMessage(playerid,0xAA3333AA,"You died because you accepted your death");
return 1;
}
__________________
My works
|
Aucun commentaire:
Enregistrer un commentaire