How to move to SQL
#1

pawn Код:
//******************************-Banning System-****************************
    if(dUserINT(PlayerName(playerid)).("Nameban") == 1)
    {
        new banned[800], bancheck[64];
        format(bancheck, sizeof(bancheck),"el bans/%s.ban",PlayerName(playerid));
        format(string,sizeof(string),"{FFFFFF}You are banned from this server.\n {FF8000}Do not think of ban evading, it will make the situation worse to your account, don't do it.\n");
        strcat(banned, string);
        format(string,sizeof(string),"{a9c4e4}Ban Information:\n");
        strcat(banned, string);
        format(string,sizeof(string),"{AFAFAF}Username: {FFFFFF}%s\n",PlayerName(playerid));
        strcat(banned, string);
        format(string,sizeof(string),"{AFAFAF}IP Address: {FFFFFF}%s\n",dini_Get(bancheck,"ip"));
        strcat(banned, string);
        format(string,sizeof(string),"{AFAFAF}Reason Banned: {FFFFFF}%s\n",dini_Get(bancheck,"BanReason"));
        strcat(banned, string);
        format(string,sizeof(string),"{AFAFAF}Banned by: {FFFFFF}%s\n",dini_Get(bancheck,"BannedBy"));
        strcat(banned, string);
        format(string,sizeof(string),"{AFAFAF}Feeling wrongfully banned? Appeal your ban at: {a9c4e4}forum.ultragamerz.co\n",dini_Get(bancheck,"BannedBy"));
        strcat(banned, string);
        ShowPlayerDialog(playerid,DIALOG_BAN,DIALOG_STYLE_MSGBOX,"San Fierro Cops And robbers",banned,"Okay","");
        Kicked(playerid, 500);
        return 1;
    }
    //*************************-Login/Register check-***************************
    else if (!udb_Exists(PlayerName(playerid)))
    {
        ShowRegisterScreen(playerid);
        PlayerTextDrawShow(playerid,servname1[playerid]);
        PlayerTextDrawShow(playerid,servname2[playerid]);
        PlayerTextDrawSetString(playerid,servname1[playerid],"~g~~h~~h~S~w~an ~g~~h~~h~F~w~ierro");
        PlayerTextDrawSetString(playerid,servname2[playerid],"~b~Cops ~w~And ~r~Robbers");
        PlayerTextDrawShow(playerid,wb[playerid]);
        PlayerTextDrawSetString(playerid,wb[playerid],"~r~W~w~elcome~r~!");
        PlayerTextDrawShow(playerid,box1[playerid]);
        PlayerTextDrawShow(playerid,box2[playerid]);
        PlayerTextDrawShow(playerid,box3[playerid]);
    }
    else
    {
        PlayerTextDrawShow(playerid,servname1[playerid]);
        PlayerTextDrawShow(playerid,servname2[playerid]);
        PlayerTextDrawSetString(playerid,servname1[playerid],"~g~~h~~h~S~w~an ~g~~h~~h~F~w~ierro");
        PlayerTextDrawSetString(playerid,servname2[playerid],"~b~Cops ~w~And ~r~Robbers");
        ShowLoginScreen(playerid);
        PlayerTextDrawShow(playerid,wb[playerid]);
        PlayerTextDrawSetString(playerid,wb[playerid],"~y~W~w~elcome ~y~B~w~ack~y~!");
        PlayerTextDrawShow(playerid,box1[playerid]);
        PlayerTextDrawShow(playerid,box2[playerid]);
        PlayerTextDrawShow(playerid,box3[playerid]);
    }
    foreach(Player, i)
    {
        if(cl[i] == 1)
        {
            format(string,sizeof(string),"{CCFFCC}** %s(%d) has joined the server.",PlayerName(playerid),playerid);
            SCM(i,-1,string);
            return 1;
        }
    }

    for(new i = 0; i < sizeof(Objects); i++) Player[playerid][view][i] = false; /////////xobj
    return 1;
}
If i had to convert into SQL what i have to do? If you want to help just pm me.
Reply
#2

Read up about MySQL first. By the looks of it, you have little to no knowledge about it.
SQL is a structured query language. So you're using two languages at once.

You can start learning by going to: http://www.w3schools.com/sql/
Reply
#3

Quote:
Originally Posted by ******
Посмотреть сообщение
Also, I don't think you quite understand how PUBLIC forums work. You ask a question openly, someone (maybe many people) replies in the same way, a discussion ensues that everyone can see, and the resulting question and answer train is left available for future generations to see. Thus, when someone else comes along with the same question, they can do a search on that topic, find this thread with the answer, and use it. Asking people to PM you the answer destroys that ability, and is very rude frankly - you are asking us to help you with your problem, but are going to keep that solution hidden from anybody else, thus are taking from the forums without giving anything.
Well said, lad.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)