[Ajuda] Salvamento de sуcio
#1

galera tenho esse cmd de sуcio mas quando player sai do serve ou do /gmx, ele с salva.

pawn Код:
if(strcmp(cmd, "/darsocio", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /darsocio [id]");
                return 1;
            }
            new para1;
            para1 = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            if (PlayerInfo[playerid][pAdmin] >= 1338)
            {
                if(IsPlayerConnected(para1))
                {
                    if(para1 != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(para1, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        PlayerInfo[para1][pSocio] = 1;
                        format(string, sizeof(string), "   Vocк ganhou VIP socio do admin %s", sendername);
                        SendClientMessage(para1, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "   Vocк deu VIP socio para %s.", giveplayer);
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo esta autorizado a usar este comando!");
            }
        }
        return 1;
    }
    if(strcmp(cmd, "/retirarsocio", true) == 0)
    {
        SendClientMessage(playerid, COLOR_GRAD1, "   Vocк deve usar /retirarvip!");
        return 1;
    }
como faзo para salvar?
Reply
#2

1. Qual sistema de salvamento vocк usa?

2. Posta seu OnPlayerDisconnect.
Reply
#3

ta ai.
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    new car = GetPlayerVehicleID(playerid);
    Police[car][Use] = false;
    AttachObjectToVehicle(Police[car][Siren],0,0.0,0.0,0.0,0.0,0.0,0.0);
    AttachObjectToVehicle(Police[car][Blue],0,0.0,0.0,0.0,0.0,0.0,0.0);
    AttachObjectToVehicle(Police[car][Red],0,0.0,0.0,0.0,0.0,0.0,0.0);
    DestroyObject(Police[car][Siren]);
    DestroyObject(Police[car][Blue]);
    DestroyObject(Police[car][Red]);
    KillTimer(Police[car][Timer]);
    Equipamentos[playerid] = 1;
    sireneon[playerid] = 1;
    KillTimer(tempotd[playerid]);
    new caller = Mobile[playerid];
    OnPlayerSave(playerid);
    if(caller != 255)
    {
        if(caller < 255)
        {
            SendClientMessage(caller,  COLOR_GRAD2, "A ligaзгo caiu...");
            CellTime[caller] = 0;
            CellTime[playerid] = 0;
            Mobile[caller] = 255;
        }
        Mobile[playerid] = 255;
        CellTime[playerid] = 0;
    }
    if(HireCar[playerid] > 0)
    {
        VTrancado[HireCar[playerid]] = 0;
        UnLockCar(HireCar[playerid]);
        SetVehicleToRespawn(HireCar[playerid]);
        HireCar[playerid] = 0;
    }
    if (PlayerInfo[playerid][pBarraca] != 0)
    {
        RemoveBarraca(playerid);
    }
    if (PlayerInfo[playerid][pParedao] != 0)
    {
        RemoveParedao(playerid);
    }
    if(pRoadblock[playerid] != 0)
    {
        RemoveRoadblock(playerid);
    }
    if(pGangRoadblock[playerid] != 0)
    {
        RemoveGangRoadblock(playerid);
    }
    if(SpikeInfo[playerid][sCreated] != 0)
    {
        RemoveRoadPregos(playerid);
    }
    if(pRoadCones[playerid] != 0)
    {
        RemoveRoadCones(playerid);
    }
    switch(reason)
    {
        case 0: format(gstring, sizeof(gstring), "%s saiu do server por erro de conexгo ou crash", PlayerName(playerid));
        case 1: format(gstring, sizeof(gstring), "%s saiu por vontade propria.", PlayerName(playerid));
        case 2: format(gstring, sizeof(gstring), "%s saiu do server kickado ou banido", PlayerName(playerid));
    }
    ProxDetector(100.0, playerid, gstring,COR_COSA,COR_COSA,COR_COSA,COR_COSA,COR_COSA);
    gActivePlayers[playerid]--;
    numplayers--;
    if(MudarNickAceito[playerid] == 1)
    {
        MudarNickAceito[playerid] = 0;
    }
    if(MudarSenhaAceito[playerid] == 1)
    {
        MudarSenhaAceito[playerid] = 0;
    }
    if(EstacionarAceito[playerid] == 1)
    {
        EstacionarAceito[playerid] = 0;
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)