AivarasZs Pawn questions
#1

Hey, I'm begginer on Pawn and I ask you it here questions about scripting.

My first question is how to do when I connect to the server and when opened GUI table example first table be the rules and when rules done go change to registration/login table. Please write an easy to understand script. (Simple example.).
PS.: Gamemode is created new blank.
Reply
#2

under onplayerconnect use showplayerdialog (https://sampwiki.blast.hk/wiki/ShowPlayerDialog)
and ondialogresponse callback (https://sampwiki.blast.hk/wiki/OnDialogResponse)
if you have a response (or not - it depends on you) just show the registration/login dialog
Reply
#3

Quote:
Originally Posted by aivarasz
Посмотреть сообщение
Hey, I'm begginer on Pawn and I ask you it here questions about scripting.

My first question is how to do when I connect to the server and when opened GUI table example first table be the rules and when rules done go change to registration/login table. Write an easy to understand script please simple example. (Gamemode is blank.)
OnPlayerConnect handles properties (functions) upon connection. Your "table" may be done by using Textdraws, dialogs, and even messages sent to the client.

pawn Код:
public OnPlayerConnect(playerid)
{
    ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,"Example","Test.","Continue","");
    return 1;
}
Reply
#4

I don't understand the first GUI hidding by secont, when I connect I see first GUI 1sec and he disappears and when be login/registration.

pawn Код:
public OnPlayerConnect(playerid)
{
    ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,"Example","Test.","Continue","");
    bancheck(playerid);
    GetPlayerIp(playerid, PIP, 18);
    format(Query, sizeof(Query), "SELECT * FROM `playerinfo` WHERE `user` = '%s' LIMIT 1", escpname(playerid), PIP);
    mysql_query(Query);
    mysql_store_result();
    if(mysql_num_rows() != 0) {
        new PIP2[18];
        mysql_fetch_field_row(PIP2, "IP");
        if(!strcmp(PIP, PIP2, true) && strlen(PIP2) != 0) {
            SetPVarInt(playerid, "Logged", 1);
            SendClientMessage(playerid, 0x009600AA, "Auto Logged in!");
            if(mysql_fetch_row(line)) {
                new data[3][55];
                new data2[5];
                sscanf(line, "p<|>s[50]s[300]dddds[50]ds[100]", data[0], largestring, data2[0], data2[1], data2[2], data2[3], data[2], data2[4], estring);
                stringempty(estring);
                stringempty(largestring);
                SetPVarInt(playerid, "Kills", data2[0]);
                SetPVarInt(playerid, "Logged", 1);
                SetPVarInt(playerid, "Deaths", data2[1]);
                SetPlayerScore(playerid, data2[2]);
                GivePlayerMoney(playerid, data2[3]);
                SetPVarInt(playerid, "AdminLevel", data2[4]);
                mysql_free_result();
            }
        }
        else {
            SendClientMessage(playerid, 0x009600AA, "This account is registered, please login");
            ShowPlayerDialog(playerid, 15000, DIALOG_STYLE_INPUT , "Login", "This account is registered, please login", "OK", "Cancel");
        }
    }
    else {
        ShowPlayerDialog(playerid, 14600, DIALOG_STYLE_INPUT , "Register", "This account is not registered, please register!", "OK", "Cancel");
        SendClientMessage(playerid, 0x009600AA, "This account is not registered, please register!");
    }
    mysql_free_result();
    return 1;
}
Reply
#5

help?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)