Can someone know how to not automatic death?
#1

Like,. when you got killed you'll stay first., like any minutes and you can /server ems and notifies the LSMFD and they'll /heal and put you in the ambulance until it reach the hospital..

I got like when I get killed it'll automatically go to hospital., help please..
Reply
#2

If I managed to understand your extremely broken english properly, I guess you're talking about a some kind of "death mode" ?

If so, you need to trigger a variable as true once a player dies and sets its position to where he died. Quite simple. Here's a demonstration:

pawn Код:
new bool:DID_IJUSTDIE[MAX_PLAYERS];
new Float:MYCOOL_COORDS[MAX_PLAYERS][4];

public OnPlayerSpawn(playerid)
{
    if(DID_IJUSTDIE[playerid])
        SetPlayerPos(playerid, MYCOOL_COORDS[playerid][0], MYCOOL_COORDS[playerid][1], MYCOOL_COORDS[playerid][2]),
        SetPlayerFacingAngle(playerid, MYCOOL_COORDS[playerid][3]),
        TogglePlayerControllable(playerid, false),
        DID_IJUSTDIE[playerid] = false;    
    return 1;
}

public OnPlayerDeath(playerid)
{
    DID_IJUSTDIE[playerid] = true;
   
    GetPlayerPos(playerid, MYCOOL_COORDS[playerid][0], MYCOOL_COORDS[playerid][1], MYCOOL_COORDS[playerid][2]);
    GetPlayerFacingAngle(playerid, MYCOOL_COORDS[playerid][3]);
    return 1;
}
Reply
#3

WHat is this? it comes out error
Quote:

public OnPlayerSpawn(playerid)
{
TogglePlayerSpectating(playerid, false);
// Anti F4 Bug - Logging/Registering
if(!PlayerInfo[playerid][pLoggedIn] && !IsPlayerNPC(playerid))
{
if(IsPlayerNPC(playerid)) return 1;
SetPlayerJoinCamera(playerid);
SetSpawnInfo( playerid, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
new file[64];
format(file, sizeof(file), "users/%s.ini", RPNU(playerid));
// Player isn't banned
if(dini_Int(file, "AdminAccount") == 1)
{
format(file, sizeof(file), "users/%s.ini",RPNU(playerid));
SetPlayerName(playerid, dini_Get(file, "OldName"));
format(file, sizeof(file), "users/%s.ini", RPNU(playerid));
ShowDialog(playerid, 2);
}
if(!dini_Exists(file))
{
ShowDialog(playerid, 1);
return 1;
}
else
{
ShowDialog(playerid, 2);
}
return 1;
}

and another one
Quote:

public OnPlayerDeath(playerid, killerid, reason)
{
if(IsPlayerLoggedIn(playerid))
{
if(g_bIsRobbiz[playerid])
{
DisablePlayerCheckpoint(playerid);
DestroyObject(g_robbizBag[playerid]);
g_apprehendedCash[playerid] = 0;
g_bIsRobbiz[playerid] = false;
new copMessage[64];
format(copMessage, sizeof(copMessage), "** %s has been hospitalized and failed the business robbery.", RPN(playerid));
SendCopMessage(COLOR_BLUE, copMessage);
}

Reply
#4

I don't understand your issue, Jardzskiiz. What is the error? Where is it?
Reply
#5

Код:
error 021: symbol already defined: "OnPlayerSpawn"
Код:
error 021: symbol already defined: "FC_OnPlayerDeath"
Reply
#6

Did you copy my lines of code word by word?

That was just a demonstration, you are not supposed to copy them.
They are just there to make you understand how it should work.
Reply
#7

Oh my bad.. xD sorry Im just asian bro, I cant really do much understand does English terms
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)