10.04.2014, 15:04
Hi there!
I've tried debugging this, I'm not entirely sure why it doesn't do as I ask.
For some reason OnPlayerDeath is removing my weapons as well.
Here's my OnPlayerDeath.
It Reaches all of them, but doesn't actually do anything except Set the position and set the health - Nothing else.
I've tried debugging this, I'm not entirely sure why it doesn't do as I ask.
For some reason OnPlayerDeath is removing my weapons as well.
pawn Код:
stock PlayerDeath(playerid, Float: x, Float: y, Float: z, reason)
{
DeathPosX[playerid] = x;
DeathPosY[playerid] = y;
DeathPosZ[playerid] = z;
SetPlayerPos(playerid, DeathPosX[playerid], DeathPosY[playerid], DeathPosZ[playerid]);
printf("Set the position");
GivePlayerWeaponEx(playerid);
printf("Gave Weapons");
ApplyAnimation(playerid, "KNIFE", "KILL_Knife_Ped_Die", 4.1, 0, 1, 1, 0, 0, 1);
printf("Animation");
TogglePlayerControllable(playerid, 0);
printf("Controllable");
PlayerDead[playerid] = 1;
DeathTimer[playerid] = 3;
SetPlayerHealth(playerid, 99999);
DeathLabel[playerid] = CreateDynamic3DTextLabel("D E A D B O D Y", COLOUR_REALRED, DeathPosX[playerid],DeathPosY[playerid],DeathPosZ[playerid]+0.5, 50.0, playerid, INVALID_VEHICLE_ID, 0, 0, -1, -1, 50.0);
return 1;
}
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
new Float: x,Float:y,Float:z;
GetPlayerPos(playerid, x, y, z);
PlayerDeath(playerid, x, y, z, reason);
//DropGun(playerid, GetWepIndexFromSQL(GetPlayerWeaponEx(playerid)),GetPlayerAmmo(playerid),x,y,z,GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid));
if(IsPlayerInAnyVehicle(playerid))
{
RemovePlayerFromVehicle(playerid);
TextDrawHideForPlayer(playerid,speed[playerid]);
TextDrawHideForPlayer(playerid,fuel[playerid]);
KillTimer(FuelSysTimer[playerid]);
KillTimer(SpeedoSysTimer[playerid]);
}
//Hospitalized[playerid] = 1;
//HospitalTime[playerid] = 30;
//dohospital(playerid);
return 1;
}