Salut, voila j'ai copier un systeme d'un GM anglais, pour l'amélioré et le traduire, mais IG quand j'arrive à 20hp normalement sa me tue et me propose de /accepter mort ou d'attendre les secours
Mais IG quand j'arrive à 20hp le serveur crash, donc voila j'ai oublier quelques chose ou pas ?
if(gPlayerLogged[i] == 1 && FirstSpawn[i] == 0)
{
new Float:health;
GetPlayerHealth(i, health);
if (health <= 20 && dying[i] == 0)
{
if(!(IsPlayerInAnyVehicle(i)))
{
format(string, sizeof(string), "* %s falls on the floor", GetPlayerName(i));
ProxDetector(15.0, i, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SendClientMessage(i, COLOR_WHITE, " You are dying now , you can wait for medic or you can use '/accept death' ");
printf("%s", string);
TogglePlayerControllable(i, 0);
ApplyAnimation(i,"PED","KO_skid_front",4.1,0,1,1,1,0);
gPlayerUsingLoopingAnim[i] = 1;
dying[i] = 1;
}
else
{
format(string, sizeof(string), "* %s loses consciousness", GetPlayerName(i));
TogglePlayerControllable(i, 0);
ProxDetector(15.0, i, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
printf("%s", string);
//ApplyAnimation(i,"PED","KO_skid_front",4.1,0,1,1,1,0);
dying[i] = 1;
}
}
else if (health >= 25 && dying[i] == 1)
{
if(!(IsPlayerInAnyVehicle(i)))
{
format(string, sizeof(string), "* %s wakes up", GetPlayerName(i));
ProxDetector(15.0, i, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
printf("%s", string);
TogglePlayerControllable(i, 1);
ApplyAnimation(i,"PED","getup_front",4.1,0,1,1,0,1);
gPlayerUsingLoopingAnim[i] = 0;
//hostimer[i] = SetTimerEx("EnterHospital",3000,0,"i",i);
dying[i] = 0;
}
else
{
format(string, sizeof(string), "* %s wakes up", GetPlayerName(i));
ProxDetector(15.0, i, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
TogglePlayerControllable(i, 1);
//hostimer[i] = SetTimerEx("EnterHospital",3000,0,"i",i);
printf("%s", string);
//ApplyAnimation(i,"PED","KO_skid_front",4.1,0,1,1,1,0);
dying[i] = 0;
}
}
}