When someone dies, he can walk around why is that
#1

how do i put it that he cant walk around
Reply
#2

Show us your OnPlayerDeath
Reply
#3

On topic of script add this:
pawn Код:
#include <a_samp>



#define col_grey 0xADADADFF

Then put this in your script: (create a empty .pwn)
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    new Float:x, Float:y, Float:z;
    // Resetting their position:
    GetPlayerPos(playerid, x, y, z);
    SetPlayerPos(playerid, x, y, z);

    // Freezing them in death, he can not respawn:
    TogglePlayerControllable(playerid, 0);
    ApplyAnimation(playerid, "CRACK", "crckdeth1", 4.1, 0, 1, 1, 1, 1, 1);

    // Informing them:
    SendClientMessage(playerid, col_grey, "{FF000}INFO:{FFFFF} You are dead, you can't move!");
    return 1;
}

Edit: my bad i had this on my script with other stuff (RP script): if someone is dead "LSMD" need to revive him just edit some stuff and forgot to remove sscanf2 define & zcmd define.
Reply
#4

It's a common GTA:SA Bug You Can Do onplayerdeath:

pawn Код:
SetTimerEx("KillPlayer",2000,0,"d",playerid);
now:
pawn Код:
forward KillPlayer(playerid);
public KillPlayer(playerid)
{
SetPlayerHealth(playerid,-40);//Try this may work and may not
return 1;
}
Reply
#5

Quote:
Originally Posted by Eth
Посмотреть сообщение
pawn Код:
//Try this may work and may not
lol. are you serious
Reply
#6

Idk lol I never had this problem before and I never checked the solution above before so I am not sure
Reply
#7

TogglePlayerControllable(playerid, false) should solve the problem!
Reply
#8

Quote:
Originally Posted by Alex Magaсa
Посмотреть сообщение
On topic of script add this:
pawn Код:
#include <a_samp>
#include <zcmd>
#include <sscanf2>

#define col_grey 0xADADADFF
But first download sscanf + zcmd include:
Click to download sscanf
Click to download zcmd

Then put this in your script: (create a empty .pwn)
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    new Float:x, Float:y, Float:z;
    // Resetting their position:
    GetPlayerPos(playerid, x, y, z);
    SetPlayerPos(playerid, x, y, z);

    // Freezing them in death, he can not respawn:
    TogglePlayerControllable(playerid, 0);
    ApplyAnimation(playerid, "CRACK", "crckdeth1", 4.1, 0, 1, 1, 1, 1, 1);

    // Informing them:
    SendClientMessage(playerid, col_grey, "{FF000}INFO:{FFFFF} You are dead, you can't move!");
    return 1;
}
Credit given where credit due... That's a good code snippet, yet there's a few things wrong...

sscanf and zcmd aren't even used... Your hex codes are wrong too around INFO.

Although, it is a nice snippet of code, +Rep for good code.

Quote:
Originally Posted by Eth
Посмотреть сообщение
It's a common GTA:SA Bug You Can Do onplayerdeath:

pawn Код:
SetTimerEx("KillPlayer",2000,0,"d",playerid);
now:
pawn Код:
forward KillPlayer(playerid);
public KillPlayer(playerid)
{
SetPlayerHealth(playerid,-40);//Try this may work and may not
return 1;
}
Also another good snippet, as long as it actually works as intended when called.



We need the OP to say more about what is happening, and explain more about what led to the problem.
Reply
#9

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
Credit given where credit due... That's a good code snippet, yet there's a few things wrong...

sscanf and zcmd aren't even used... Your hex codes are wrong too around INFO.

Although, it is a nice snippet of code, +Rep for good code.



Also another good snippet, as long as it actually works as intended when called.



We need the OP to say more about what is happening, and explain more about what led to the problem.
it's when you click shift or jumping button after dying that's what I noticed
Reply
#10

Quote:
Originally Posted by Eth
Посмотреть сообщение
it's when you click shift or jumping button after dying that's what I noticed
True, there was also that fire death bug thing too though and that's what your code reminds me of.

Quote:
Originally Posted by Blademaster680
Посмотреть сообщение
Why not run a timer, if you dont want to use TogglePlayerControllable, then set a timer and when they die, get their position and run the timer every second or so. If there position has changed it will teleport them back to that position they died at and it will set the action.
That's what Eths suggestion did, except without the position checking.

Your position checking mention, could spur Eth into re-coding to integrate your suggestion. Maybe even adding a toggle-able freeze from a define at the top of the script.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)