05.09.2014, 14:49
Hola, mi problema es el siguiente, cuando muero por segunda vez (Despues de abrir el sv), el usuario, en vez de quedarse muerto en el suelo, agonizando, pues aparece en el cielo agonizando, y asi siempre, excepto la primera vez que muero despues de abrir el sv, que si se queda en el sitio...
pawn Код:
// 3 sec tick rate
timer EMSUpdate[3000](){
foreach(Player, i){
if(GetPVarType(i, "Injured")){
if(GetPVarInt(i, "EMSAttempt") != 0){
new Float:health;
GetPlayerHealth(i,health);
if(GetPVarInt(i, "EMSAttempt") == -1)
{
if(!IsPlayerInRangeOfPoint(i, 3.0, GetPVarFloat(i,"MedicX"), GetPVarFloat(i,"MedicY"), GetPVarFloat(i,"MedicZ")))
{
Streamer_UpdateEx(i, GetPVarFloat(i,"MedicX"), GetPVarFloat(i,"MedicY"), GetPVarFloat(i,"MedicZ"));
SetPlayerPos(i, GetPVarFloat(i,"MedicX"), GetPVarFloat(i,"MedicY"), GetPVarFloat(i,"MedicZ"));
SetPlayerVirtualWorld(i, GetPVarInt(i,"MedicVW"));
SetPlayerInterior(i, GetPVarInt(i,"MedicInt"));
}
SetHP(i, health-5);
ApplyAnimation(i, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0, 1);
GameTextForPlayer(i, "~y~Estas herido~n~~w~/aceptar muerte o /servicios medicos", 5000, 3);
}
if(GetPVarInt(i, "EMSAttempt") == 1)
{
if(!IsPlayerInRangeOfPoint(i, 3.0, GetPVarFloat(i,"MedicX"), GetPVarFloat(i,"MedicY"), GetPVarFloat(i,"MedicZ")))
{
Streamer_UpdateEx(i, GetPVarFloat(i,"MedicX"), GetPVarFloat(i,"MedicY"), GetPVarFloat(i,"MedicZ"));
SetPlayerPos(i, GetPVarFloat(i,"MedicX"), GetPVarFloat(i,"MedicY"), GetPVarFloat(i,"MedicZ"));
SetPlayerVirtualWorld(i, GetPVarInt(i,"MedicVW"));
SetPlayerInterior(i, GetPVarInt(i,"MedicInt"));
}
SetHP(i, health-5);
ApplyAnimation(i, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0, 1);
GameTextForPlayer(i, "~r~Herido~n~~w~Espera que SAMD llegue...", 5000, 3);
}
if(GetPVarInt(i, "EMSAttempt") == 8)
{
if(!IsPlayerInRangeOfPoint(i, 3.0, GetPVarFloat(i,"MedicX"), GetPVarFloat(i,"MedicY"), GetPVarFloat(i,"MedicZ")))
{
Streamer_UpdateEx(i, GetPVarFloat(i,"MedicX"), GetPVarFloat(i,"MedicY"), GetPVarFloat(i,"MedicZ"));
SetPlayerPos(i, GetPVarFloat(i,"MedicX"), GetPVarFloat(i,"MedicY"), GetPVarFloat(i,"MedicZ"));
SetPlayerVirtualWorld(i, GetPVarInt(i,"MedicVW"));
SetPlayerInterior(i, GetPVarInt(i,"MedicInt"));
}
SetHP(i, health-5);
ApplyAnimation(i, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0, 1);
GameTextForPlayer(i, "~r~Herido~n~~w~Espera que SAMD llegue...", 5000, 3);
}
if(GetPVarInt(i, "EMSAttempt") == 2)
{
if(!IsPlayerInRangeOfPoint(i, 3.0, GetPVarFloat(i,"MedicX"), GetPVarFloat(i,"MedicY"), GetPVarFloat(i,"MedicZ")))
{
Streamer_UpdateEx(i, GetPVarFloat(i,"MedicX"), GetPVarFloat(i,"MedicY"), GetPVarFloat(i,"MedicZ"));
SetPlayerPos(i, GetPVarFloat(i,"MedicX"), GetPVarFloat(i,"MedicY"), GetPVarFloat(i,"MedicZ"));
SetPlayerVirtualWorld(i, GetPVarInt(i,"MedicVW"));
SetPlayerInterior(i, GetPVarInt(i,"MedicInt"));
}
GameTextForPlayer(i, "~g~Rescatado~n~~w~En espera de atencion medica...", 5000, 3);
}
if(GetPVarInt(i, "EMSAttempt") == 3){
if(IsPlayerInAnyVehicle(i)){
new ambmodel = GetPlayerVehicleID(i);
if(GetVehicleModel(ambmodel) == 416){
GameTextForPlayer(i, "~g~Rescatado~n~~w~Espera que SAMD te lleve al hospital...", 5000, 3);
}
else{
SendClientMessageEx(i, COLOR_WHITE, "Perdiste el conocimiento y se te translado inmediatamente al hospital.");
KillEMSQueue(i);
SetPVarInt(i, "Hospital", 1);
SpawnPlayer(i);
}
}
else{
SendClientMessageEx(i, COLOR_WHITE, "Perdiste el conocimiento y se te translado inmediatamente al hospital.");
KillEMSQueue(i);
SetPVarInt(i, "Hospital", 1);
SpawnPlayer(i);
}
}
if(health <= 10)
{
SendClientMessageEx(i, COLOR_WHITE, "Perdiste el conocimiento y se te transladу inmediatamente al hospital.");
KillEMSQueue(i);
SetPVarInt(i, "Hospital", 1);
SetHP(i, 50);
SpawnPlayer(i);
}
}
}
}
}
pawn Код:
// SendEMSQueue Function(playerid)
function SendEMSQueue(playerid,type)
{
switch(type)
{
case 1:
{
Streamer_UpdateEx(playerid, GetPVarFloat(playerid,"MedicX"), GetPVarFloat(playerid,"MedicY"), GetPVarFloat(playerid,"MedicZ"));
SetPlayerPos(playerid, GetPVarFloat(playerid,"MedicX"), GetPVarFloat(playerid,"MedicY"), GetPVarFloat(playerid,"MedicZ"));
SetPlayerVirtualWorld(playerid, GetPVarInt(playerid,"MedicVW"));
SetPlayerInterior(playerid, GetPVarInt(playerid,"MedicInt"));
SetPVarInt(playerid, "EMSAttempt", -1);
ClearAnimations(playerid);
ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0, 1);
if(GetPlayerInterior(playerid) > 0)
{
LoadObjects(playerid);
}
GameTextForPlayer(playerid, "~y~Estas herido~n~~w~/aceptar muerte o /servicios medicos", 5000, 3);
SetHP(playerid, 100);
SetPlayerArmour(playerid,0);
SetPVarInt(playerid,"MedicCall",1);
}
case 2:
{
SetPVarInt(playerid,"EMSAttempt", 2);
//ClearAnimations(playerid);
ApplyAnimation(playerid, "SWAT", "gnstwall_injurd", 4.0, 0, 1, 1, 1, 0, 1);
SetHP(playerid, 100);
SetPlayerArmour(playerid,0);
}
}
return 1;
}