27.07.2012, 08:02
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:
now how the hell can I show that spawn dialog AFTER HE SUCCESSFULLY logs in?
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(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
AddStaticVehicle(468, 1960, 1345, 15.4, 269, 252, 251);
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
public OnPlayerConnect(playerid)
{
ShowPlayerDialog(playerid, iLoginDialog, DIALOG_STYLE_PASSWORD, "Login", "Enter Your Password!", "Login", "Cancel");
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/help", cmdtext, true, 5) == 0)
{
SendClientMessage(playerid, 0xFFFFFF, "You used /help command");
return 1;
}
if (strcmp("/test", cmdtext, true, 5) == 0)
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "What is it that you want?", "Sprunk ($1)\nBeer ($2)\nWine ($3)", "Purchase", "Cancel");
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == iLoginDialog)
{
if(response)
{
if(strlen(inputtext) > 0)
{
if(strcmp(inputtext, password, true, 4) == 0)
{
logged = 1;
return 1;
}
}
}
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_PASSWORD, "Login", "Enter Your Password!", "Login", "Cancel");
}
return 1;
}