SA-MP Forums Archive
Freeze after getting killed - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Freeze after getting killed (/showthread.php?tid=408950)



Freeze after getting killed - se7evolution - 19.01.2013

Hello,
Recently i have a issue. When i get killed on the server i get freezed. I tried to fix it but it doesn't work.
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(GetPVarInt(playerid, "Headshotted") == 1)
    {
        SetPVarInt(playerid, "Headshotted", 0);
        GameTextForPlayer(playerid, "~y~Head~r~shot", 3000, 3);
        GameTextForPlayer(killerid, "~g~Head~w~shot", 3000, 3);
    }
    pInfo[playerid][pDeaths]++;
    pInfo[killerid][pKills]++;
    pInfo[playerid][pDuty] = 0;
    pInfo[playerid][pGod] = 0;
    SetPlayerArmour(playerid, 0.00);
    SetPlayerHealth(playerid, 0.00);
    if(GetPVarInt(playerid, "OldSkin"))
    SetPlayerSkin(playerid, GetPVarInt(playerid, "OldSkin"));
    SendDeathMessage(killerid, playerid, reason);
    GivePlayerMoney(killerid, 500000);
    SetPlayerScore(killerid, GetPlayerScore(playerid) + 1);
    SetPlayerScore(playerid, GetPlayerScore(playerid) - 1);
    return 1;
}
I would like to rep+ the person who helped me.

Thanks
Paco


Re: Freeze after getting killed - SilverKiller - 19.01.2013

Nothing seems to be wrong, does that happen in every server?


Re: Freeze after getting killed - se7evolution - 19.01.2013

No it doesn't


Re: Freeze after getting killed - Patrick - 19.01.2013

Is the problem on script? or maybe on your gta

Try this
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(GetPVarInt(playerid, "Headshotted") == 1)
    {
        SetPVarInt(playerid, "Headshotted", 0);
        GameTextForPlayer(playerid, "~y~Head~r~shot", 3000, 3);
        GameTextForPlayer(killerid, "~g~Head~w~shot", 3000, 3);
    }
    pInfo[playerid][pDeaths]++;
    pInfo[killerid][pKills]++;
    pInfo[playerid][pDuty] = 0;
    pInfo[playerid][pGod] = 0;
    SetPlayerArmour(playerid, 0.00);
    SetPlayerHealth(playerid, 0.00);
    if(GetPVarInt(playerid, "OldSkin"))
    SetPlayerSkin(playerid, GetPVarInt(playerid, "OldSkin"));
    SendDeathMessage(killerid, playerid, reason);
    GivePlayerMoney(killerid, 500000);
    SetPlayerScore(killerid, GetPlayerScore(playerid) + 1);
    SetPlayerScore(playerid, GetPlayerScore(playerid) - 1);
    TogglePlayerControllable(playerid, 1);
    TogglePlayerControllable(killerid, 1);
    return 1;
}



Re: Freeze after getting killed - se7evolution - 20.01.2013

Doesnt work here are some of the codes that have something to do with kill.

pawn Код:
public OnGameModeExit()
{
    KillTimer(ScoreTimer);
    return 1;
}
Anti Spawn Kill
pawn Код:
public Antispawnkill(playerid)
{
    SetPlayerHealth(playerid, 100.0);
    SendClientMessage(playerid, RED, "Your anti-spawnkill protection has been disactivated!");
    return 1;
}
SMALL cut of onplayerspawn
pawn Код:
new rand = random(sizeof(RandomSpawnMafia));
    new rand2 = random(sizeof(RandomSpawnRacers));
    SetCameraBehindPlayer(playerid);
    SetPlayerDrunkLevel(playerid, 0);
    SetPlayerInterior(playerid, 0);
    SetPlayerVirtualWorld(playerid, 0);
    SetPlayerArmour(playerid, 100.0);
    SetPlayerHealth(playerid, 999999999.0);
    SetTimerEx("Antispawnkill", 10000, false, "d", playerid);
    GangZoneShowForPlayer(playerid, MafiaTeam, -16777017);
    GangZoneShowForPlayer(playerid, RacersTeam, 16711888);
    SendClientMessage(playerid, BLUE, "Your anti-spawnkill protection will be disactivated in {FFFFFF}'10 seconds'");
OnPlayerDeath
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(GetPVarInt(playerid, "Headshotted") == 1)
    {
        SetPVarInt(playerid, "Headshotted", 0);
        GameTextForPlayer(playerid, "~y~Head~r~shot", 3000, 3);
        GameTextForPlayer(killerid, "~g~Head~w~shot", 3000, 3);
    }
    pInfo[playerid][pDeaths]++;
    pInfo[killerid][pKills]++;
    pInfo[playerid][pDuty] = 0;
    pInfo[playerid][pGod] = 0;
    SetPlayerArmour(playerid, 0.00);
    SetPlayerHealth(playerid, 0.00);
    if(GetPVarInt(playerid, "OldSkin"))
    SetPlayerSkin(playerid, GetPVarInt(playerid, "OldSkin"));
    SendDeathMessage(killerid, playerid, reason);
    GivePlayerMoney(killerid, 500000);
    SetPlayerScore(killerid, GetPlayerScore(playerid) + 1);
    SetPlayerScore(playerid, GetPlayerScore(playerid) - 1);
    TogglePlayerControllable(playerid, 1);
    TogglePlayerControllable(killerid, 1);
    return 1;
}
Vehicle Dead
pawn Код:
public OnVehicleDeath(vehicleid, killerid)
{
    if(vehicleid == ObjectiveRacers) return SetVehicleToRespawn(ObjectiveRacers);
    else if(vehicleid == ObjectiveMafia) return SetVehicleToRespawn(ObjectiveMafia);
    return 1;
}