public OnPlayerSpawn(playerid)
{
if(IsDead[playerid] == 1)
{
SetPlayerPos(playerid, DeathPos[playerid][dX], DeathPos[playerid][dY], DeathPos[playerid][dZ]);
SetPlayerHealth(playerid, 50);
IsDead[playerid] = 2;
ApplyAnimation(playerid,"PARACHUTE","FALL_skyDive_DIE", 4.0, 0, 0, 0, 1, 0);
SetTimerEx("AutoDeath", AUTODEATH_SECONDS * 1000, false, "i", playerid);
SendClientMessage(playerid, COLOUR_TWPINK, "------------------ Health Advice -----------------");
SendClientMessage(playerid, COLOUR_TWPINK, "You have been critically injured!");
SendClientMessage(playerid, COLOUR_TWPINK, "You can type either '/requestmedic' or '/acceptdeath' to continue.");
SendClientMessage(playerid, COLOUR_TWPINK, "--------------------------------------------------------");
new string[400];
new holder[400];
if(sInfo[playerid][Misc] > 0)
{
format(string, sizeof(string), ""COL_RED"%d bruises on their body.\n", sInfo[playerid][Misc]);
strcat(holder, string, sizeof(holder));
}
if(sInfo[playerid][Head] > 0)
{
format(string, sizeof(string), ""COL_RED"%d gun shot wound(s) in the head.\n", sInfo[playerid][Head]);
strcat(holder, string, sizeof(holder));
}
if(sInfo[playerid][Chest] > 0)
{
format(string, sizeof(string), ""COL_RED"%d gun shot wound(s) in the chest.\n", sInfo[playerid][Chest]);
strcat(holder, string, sizeof(holder));
}
if(sInfo[playerid][Crotch] > 0)
{
format(string, sizeof(string), ""COL_RED"%d gun shot wound(s) in the crotch.\n", sInfo[playerid][Crotch]);
strcat(holder, string, sizeof(holder));
}
if(sInfo[playerid][LArm] > 0)
{
format(string, sizeof(string), ""COL_RED"%d gun shot wound(s) in the left arm.\n", sInfo[playerid][LArm]);
strcat(holder, string, sizeof(holder));
}
if(sInfo[playerid][RArm] > 0)
{
format(string, sizeof(string), ""COL_RED"%d gun shot wound(s) in the right arm.\n", sInfo[playerid][RArm]);
strcat(holder, string, sizeof(holder));
}
if(sInfo[playerid][LLeg] > 0)
{
format(string, sizeof(string), ""COL_RED"%d gun shot wound(s) in the left leg.\n", sInfo[playerid][LLeg]);
strcat(holder, string, sizeof(holder));
}
if(sInfo[playerid][RLeg] > 0)
{
format(string, sizeof(string), ""COL_RED"%d gun shot wound(s) in the right leg.\n", sInfo[playerid][RLeg]);
strcat(holder, string, sizeof(holder));
}
deathlabel[playerid] = Create3DTextLabel(holder, -1, DeathPos[playerid][dX], DeathPos[playerid][dY], DeathPos[playerid][dZ], 10.0, 0, 0);
}
else if(IsDead[playerid] == 2)
{
AutoDeath(playerid);
}
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
new Float:pX, Float:pY, Float:pZ;
GetPlayerPos(playerid, pX, pY, pZ);
PlayerInfo[killerid][pKills]++;
PlayerInfo[playerid][pDeaths]++;
DeathPos[playerid][dX] = pX;
DeathPos[playerid][dY] = pY;
DeathPos[playerid][dZ] = pZ;
IsDead[playerid] = 1;
return 1;
}
new Float:DeathPos[MAX_PLAYERS][3];
public OnPlayerSpawn(playerid)
{
if(IsDead[playerid] == 1)
{
SetPlayerPos(playerid, DeathPos[playerid][0], DeathPos[playerid][1], DeathPos[playerid][2]);
SetPlayerHealth(playerid, 50);
IsDead[playerid] = 2;
ApplyAnimation(playerid,"PARACHUTE","FALL_skyDive_DIE", 4.0, 0, 0, 0, 1, 0);
SetTimerEx("AutoDeath", AUTODEATH_SECONDS * 1000, false, "i", playerid);
SendClientMessage(playerid, COLOUR_TWPINK, "------------------ Health Advice -----------------");
SendClientMessage(playerid, COLOUR_TWPINK, "You have been critically injured!");
SendClientMessage(playerid, COLOUR_TWPINK, "You can type either '/requestmedic' or '/acceptdeath' to continue.");
SendClientMessage(playerid, COLOUR_TWPINK, "--------------------------------------------------------");
new string[400];
new holder[400];
if(sInfo[playerid][Misc] > 0)
{
format(string, sizeof(string), ""COL_RED"%d bruises on their body.\n", sInfo[playerid][Misc]);
strcat(holder, string, sizeof(holder));
}
if(sInfo[playerid][Head] > 0)
{
format(string, sizeof(string), ""COL_RED"%d gun shot wound(s) in the head.\n", sInfo[playerid][Head]);
strcat(holder, string, sizeof(holder));
}
if(sInfo[playerid][Chest] > 0)
{
format(string, sizeof(string), ""COL_RED"%d gun shot wound(s) in the chest.\n", sInfo[playerid][Chest]);
strcat(holder, string, sizeof(holder));
}
if(sInfo[playerid][Crotch] > 0)
{
format(string, sizeof(string), ""COL_RED"%d gun shot wound(s) in the crotch.\n", sInfo[playerid][Crotch]);
strcat(holder, string, sizeof(holder));
}
if(sInfo[playerid][LArm] > 0)
{
format(string, sizeof(string), ""COL_RED"%d gun shot wound(s) in the left arm.\n", sInfo[playerid][LArm]);
strcat(holder, string, sizeof(holder));
}
if(sInfo[playerid][RArm] > 0)
{
format(string, sizeof(string), ""COL_RED"%d gun shot wound(s) in the right arm.\n", sInfo[playerid][RArm]);
strcat(holder, string, sizeof(holder));
}
if(sInfo[playerid][LLeg] > 0)
{
format(string, sizeof(string), ""COL_RED"%d gun shot wound(s) in the left leg.\n", sInfo[playerid][LLeg]);
strcat(holder, string, sizeof(holder));
}
if(sInfo[playerid][RLeg] > 0)
{
format(string, sizeof(string), ""COL_RED"%d gun shot wound(s) in the right leg.\n", sInfo[playerid][RLeg]);
strcat(holder, string, sizeof(holder));
}
deathlabel[playerid] = Create3DTextLabel(holder, -1, DeathPos[playerid][dX], DeathPos[playerid][dY], DeathPos[playerid][dZ], 10.0, 0, 0);
}
else if(IsDead[playerid] == 2)
{
AutoDeath(playerid);
}
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
GetPlayerPos(playerid,DeathPos[playerid][0], DeathPos[playerid][1], DeathPos[playerid][2]);
PlayerInfo[killerid][pKills]++;
PlayerInfo[playerid][pDeaths]++;
IsDead[playerid] = 1;
return 1;
}
|
Tried it but it doesn't work.. Really don't know what is going on here
|
printf("x : %f - y : %f - z: %f", DeathPos[playerid][0], DeathPos[playerid][1],DeathPos[playerid][2]);
SetPlayerPos(playerid, DeathPos[playerid][0], DeathPos[playerid][1], DeathPos[playerid][2]);
GetPlayerPos(playerid, DeathPos[playerid][0], DeathPos[playerid][1], DeathPos[playerid][2]);
if(Health < 10)
{
// here your code after
SetPlayerHealth(playerid, 50);
IsDead[playerid] = 2;
ApplyAnimation(playerid,"PARACHUTE","FALL_skyDive_DIE", 4.0, 0, 0, 0, 1, 0);
SetTimerEx("AutoDeath", AUTODEATH_SECONDS * 1000, false, "i", playerid);
SendClientMessage(playerid, COLOUR_TWPINK, "------------------ Health Advice -----------------");
SendClientMessage(playerid, COLOUR_TWPINK, "You have been critically injured!");
SendClientMessage(playerid, COLOUR_TWPINK, "You can type either '/requestmedic' or '/acceptdeath' to continue.");
SendClientMessage(playerid, COLOUR_TWPINK, "--------------------------------------------------------");
new string[400];
new holder[400];
if(sInfo[playerid][Misc] > 0)
{
format(string, sizeof(string), ""COL_RED"%d bruises on their body.\n", sInfo[playerid][Misc]);
strcat(holder, string, sizeof(holder));
}
if(sInfo[playerid][Head] > 0)
{
format(string, sizeof(string), ""COL_RED"%d gun shot wound(s) in the head.\n", sInfo[playerid][Head]);
strcat(holder, string, sizeof(holder));
}
if(sInfo[playerid][Chest] > 0)
{
format(string, sizeof(string), ""COL_RED"%d gun shot wound(s) in the chest.\n", sInfo[playerid][Chest]);
strcat(holder, string, sizeof(holder));
}
if(sInfo[playerid][Crotch] > 0)
{
format(string, sizeof(string), ""COL_RED"%d gun shot wound(s) in the crotch.\n", sInfo[playerid][Crotch]);
strcat(holder, string, sizeof(holder));
}
if(sInfo[playerid][LArm] > 0)
{
format(string, sizeof(string), ""COL_RED"%d gun shot wound(s) in the left arm.\n", sInfo[playerid][LArm]);
strcat(holder, string, sizeof(holder));
}
if(sInfo[playerid][RArm] > 0)
{
format(string, sizeof(string), ""COL_RED"%d gun shot wound(s) in the right arm.\n", sInfo[playerid][RArm]);
strcat(holder, string, sizeof(holder));
}
if(sInfo[playerid][LLeg] > 0)
{
format(string, sizeof(string), ""COL_RED"%d gun shot wound(s) in the left leg.\n", sInfo[playerid][LLeg]);
strcat(holder, string, sizeof(holder));
}
if(sInfo[playerid][RLeg] > 0)
{
format(string, sizeof(string), ""COL_RED"%d gun shot wound(s) in the right leg.\n", sInfo[playerid][RLeg]);
strcat(holder, string, sizeof(holder));
}
deathlabel[playerid] = Create3DTextLabel(holder, -1, DeathPos[playerid][dX], DeathPos[playerid][dY], DeathPos[playerid][dZ], 10.0, 0, 0);
}
else if(IsDead[playerid] == 2)
{
AutoDeath(playerid);
}
}