Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Help me #1

$
0
0
Code:

#if defined USE_STATS
CMD:stats(playerid,params[]) {
        new string[128], pDeaths, player1, h, m, s;
        if(isnull(params)) player1 = playerid;
        else player1 = strval(params);

        if(IsPlayerConnected(player1)) {
            TotalGameTime(player1, h, m, s);
                if(PlayerInfo[player1][Deaths] == 0) pDeaths = 1; else pDeaths = PlayerInfo[player1][Deaths];
        format(string, sizeof(string), "Account Name: %s\nLevel: %d\nV.I.P: %d\nScores: %d\nKills: %d\nDeaths: %d\nRatio: %0.2f\nMoney: $%d\nBank: $%d\nTime: %d hrs %d mins %d secs",PlayerName2(player1),PlayerInfo[player1][Level],PlayerInfo[player1][Vip],GetPlayerScore(player1), PlayerInfo[player1][Kills], PlayerInfo[player1][Deaths],Float:PlayerInfo[player1][Kills]/Float:pDeaths,GetPlayerMoney(player1),PlayerInfo[player1][bank], h, m, s);
                ShowPlayerDialog(playerid,6969,DIALOG_STYLE_MSGBOX,"Stats",string,"Ok","");
                return SendClientMessage(playerid, green, string);
        } else return SendClientMessage(playerid, red, "Player Not Connected!");
}
#endif

this stats command

and this

Code:

        if(udb_Exists(PlayerName2(playerid))) {
                format(string, sizeof(string), "Welcome %s, to the new WhiteX Community ", PlayerName);
                SendClientMessage(playerid, COLOR_ORANGE, string);
                format(file,256,"/ladmin/users/%s.sav",udb_encode(PlayerName));
                new tmp[50],tmp2[256];
                GetPlayerIp(playerid,tmp,128);
                tmp2 = dini_Get(file,"ip");
                if(!strcmp(tmp,tmp2,true) && ServerInfo[AutoLogin] == 1) {
                        format(string,128,"Welcome back, %s. You have automatically been logged in.",PlayerName);
                          SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                        PlayerInfo[playerid][LoggedIn] = 1;
                        GivePlayerMoney(playerid,dUserINT(PlayerName2(playerid)).("money")-GetPlayerMoney(playerid));
                        PlayerInfo[playerid][Deaths] = (dUserINT(PlayerName2(playerid)).("deaths"));
                        PlayerInfo[playerid][Kills] = (dUserINT(PlayerName2(playerid)).("kills"));
                        PlayerInfo[playerid][Level] = (dUserINT(PlayerName2(playerid)).("level"));
                        PlayerInfo[playerid][Vip] = (dUserINT(PlayerName2(playerid)).("vip"));
                        PlayerInfo[playerid][RFCLevel] = (dUserINT(PlayerName2(playerid)).("RFClevel"));
                        PlayerInfo[playerid][AGLevel] = (dUserINT(PlayerName2(playerid)).("AGlevel"));
                        PlayerInfo[playerid][B2KLevel] = (dUserINT(PlayerName2(playerid)).("B2Klevel"));
                        PlayerInfo[playerid][BALevel] = (dUserINT(PlayerName2(playerid)).("BAlevel"));
            PlayerInfo[playerid][BMFLevel] = (dUserINT(PlayerName2(playerid)).("BMFlevel"));
            PlayerInfo[playerid][COPLevel] = (dUserINT(PlayerName2(playerid)).("COPlevel"));
            PlayerInfo[playerid][BLevel] = (dUserINT(PlayerName2(playerid)).("Blevel"));
            PlayerInfo[playerid][GRPLevel] = (dUserINT(PlayerName2(playerid)).("GRPlevel"));
            PlayerInfo[playerid][KODLevel] = (dUserINT(PlayerName2(playerid)).("KODlevel"));
                PlayerInfo[playerid][XEFLevel] = (dUserINT(PlayerName2(playerid)).("XEFlevel"));
                PlayerInfo[playerid][OSLevel] = (dUserINT(PlayerName2(playerid)).("OSlevel"));
            PlayerInfo[playerid][TPKLevel] = (dUserINT(PlayerName2(playerid)).("TPKlevel"));
            PlayerInfo[playerid][hours] = (dUserINT(PlayerName2(playerid)).("hours"));
            PlayerInfo[playerid][mins] = (dUserINT(PlayerName2(playerid)).("minutes"));
            PlayerInfo[playerid][secs] = (dUserINT(PlayerName2(playerid)).("seconds"));
                        PlayerInfo[playerid][Registered] = 1;
                        LoadPlayer(playerid);
                }
                else {
                        format(string,sizeof(string),"The name %s, is already registered on this Server. Please login or you will be disconnected in 60 seconds",PlayerName);
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                          PlayerInfo[playerid][LoggedIn] = 0;
                          ShowPlayerDialog(playerid, DIALOGID0+2, DIALOG_STYLE_INPUT, "{FF00D9}•» Login Account «««•","{0835C7}WhiteX , \n \n{146AC7}Player Login\n \n{00FF40}The Name {00FF40}Registered.\n{FF002B}If This Is Not Your Account, Please Quit And Change Your Name.\n \nPlease {D6D631}Enter Your Password {FFFFFF}To Login:", "Login", "Quit");
            SetTimerEx("KickTimer",60000000,0,"i",playerid);
                }
        }

when i connect,dialog login will appear,once i entered wrong password,that dialog gone,it wont appear for next incorrect login
please help me

this
Code:

                        format(string,sizeof(string),"The name %s, is already registered on this Server. Please login or you will be disconnected in 60 seconds",PlayerName);
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                          PlayerInfo[playerid][LoggedIn] = 0;
                          ShowPlayerDialog(playerid, DIALOGID0+2, DIALOG_STYLE_INPUT, "{FF00D9}•» Login Account «««•","{0835C7}WhiteX , \n \n{146AC7}Player Login\n \n{00FF40}The Name {00FF40}Registered.\n{FF002B}If This Is Not Your Account, Please Quit And Change Your Name.\n \nPlease {D6D631}Enter Your Password {FFFFFF}To Login:", "Login", "Quit");
            SetTimerEx("KickTimer",60000000,0,"i",playerid);
                }
        }


Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>