SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 07/01/2015, 09:55 AM   #51
Mijata
Gangsta
 
Mijata's Avatar
 
Join Date: Mar 2014
Location: Serbia
Posts: 632
Reputation: 8
Default Re: .Help.------ .spawn-----.

no i don't have errors i only again can't login / spawn
Mijata is offline   Reply With Quote
Old 07/01/2015, 09:56 AM   #52
danish007
Huge Clucker
 
danish007's Avatar
 
Join Date: Apr 2014
Posts: 445
Reputation: 26
Default Re: .Help.------ .spawn-----.

or use under OnPlayerSpawn
pawn Code:
if(pInfo[playerid][Registered] == 0 || pInfo[playerid][Logged] == 0)
{
Kick(playerid);
return 1;
}

in your post. you said why player can be spawned without Register now you are saying player can't login/spawn what is the actual problem?
danish007 is offline   Reply With Quote
Old 07/01/2015, 10:02 AM   #53
Mijata
Gangsta
 
Mijata's Avatar
 
Join Date: Mar 2014
Location: Serbia
Posts: 632
Reputation: 8
Default Re: .Help.------ .spawn-----.

now player can't be spawned if is not registered but now registered player can't spawn
Mijata is offline   Reply With Quote
Old 07/01/2015, 10:53 AM   #54
danish007
Huge Clucker
 
danish007's Avatar
 
Join Date: Apr 2014
Posts: 445
Reputation: 26
Default Re: .Help.------ .spawn-----.

show me login dialog.... code
danish007 is offline   Reply With Quote
Old 07/01/2015, 11:12 AM   #55
Mijata
Gangsta
 
Mijata's Avatar
 
Join Date: Mar 2014
Location: Serbia
Posts: 632
Reputation: 8
Default Re: .Help.------ .spawn-----.

Code:
    if(dialogid == DIALOG_LOGIN)
    {
        if(response)
        {
            new Jfile[100],pIP[16],buf[145];
            format(Jfile, 60, ACCOUNTS_PATH, GetName(playerid));
            INI_ParseFile(Jfile, "GetPassword", .bExtra = true, .extra = playerid);
            WP_Hash(buf, sizeof(buf),inputtext);

            if(strcmp(pInfo[playerid][Password], buf, false) == 0)
            {
                format(Jfile, 100, ACCOUNTS_PATH, GetName(playerid));
                INI_ParseFile(Jfile, "LoginPlayer", .bExtra = true, .extra = playerid);
                SendClientMessage(playerid,green,"You have been succesfully logged In!");

                SetPlayerScore(playerid, pInfo[playerid][Score]);
                GivePlayerMoney(playerid, pInfo[playerid][Cash]);
                IsRegistred[playerid] = true;
                pInfo[playerid][Logged] = 1;

                GetPlayerIp(playerid,pIP,16);
                format(Jfile, 100, ACCOUNTS_PATH, GetName(playerid));
                new INI:ACCOUNT = INI_Open(Jfile);
                INI_WriteString(ACCOUNT, "LastLoggedIP", pIP);
                INI_Close(ACCOUNT);
                #if LoginTextDraw == true
                TextDrawHideForPlayer(playerid, TEXT_PASSWORD);
                TextDrawHideForPlayer(playerid, TEXT_REGISTER);
                TextDrawHideForPlayer(playerid, TEXT_REGISTERED);
                CancelSelectTextDraw(playerid);
                #endif
            }
            else
            {
                pInfo[playerid][LoginAttempts]++;
                if(pInfo[playerid][LoginAttempts] >= MAX_LOGIN_ATTEMPTS)
                {
                    format(Jstring, sizeof(Jstring),"%s has been automatically kicked | Reason: 'Incorrect password'", GetName(playerid));
                    SendToAdmins(orange,Jstring);
                    ShowPlayerDialog(playerid, JDIALOGS+45, DIALOG_STYLE_MSGBOX, "WARRING","You have been automatically kicked | Reason: 'Incorrect password'", "Ok", "");
                    SetTimerEx("KickPlayer",100,false,"d",playerid);
                    return 1;
                }
                format(Jstring, sizeof(Jstring),"Account \"%s\"\nEnter your password to login\n{FF0000}*Incorrect password", GetName(playerid));
                ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Account Login error",Jstring, "Login", "Quit");
            }
        }
        #if LoginTextDraw == false
        else SetTimerEx("KickPlayer",100,false,"d",playerid);
        #endif
    }
    return true;
}
Mijata is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Spawn issue - I spawn at Blueberry after registering AndySedeyn Scripting Help 15 25/05/2014 10:44 PM
spawn player without having to press spawn lean1337 Scripting Help 4 15/02/2013 09:35 PM
Spawn Selection textdraw and spawn music DownDuckling Scripting Help 4 14/10/2012 02:42 AM
[AJUDA] Colocar TextDraw Antes do Spawn e Após Spawn davidjnio Português/Portuguese 9 30/08/2011 07:53 PM
[Help] Object/item ectra spawn on player spawn? No-Half-Measures Help Archive 3 21/01/2010 10:38 AM


All times are GMT. The time now is 05:33 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.