13.07.2010, 05:13
(
Последний раз редактировалось Kar; 13.07.2010 в 05:22.
Причина: hmm topic change
)
scroll down<.<
//This is in your /exit command
IsPlayerInPointOfRange(playerid, coordinates) //something like that
if(strcmp(cmdtext, "/exit", true) == 0)
{
if(IsPlayerInPointOfRange(playerid, (coordinates here));
{
SetPlayerPos(playerid, (coordinates));
//message if you want
}
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)
{
if(dialogid == 1 || dialogid == 12347)
{
if(strlen(inputtext))
{
new ppw[20], str[128];
format(pfile, sizeof(pfile), pfile_path, Playername(playerid));
if(IsLogged[playerid] == 1) return 0;
else if(!dini_Exists(pfile)) return SendMsg(playerid, RED, "*Error: No account with that username is registered, please register");
else
{
format(pfile, sizeof(pfile), pfile_path, Playername(playerid));
new playerpw[256];
playerpw = dini_Get(pfile, "Password");
if(strcmp(playerpw, ppw, true) == 0)
{
format(str, sizeof(str), "*Success: You have Successfully Logged In %s", Playername(playerid), dini_Int(pfile, "AdminLevel"));
SendMsg(playerid, LIME, str);
LoadPlayer(playerid);
IsLogged[playerid] = 1;
SetTimerEx("TimePlayerLogged", 1000, true, "i", playerid);
}
else
{
SendMsg(playerid, RED, "*Error: Wrong Password. Password Did Not Match With The One You Have Register With.");
}
}
}
else
{
new loginstring[128];
new loginname[64];
GetPlayerName(playerid,loginname,sizeof(loginname));
format(loginstring,sizeof(loginstring),"ERROR: Incorrect password!\n \nPlease enter the correct password:",loginname);
ShowPlayerDialog(playerid,12347,DIALOG_STYLE_INPUT,"Login",loginstring,"Login","Cancel");
gPlayerLogTries[playerid] += 1;
if(gPlayerLogTries[playerid] == 3) { Kick(playerid); }
}
}
if(dialogid == 2 || dialogid == 12345)
{
if(strlen(inputtext))
{
new ppw[20], str[128];
format(pfile, sizeof(pfile), pfile_path, Playername(playerid));
if(dini_Exists(pfile)) return SendMsg(playerid, RED, "*Error: This Username Is Already Registered In Our Database Please Login! Or Create A Different Account");
else
{
format(pfile, sizeof(pfile), pfile_path, Playername(playerid));
dini_Create(pfile);
dini_Set(pfile, "Password", ppw);
dini_IntSet(pfile, "Score", 0);
dini_IntSet(pfile, "Money", 0);
dini_IntSet(pfile, "AdminLevel", 0);
dini_IntSet(pfile, "Hourslogged", 0);
dini_IntSet(pfile, "MinutesLogged", 0);
dini_IntSet(pfile, "SecondsLogged", 0);
dini_IntSet(pfile, "WantedLevel", 0);
format(str, sizeof(str), "*Success: You Has Successfully Registered %s And With The Password Of %s", Playername(playerid), ppw);
SendMsg(playerid, GREEN, str);
}
}
else
{
new regstring[128];
new regname[64];
GetPlayerName(playerid,regname,sizeof(regname));
format(regstring,sizeof(regstring),"Welcome, %s\nYou dont have an account.\nPlease register:",regname);
ShowPlayerDialog(playerid,12345,DIALOG_STYLE_INPUT,"Register",regstring,"Register","Cancel");
}
}
}
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
gPlayerClass[playerid] = classid;
SetPlayerTeamFromClass(playerid, classid);
SetPlayerColor(playerid,0xAFAFAFAA);
SetPlayerPos(playerid, 2089.360107, 1683.240722, 10.820312);
SetPlayerFacingAngle(playerid, 90.595680);
SetPlayerCameraLookAt(playerid, 2089.360107, 1683.240722, 10.820312);
SetPlayerCameraPos(playerid, 2089.360107 + (5 * floatsin(-90.595680, degrees)), 1683.240722 + (5 * floatcos(-90.595680, degrees)), 10.820312);
PlayerPlaySound(playerid, 1097,-119.9460,23.1096,12.2238); //music, duh
// LOGIN AND REGISTER
new string[128];
format(pfile, sizeof(pfile), pfile_path, Playername(playerid));
if(dini_Exists(pfile))
{
format(string,sizeof(string),"Welcome Back %s to New York City Life Cops And Robbers. \n \nYour name is registered.\nPlease enter your password below:",Playername(playerid));
ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Login",string,"Login","Cancel");
}
else
{
format(string,sizeof(string),"Welcome to New York City Life Cops And Robbers. \n \nYour name is Not registered.\nPlease enter your password & Register A New Account below:",Playername(playerid));
ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Login",string,"Register","Cancel");
}
return 1;
}
PlayerPlaySound(playerid, 1097,-119.9460,23.1096,12.223; //music, duh |