SA-MP Forums Archive
Mod from TOTAL SCRATCH - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Mod from TOTAL SCRATCH (/showthread.php?tid=363300)



Mod from TOTAL SCRATCH - SEnergy - 27.07.2012

Hello, I want to create a mod from total scratch, that means without that "spawn" thing on start, is there any way to get rid of that? you know, when you connect to the server you have dialog box with "<<" ">>" and "spawn", i wanna get rid of that because I want to create login, register etc, and I don't know how to stop that -.-'

basically I have this:
PHP код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>
new password[5] = "mypw";
new 
iLoginDialog 2;
new 
logged 0;
main()
{
    print(
"\n----------------------------------");
    print(
" Project-Caradhras.com Real Life v0.1");
    print(
"----------------------------------\n");
}
public 
OnGameModeInit()
{
    
SetGameModeText("Caradhras Real Life v0.1");
    
AddPlayerClass(01958.37831343.157215.3746269.1425000000);
    
AddStaticVehicle(4681960134515.4269252251);
    return 
1;
}
public 
OnPlayerRequestClass(playeridclassid)
{
    
SetPlayerPos(playerid1958.37831343.157215.3746);
    
SetPlayerCameraPos(playerid1958.37831343.157215.3746);
    
SetPlayerCameraLookAt(playerid1958.37831343.157215.3746);
    return 
1;
}
public 
OnPlayerConnect(playerid)
{
    
ShowPlayerDialog(playeridiLoginDialogDIALOG_STYLE_PASSWORD"Login""Enter Your Password!""Login""Cancel");
    return 
1;
}
public 
OnPlayerCommandText(playeridcmdtext[])
{
    if (
strcmp("/help"cmdtexttrue5) == 0)
    {
        
SendClientMessage(playerid0xFFFFFF"You used /help command");
        return 
1;
    }
    if (
strcmp("/test"cmdtexttrue5) == 0)
    {
        
ShowPlayerDialog(playerid1DIALOG_STYLE_LIST"What is it that you want?""Sprunk ($1)\nBeer ($2)\nWine ($3)""Purchase""Cancel");
        return 
1;
    }
    return 
0;
}
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == iLoginDialog)
    {
        if(
response)
        {
            if(
strlen(inputtext) > 0)
            {
                if(
strcmp(inputtextpasswordtrue4) == 0)
                {
                    
logged 1;
                    return 
1;
                }
            }
        }
        
ShowPlayerDialog(playerid2DIALOG_STYLE_PASSWORD"Login""Enter Your Password!""Login""Cancel");
    }
    return 
1;

now how the hell can I show that spawn dialog AFTER HE SUCCESSFULLY logs in?


Re: Mod from TOTAL SCRATCH - Cjgogo - 27.07.2012

https://sampforum.blast.hk/showthread.php?tid=346633


Re: Mod from TOTAL SCRATCH - SEnergy - 27.07.2012

Quote:
Originally Posted by Cjgogo
Посмотреть сообщение
big and useless,
PHP код:
TogglePlayerSpectating(playeridtrue); 
does the trick