help with OnPlayerDeath Aninmation
#1

Im trying to make it so when people die, they respawn at the same location with 100hp but stuck in the animation "FALL_collapse. This is what of tried.

public OnPlayerDeath(playerid)
{
ApplyAnimation(playerid,"FALL_collapse", 4.1, 0, 1, 1, freeze, 0, 1);
Hspawn[playerid] = 1;

return 0;
}

But when i complie i get this error:
C:\samp\sampserver\samp03csvr_win32\gamemodes\myte stserver.pwn(156) : error 035: argument type mismatch (argument 3)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#2

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    ApplyAnimation(playerid,"PED","FALL_collapse", 4.1, 0, 1, 1, 1, 0, 1);
    Hspawn[playerid] = 1;
    return 1;
}
https://sampwiki.blast.hk/wiki/ApplyAnimation
Reply
#3

i did that and when players die, it does not respawn them in front of the player with 100 hp, and freeze them in the animation. It just spawns them at the hosptial.

This is my Script:

public OnPlayerDeath(playerid)
{
SetPlayerHealth(playerid, 100);
ApplyAnimation(playerid,"PED","FALL_collapse", 4.1, 0, 1, 1, 1, 0, 1);
Hspawn[playerid] = 1;

return 0;
}

public OnPlayerSpawn(playerid)
{
if (Hspawn[playerid] == 1)
{
if(GetPlayerMoney(playerid) > 100)
{
Hspawn[playerid] = 0;
SetPlayerHealth(playerid, 50.5);
SetPlayerCameraPos(playerid, 1186.8892,-1323.4941,13.5590);
SetPlayerCameraLookAt(playerid, 1190.8926,-1325.4154,16.5625);
TogglePlayerControllable(playerid, true);
SetTimerEx("SpawnPlayerToHospital", 20000, 0, "%d", playerid);
SendClientMessage(playerid,0xDD000096,"You Passed Out, and was rush to Los Santos hospital.");
SendClientMessage(playerid,0xFFFFFF96,"|-----------------------------------|");
SendClientMessage(playerid,0xDD000096,"Your medical bill cost: 100$");
GivePlayerMoney(playerid, -100);
return 1;
}
}
return 1;
}

forward SpawnPlayerToHospital(playerid);
public SpawnPlayerToHospital(playerid)
{

TogglePlayerControllable(playerid, false);
SetPlayerPos(playerid,1176.6060,-1323.7875,14.0296);
SetCameraBehindPlayer(playerid);
}
Reply
#4

Ok, i'v been working on the script, and now when people die they respawn where they died, but they just frozen and not in the animation, also when 20 seconds pass they spawn in front of hosptial. What im trying to do is When a player dies, they respawn where they died with 100 hp and stuck in an animation before being sent to hosptial. While in that animation they have a option to /accept death (to die and go to hosptial and wait 20seconds there, or do /service ems (Lets anybody in the LSPD faction know they are injured and need to be rescued.

This is my Script:

public OnPlayerDeath(playerid, killerid, reason)
{
GetPlayerPos(playerid, rX, rY, rZ);
Hspawn[playerid] = 1;
return 1;
}

public OnPlayerSpawn(playerid)
{
if (Hspawn[playerid] == 1)
{
SetPlayerPos(playerid, rX, rY, rZ);
TogglePlayerControllable(playerid, false);
ApplyAnimation(playerid, "BEACH", "bather", 0.1, 0, 1, 1, 1, 20000);
SetTimerEx("SpawnPlayerToHospital", 20000, false, "i", playerid);
}
return 1;
}

forward SpawnPlayerToHospital(playerid);
public SpawnPlayerToHospital(playerid)
{
Hspawn[playerid] = 0;
SetPlayerHealth(playerid, 100.5);
SendClientMessage(playerid,0xDD000096,"You Passed Out, and was rush to Los Santos hospital.");
SendClientMessage(playerid,0xFFFFFF96,"|-----------------------------------|");
SendClientMessage(playerid,0xDD000096,"Your medical bill cost: 100$");
GivePlayerMoney(playerid, -100);
SetPlayerPos(playerid,1176.6060,-1323.7875,14.0296);
TogglePlayerControllable(playerid, 1);
SetCameraBehindPlayer(playerid);
ClearAnimations(playerid);
}
Reply
#5

anybody out there, that can help me please dont be shy!
Reply
#6

line 156 is?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)