Help here a bit.
#1

When i die every time this come up for me, how can i remove this with the spawn button?

Reply
#2

Code for onplayerdeath?
What happens? Are you sending them somewhere, such as SetPlayerPos?
Reply
#3

Here is my onplayerdeath

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    Wounded[playerid] = 1;
    GetPlayerPos(playerid, DeathDest[playerid][0],DeathDest[playerid][1],DeathDest[playerid][2]);
    DeathWorld[playerid] = GetPlayerVirtualWorld(playerid);
    DoDeath(playerid);
    SetPlayerColor(playerid,COLOR_CIVILIAN);
    SetPlayerDrunkLevel(playerid, 0);
    WantedPoints[playerid] = 0;
    InShamal[playerid] = 0;
    InAndrom[playerid] = 0;
    CopOnDuty[playerid] = 0;
    PlayerCuffed[playerid] = 0;
    TruckDelivering[playerid] = 0;
    PlayerTazed[playerid] = 0;
    PlayerTied[playerid] = 0;
    IsUsingAnim[playerid] = 0;
    SwatOnDuty[playerid] = 0;
    PlayerTazed[playerid] = 0;
    MedicOnDuty[playerid] = 0;
    IsSmoking[playerid] = 0;
    Seatbelt[playerid] = 0;
    GuardOnDuty[playerid] = 0;
    if(FarmerVar[playerid] != 0) { FarmerVar[playerid] = 0; DisablePlayerCheckpoint(playerid); }
    if(TruckDelivering[playerid] != 0) { TruckDelivering[playerid] = 0; DisablePlayerCheckpoint(playerid); }
    if(gPlayerUsingLoopingAnim[playerid]) { gPlayerUsingLoopingAnim[playerid] = 0; }
    if(AdminDuty[playerid] == 1) { PlayerInfo[playerid][pHospital] = 0; }
    if(PlayerInfo[playerid][pJailed] > 0)
    {
        if(PlayerInfo[playerid][pJailed] == 1)
        {
            SetPlayerVirtualWorld(playerid,2);
            SetPlayerInterior(playerid,6);
            SetPlayerPos(playerid,264.5743,77.5118,1001.0391);
            SetPlayerHealth(playerid,100);
        }
        else if(PlayerInfo[playerid][pJailed] == 2)
        {
            SetPlayerVirtualWorld(playerid,10);
            SetPlayerInterior(playerid,3);
            SetPlayerPos(playerid,198.3940,162.0881,1003.0300);
        }
        else if(PlayerInfo[playerid][pJailed] == 3)
        {
            SetPlayerVirtualWorld(playerid,2);
            SetPlayerInterior(playerid,10);
            SetPlayerPos(playerid,219.4495,110.0645,999.0156);
        }
        else if(PlayerInfo[playerid][pJailed] == 4)
        {
            SetPlayerVirtualWorld(playerid,0);
            SetPlayerInterior(playerid,0);
            new AjailRand = random(4);
            if(AjailRand == 0)
            {
                SetPlayerPos(playerid, 1040.6840,1017.3040,55.3047);
            }
            if(AjailRand == 1)
            {
                SetPlayerPos(playerid, 1048.6038,1016.7516,55.3047);
            }
            if(AjailRand == 2)
            {
                SetPlayerPos(playerid, 1048.0579,1007.3638,55.3047);
            }
            if(AjailRand == 3)
            {
                SetPlayerPos(playerid, 1040.3180,1007.6415,55.3047);
            }
            SetPlayerVirtualWorld(playerid,0);
        }
    }
    if(PlayerInfo[playerid][pHeadValue] > 0)
    {
        if(IsPlayerConnected(killerid))
        {
            if(PlayerInfo[killerid][pFaction] == HITMAN)
            {
                if(GoChase[killerid] == playerid)
                {
                    new hitname[MAX_PLAYER_NAME];
                    new killer[MAX_PLAYER_NAME];
                    new string[128];
                    GetPlayerName(killerid, killer, sizeof(killer));
                    GivePlayerCash(killerid, PlayerInfo[playerid][pHeadValue]);
                    format(string,sizeof(string),"** %s has fulfilled the contract on %s and collected $%d",killer,hitname,PlayerInfo[playerid][pHeadValue]);
                    SendFactionMessage(9, COLOR_WHITE, string);
                    PlayerInfo[playerid][pHeadValue] = 0;
                    GotHit[playerid] = 0;
                    GetChased[playerid] = 999;
                    GoChase[killerid] = 999;
                }
            }
        }
    }
    if(AdminDuty[playerid] == 1){ Wounded[playerid] = 0; }
    if(Planted[playerid] == 1)
    {
        DestroyObject(C4[playerid]);
        Bomb[playerid] = 0;
        Planted[playerid] = 0;
    }
    return 1;
}
Reply
#4

Try setting spawning the player OnPlayerRequestClass instead of letting them choose a class. assuming this is a roleplay server you wouldn't want them to pick a class from there anyway.
Reply
#5

Quote:
Originally Posted by Shadow_
Посмотреть сообщение
Try setting spawning the player OnPlayerRequestClass instead of letting them choose a class. assuming this is a roleplay server you wouldn't want them to pick a class from there anyway.
What should i add in OnPlayerRequestClass?
Reply
#6

pawn Код:
public OnPlayerRequestClass(playerid,classid)
{
    SpawnPlayer(playerid);
    return 1;
}
Reply
#7

Quote:
Originally Posted by [MG]Dimi
Посмотреть сообщение
pawn Код:
public OnPlayerRequestClass(playerid,classid)
{
    SpawnPlayer(playerid);
    return 1;
}
Still same,

here is my OnPlayerRequestClass

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    if(IsPlayerNPC(playerid)) return 1;
    SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
    if(RegistrationStep[playerid] == 0 && gPlayerLogged[playerid] != 1)
    {
        InitPlayerConnection( playerid );
    } else {
        SpawnPlayer(playerid);
    }
    return 0;
}
Reply
#8

you must check this !
pawn Код:
if(PlayerInfo[playerid][pJailed] == 1)
        {
            SetPlayerVirtualWorld(playerid,2);
            SetPlayerInterior(playerid,6);
            SetPlayerPos(playerid,264.5743,77.5118,1001.0391);
            SetPlayerHealth(playerid,100);
        }
You must change this pos !
Reply
#9

Given the screenshot, you have also lost the connection. Does this happen everytime you die or was this a coinsidence?
Reply
#10

Quote:
Originally Posted by ******
Посмотреть сообщение
If it happens every time you must have "ForceClassSelection" somewhere.
Can you help me with that?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)