Death prob
#1

Hello friend! Whats the prob?

When i die it load my data like when i conect.

pawn Код:
public OnPlayerSpawn(playerid)
{
    if(pInfo[playerid][naujokas])
    {
    SetPlayerInterior(playerid, 0);
    pInfo[playerid][skinas] = GetPlayerSkin(playerid);
    GivePlayerMoney(playerid,100000);
    pInfo[playerid][darbas]=0;
    pInfo[playerid][banke]=0;
    pInfo[playerid][apranga]=0;
    pInfo[playerid][play] = true;
    SaveData(playerid);
    }
    if(!pInfo[playerid][naujokas])
    {
    pInfo[playerid][play] = true;
    LoadData(playerid);
    return 1;
    }
    if(GetPVarInt(playerid, "Dead")) {
    SetPlayerPos(playerid,1956.3300,1342.9669,15.3746); // Position of the hospital.
    DeletePVar(playerid, "Dead");
}
    if(pInfo[playerid][ginkllic] == 1)
    {
        SendClientMessage(playerid,0xFFFFFFAA,"Tavo ginklai turi licenzija ,todel gali juos pasilikti!");
        }
    else if(pInfo[playerid][ginkllic] == 0)
        {
        ResetPlayerWeapons(playerid);
    }
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    GameTextForPlayer(playerid, "~r~Suzeistas!", 3000, 6);
    SetPVarInt(playerid, "Dead", 1);
    GameTextForPlayer(killerid, "~r~Ieskomas!", 3000, 6);
    SendClientMessage(killerid,0xFFFFFFAA,"Tu pasikesinai i zmogu ,todel esi ieskomas 1 lygiu!");
    SetPlayerWantedLevel(killerid,1);
    return 1;
}
Reply
#2

Edit: Deleted
Reply
#3

Move the code of OnPlayerSpawn to OnPlayerConnect.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)