if(dialogid == 1111) // Terms and Roles
{
if(response) //BUTTON 1
{
if(gPlayerAccount[playerid] == 1)
{
DisplayDialogForPlayer(playerid, 1);
SendClientMessage(playerid, COLOR_YELLOW, "{248B10}Database: {FFFFFF}This player-file is loading, please login.");
}
else
{
DisplayDialogForPlayer(playerid, 2);
SendClientMessage(playerid, COLOR_YELLOW, "{248B10}Database: {FFFFFF}We do not have an account by this name to be loaded, please register to proceed to our Tutorial.");
}
}
else
{
SendClientMessage(playerid, 0xFF0000FF, "You rejected our Terms and Roles and have been kicked as a result.");
Kick(playerid);
}
}
if(dialogid == 2) //REGISTER
{
if(gPlayerLogged[playerid] == 1)
{
SendClientMessage(playerid, COLOR_WHITE, "SERVER: You are already logged in.");
return 1;
}
if(response)
{
if(strlen(inputtext) >= 50)
{
DisplayDialogForPlayer(playerid, 2); //register
SendClientMessage(playerid, COLOR_WHITE, "SERVER: Password is too long.");
return 0;
}
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
new namestring = strfind(sendername, " ", true);
if(namestring == -1)
{
SendClientMessage(playerid, COLOR_YELLOW, "Your name must be in the Firstname_Lastname format.");
Kick(playerid);
return 1;
}
else
{
if(!strlen(inputtext))
{
DisplayDialogForPlayer(playerid, 2); //register
SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must enter a password.");
return 1;
}
new string[MAX_STRING];
format(string, sizeof(string), SAVE_USERS, sendername);
if(dini_Exists(string))
{
SendClientMessage(playerid, COLOR_YELLOW, "That name is already taken, please choose a different one.");
return 1;
}
new tmppass[64];
strmid(tmppass, inputtext, 0, strlen(inputtext), 255);
Encrypt(tmppass);
OnPlayerRegister(playerid,tmppass);
OnPlayerLogin(playerid,tmppass);
gPlayerAccount[playerid] = 1;
gPlayerSpawned[playerid] = 1;
new stringno2[256];
for (new i = 0; i < sizeof(CounterInfo); i++)
{
CounterInfo[i][Registers] = CounterInfo[i][Registers]+1;
format(stringno2,sizeof(stringno2),"{248B10}Database: {FFFFFF}This account has been registered and saved to our database player-files.");
SendClientMessage(playerid, COLOR_YELLOW, stringno2);
}
OnCounterUpdate();
}
}
else
{
DisplayDialogForPlayer(playerid, 2); //register
}
}
if(dialogid == 1) //LOGIN
{
if(gPlayerLogged[playerid] == 1)
{
SendClientMessage(playerid, COLOR_WHITE, "SERVER: You are already logged in.");
return 1;
}
if(response)
{
if(!strlen(inputtext))
{
DisplayDialogForPlayer(playerid, 1); //login
SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must enter a password.");
return 1;
}
if(strlen(inputtext) >= 50)
{
DisplayDialogForPlayer(playerid, 1); //login
SendClientMessage(playerid, COLOR_WHITE, "SERVER: Password is too long.");
return 0;
}
new tmppass[64];
//Store Player ID & TMP pass in echo to find string used to crash server
new playername[MAX_PLAYER_NAME];
strmid(tmppass, inputtext, 0, strlen(inputtext), 255);
GetPlayerName(playerid, playername, sizeof(playername));
Encrypt(tmppass);
OnPlayerLogin(playerid,tmppass);
}
else
{
DisplayDialogForPlayer(playerid, 1); //login
}
}
if(dialogid == 1111) // Terms and Roles
{
if(response) //BUTTON 1
{
if(gPlayerAccount[playerid] == 1)
{
DisplayDialogForPlayer(playerid, 1);
SendClientMessage(playerid, COLOR_YELLOW, "{248B10}Database: {FFFFFF}This player-file is loading, please login.");
}
else
{
DisplayDialogForPlayer(playerid, 2);
SendClientMessage(playerid, COLOR_YELLOW, "{248B10}Database: {FFFFFF}We do not have an account by this name to be loaded, please register to proceed to our Tutorial.");
}
}
else
{
SendClientMessage(playerid, 0xFF0000FF, "You rejected our Terms and Roles and have been kicked as a result.");
Kick(playerid);
}
}
try to indent it correctly
pawn Код:
if you hit the second button the youll be kicked just indenting your code will make it more clear to you. |
This is what happens when you try to edit the SA-RP script.
![]() If this mode is on 0.3e, and if you'd have ******d "kicked on spawn samp". You would've discovered that there was a bug in 0.3d that kicked players on spawn without SetSpawnInfo being called. Use it. |
Read my post, somewhere in your script, you are calling SpawnPlayer before SetSpawnInfo.
Either that, or one of the variables is allowing the code that kicks you to run. Use SetSpawnInfo before calling SpawnPlayer. |