28.01.2013, 09:16
Hello SA-MP community,
I got this function I made to complete a registration, I made it a function because I use it on different parts of the script ( Depends which answers you give on the questions. ). Now the issue is that this code worked perfectly fine before and somehow while I didn't change anything it doesn't read more then "> Check 1"..
Here's the code:
I hope you can help me!
Best regards,
Jesse
I got this function I made to complete a registration, I made it a function because I use it on different parts of the script ( Depends which answers you give on the questions. ). Now the issue is that this code worked perfectly fine before and somehow while I didn't change anything it doesn't read more then "> Check 1"..
Here's the code:
pawn Код:
public RegisteredText(playerid)
{
SCM(playerid, KLEUR_WIT, "> Check 1");
print("> Check 1");
new string[512], string2[512], esc[512], Nm[MAX_PLAYER_NAME], esc2[512], esc3[512], esc4[512], esc5[512];
new esc6[512], TempPW[512], y, m, d, h, mi, s, time[128], esc7[512], date[128], esc8[512];
SCM(playerid, KLEUR_WIT, "> Check 2");
print("> Check 2");
getdate(y, m, d);
gettime(h, mi, s);
SCM(playerid, KLEUR_WIT, "> Check 3");
print("> Check 3");
format(time, sizeof(time), "%d-%02d-%04d %02d:%02d", d, m, y, SetGMTClock(h), mi);
format(date, sizeof(date), "%d-%02d-%04d", d, m, y);
SCM(playerid, KLEUR_WIT, "> Check 4");
print("> Check 4");
strmid(Pinfo[playerid][File], date, 0, strlen(date), 20);
strmid(Pinfo[playerid][LastLogin], time, 0, strlen(time), 64);
SCM(playerid, KLEUR_WIT, "> Check 5");
print("> Check 5");
TempPW = Hash(Pinfo[playerid][Password]);
mysql_real_escape_string(Pinfo[playerid][RegMail], esc);
SCM(playerid, KLEUR_WIT, "> Check 6");
print("> Check 6");
GetPlayerName(playerid, Nm, sizeof(Nm));
mysql_real_escape_string(Nm, esc2);
SCM(playerid, KLEUR_WIT, "> Check 7");
print("> Check 7");
mysql_real_escape_string(TempPW, esc3);
mysql_real_escape_string(Pinfo[playerid][Hobby], esc4);
SCM(playerid, KLEUR_WIT, "> Check 8");
print("> Check 8");
mysql_real_escape_string(Pinfo[playerid][Country], esc5);
mysql_real_escape_string(Pinfo[playerid][Sex], esc6);
SCM(playerid, KLEUR_WIT, "> Check 9");
print("> Check 9");
mysql_real_escape_string(time, esc7);
mysql_real_escape_string(date, esc8);
SCM(playerid, KLEUR_WIT, "> Check 10");
print("> Check 10");
SCM(playerid, KLEUR_SAMP, string2);
mysql_queryF("INSERT INTO `users`(Username, Password, Email, AboutMe, Country, Sex, Age, Skin, RegisterDate, LastLogin) VALUES('%s', '%s', '%s', '%s', '%s', '%s', '%d', '%d', '%s', '%s')", esc2, esc3, esc, esc4, esc5, esc6, Pinfo[playerid][Age], Pinfo[playerid][Skin], esc8, esc7);
SCM(playerid, KLEUR_WIT, "> Check 11");
print("> Check 11");
Pinfo[playerid][Registered] = 1;
if(Pinfo[playerid][WrongAnswers] == 1)
{
format(string2, sizeof(string2), "\
Congratulations %s, you have successfully registered!\n\
\n\
You had %d wrong answer out of 16 questions!\n\
You have set your character's aboutme to: '%s'.\n\
You have set your character's origin to: '%s'.\n",\
PlayerName(playerid), Pinfo[playerid][WrongAnswers], Pinfo[playerid][Hobby],\
Pinfo[playerid][Country]);
}
else
{
format(string2, sizeof(string2), "\
Congratulations %s, you have successfully registered!\n\
\n\
You had %d wrong answers out of 16 questions!\n\
You have set your character's aboutme to: '%s'.\n\
You have set your character's origin to: '%s'.\n",\
PlayerName(playerid), Pinfo[playerid][WrongAnswers], Pinfo[playerid][Hobby],\
Pinfo[playerid][Country]);
}
strcat(string, string2, sizeof(string));
format(string2, sizeof(string), "\
You have set your character's age to: '%d'.\n\
You have set your character's gender to: '%s'.\n\
You have informed us that your e-mail address is: '%s'.\n",\
Pinfo[playerid][Age], Pinfo[playerid][Sex], Pinfo[playerid][RegMail]);
strcat(string, string2, sizeof(string));
format(string2, sizeof(string2), "\n\
We want to welcome you to our community, we hope you will enjoy your stay.\n\
\n\
Best regards,\n\
The management");
strcat(string, string2, sizeof(string));
ShowPlayerDialog(playerid, REGD24, 0, "Registered!", string, "Play", "");
return 1;
}
Best regards,
Jesse