11.11.2014, 20:16
how do i put it that he cant walk around
#include <a_samp>
#define col_grey 0xADADADFF
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;
}
SetTimerEx("KillPlayer",2000,0,"d",playerid);
forward KillPlayer(playerid);
public KillPlayer(playerid)
{
SetPlayerHealth(playerid,-40);//Try this may work and may not
return 1;
}
On topic of script add this:
pawn Код:
Click to download sscanf Click to download zcmd Then put this in your script: (create a empty .pwn) pawn Код:
|
It's a common GTA:SA Bug You Can Do onplayerdeath:
pawn Код:
pawn Код:
|
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
|
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.
|