ban warn cmd
#3

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    SeatBelt[playerid] = 0;
    Smask[playerid] = 0;
   
    TextDrawDestroy(JoinText[playerid]);
    Delete3DTextLabel(MaskIDLab[playerid]);

    new PlayerName[MAX_PLAYER_NAME], str[128];
    GetPlayerName(playerid, PlayerName, sizeof(PlayerName));

    if(ServerInfo[ConnectMessages] == 1)
    {
        for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && playerid != i)
        {
            switch (reason)
            {
                case 0: format(str, sizeof(str), "[!] %s (%d) has left West Coast Life Roleplay. (Timeout)", PlayerName, playerid);
                case 1: format(str, sizeof(str), "[!] %s (%d) has left West Coast Life Roleplay. (Leaving)", PlayerName, playerid);
                case 2: format(str, sizeof(str), "[!] %s (%d) has left West Coast Life Roleplay. (Kicked/Banned)", PlayerName, playerid);
            }
            if(PlayerInfo[i][Level] > 1) SendClientMessage(i,grey,str);
            else {
                //format(string,sizeof(string),"[!] %s (%d) has joined West Coast Life Roleplay.", PlayerName, playerid);
                //SendClientMessage(i,grey,string);
            }
        }
    }

    if(PlayerInfo[playerid][Jailed]==1){
        new file[MAX_PLAYER_NAME+10], plaName[MAX_PLAYER_NAME];
        GetPlayerName(playerid,plaName, sizeof(plaName));
        format(file, sizeof(file), "%s.jail", plaName);
        new File:jailfile = fopen(file, io_write);
        new numstr[16];
        format(numstr, sizeof(numstr), "%i", PlayerInfo[playerid][JailTime]);
        fwrite(jailfile, numstr);
        fclose(jailfile);
    }

    if(PlayerInfo[playerid][LoggedIn] == 1)
    {
        SavePlayer(playerid);
        for(new i; i < 13; i++)
        {
            GivePlayerWeapon(playerid, --pSpawnWeapon[playerid][i], --pSpawnAmmo[playerid][i]);
        }
    }
    if(udb_Exists(PlayerName2(playerid))) dUserSetINT(PlayerName2(playerid)).("LoggedIn",0);
    PlayerInfo[playerid][LoggedIn] = 0;
    PlayerInfo[playerid][Level] = 0;
    PlayerInfo[playerid][Jailed] = 0;
    PlayerInfo[playerid][Frozen] = 0;

    if(PlayerInfo[playerid][Jailed] == 1) KillTimer( JailTimer[playerid] );
    if(PlayerInfo[playerid][Frozen] == 1) KillTimer( FreezeTimer[playerid] );
    if(ServerInfo[Locked] == 1) KillTimer( LockKickTimer[playerid] );

    if(PlayerInfo[playerid][pCar] != -1) CarDeleter(PlayerInfo[playerid][pCar]);

    #if defined ENABLE_SPEC
    for(new x=0; x<MAX_PLAYERS; x++)
        if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && PlayerInfo[x][SpecID] == playerid)
            AdvanceSpectate(x);
    #endif

    return 1;
}
I was working with saving system but years ago ^^
Reply


Messages In This Thread
ban warn cmd - by Lajko1 - 03.04.2014, 13:05
Re: ban warn cmd - by Bingo - 03.04.2014, 13:20
Re: ban warn cmd - by Lajko1 - 03.04.2014, 13:45
Re: ban warn cmd - by Lajko1 - 03.04.2014, 17:44
Re: ban warn cmd - by Kyance - 03.04.2014, 18:16
Re: ban warn cmd - by Lajko1 - 03.04.2014, 18:29
Re: ban warn cmd - by Extraordinariness - 04.04.2014, 00:22
Re: ban warn cmd - by Bingo - 04.04.2014, 00:25
Re: ban warn cmd - by Lajko1 - 04.04.2014, 15:55
Re: ban warn cmd - by Lajko1 - 05.04.2014, 22:46

Forum Jump:


Users browsing this thread: 1 Guest(s)