16.12.2013, 04:32
First Issue
It's showing the "Spawn" button with the arrows when a player dies, but I don't want it too. What's the issue?
I've tried with
and with it false, but nothing's working. Here's the system.
Here is OnPlayerSpawn:
Second
I keep randomly dying for no reason, what's the issue?
It's showing the "Spawn" button with the arrows when a player dies, but I don't want it too. What's the issue?
I've tried with
pawn Код:
TogglePlayerSpectating(playerid, true);
pawn Код:
new string[128], weapon[24];
GetWeaponName(reason, weapon, sizeof(weapon));
JustDied[playerid] = true;
ResetPlayerWeapons(playerid);
SaveWeapons(playerid);
SetPlayerHealth(playerid, 100);
TogglePlayerControllable(playerid, false);
Player[playerid][TotalDeaths] ++;
if(killerid != INVALID_PLAYER_ID)
{
format(string, sizeof(string), "AdmWrn: %s has been killed by %s. (%s)", RemoveUnderScore(playerid), RemoveUnderScore(killerid), weapon);
Player[killerid][TotalKills] ++;
SaveLog(GetName(playerid), "OnPlayerDeath", string);
JustDied[playerid] = true;
}
else
{
format(string, sizeof(string), "AdmWrn: %s has been killed.", RemoveUnderScore(playerid));
SaveLog(GetName(playerid), "OnPlayerDeath", string);
JustDied[playerid] = true;
}
AdminMessage(1, RED, string);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 0);
TogglePlayerControllable(playerid, false);
return 1;
pawn Код:
public OnPlayerSpawn(playerid)
{
new string[128];
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 0);
if(JustDied[playerid] == true)
{
new bill = Player[playerid][Level] * 75 + Player[playerid][Level] + random(100), dn[24], nra = random(4);
Player[playerid][Money] -= bill;
SetTimerEx("ReleaseTimer", 25000, false, "i", playerid);
Hospitalized[playerid] = true;
Player[playerid][Health] = 100;
Player[playerid][Armour] = 0;
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 0);
SetPlayerPos(playerid, -317.8539,1060.5267,19.7422);
SetPlayerFacingAngle(playerid, 321.2364);
SetPlayerCameraPos(playerid, -305.4138,1075.1143,24.3368);
SetPlayerCameraLookAt(playerid, -323.5710,1052.5018,20.3403);
SetPlayerHealth(playerid, 100);
SetPlayerSkin(playerid, Player[playerid][Skin]);
SetPlayerArmedWeapon(playerid, 0);
for(new i = 0; i < 10; i++)
SetPlayerSkillLevel(playerid, i, Player[playerid][WeaponSkill]);
}
else
{
LoadPlayerWeapons(playerid);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 0);
SetPlayerHealth(playerid, 100);
SetPlayerArmedWeapon(playerid, 0);
TogglePlayerControllable(playerid, true);
SetPlayerSkin(playerid, Player[playerid][Skin]);
for(new i = 0; i < 10; i++)
SetPlayerSkillLevel(playerid, i, Player[playerid][WeaponSkill]);
}
if(Player[playerid][Jailed] == 1)
{
TogglePlayerControllable(playerid, false);
}
if(JustDied[playerid] == true)
{
TogglePlayerControllable(playerid, false);
}
JustDied[playerid] = false;
return 1;
}
I keep randomly dying for no reason, what's the issue?