11.10.2016, 13:51
Hey guys, I have a small problem,
Before I made the registration process, it was working smoothly, but now I can't view the classes, only spawn.
I mean, it doesn't pop up GameText and all.
Last registration process: (two dialogs, one pass one email, after email registration is done)
Thanks in advice.
Before I made the registration process, it was working smoothly, but now I can't view the classes, only spawn.
I mean, it doesn't pop up GameText and all.
PHP код:
public OnPlayerRequestClass(playerid, classid)
{
if(GetPlayerTeam(playerid) != 0)
{
TeamPlayers[GetPlayerTeam(playerid)]--;
SetPlayerTeam(playerid, 0);
SetPlayerColor(playerid, 0x6F6F6FFF);
}
if(classid < 3)
{
SetPlayerPos(playerid, 213.648742, 1822.678466, 6.414062);
SetPlayerFacingAngle(playerid, 270.372558);
SetPlayerCameraLookAt(playerid, 213.648742, 1822.678466, 6.414062);
SetPlayerCameraPos(playerid, 213.648742 + (5 * floatsin(-270.372558, degrees)), 1822.678466 + (5 * floatcos(-270.372558, degrees)), 6.414062);
GameTextForPlayer(0, "~b~MILITARY", 1000, 4);
}
if(classid > 2 && classid < 6)
{
SetPlayerPos(playerid, -253.085479, 2594.713623, 70.695312);
SetPlayerFacingAngle(playerid, 269.577362);
SetPlayerCameraLookAt(playerid, -253.085479, 2594.713623, 70.695312);
SetPlayerCameraPos(playerid, -253.085479 + (5 * floatsin(-269.577362, degrees)), 2594.713623 + (5 * floatcos(-269.577362, degrees)), 70.695312);
GameTextForPlayer(0, "~r~REBELS", 1000, 4);
}
if(classid == 6)
{
SetPlayerPos(playerid, -225.158813, 1395.948364, 172.414062);
SetPlayerFacingAngle(playerid, 0.229850);
SetPlayerCameraLookAt(playerid, -225.158813, 1395.948364, 172.414062);
SetPlayerCameraPos(playerid, -225.158813 + (5 * floatsin(-0.229850, degrees)), 1395.948364 + (5 * floatcos(-0.229850, degrees)), 172.414062);
GameTextForPlayer(0, "~r~HITMEN AGENCY", 1000, 4);
}
if(classid == 7)
{
SetPlayerPos(playerid, 413.895690, 2535.129638, 19.148437);
SetPlayerFacingAngle(playerid, 179.603851);
SetPlayerCameraLookAt(playerid, 413.895690, 2535.129638, 19.148437);
SetPlayerCameraPos(playerid, 413.895690 + (5 * floatsin(-179.603851, degrees)), 2535.129638 + (5 * floatcos(-179.603851, degrees)), 19.148437);
GameTextForPlayer(0, "~b~ALPHA TEAM", 1000, 4);
}
return 1;
}
PHP код:
case DIALOG_EMAIL:
{
if(!response) return ShowPlayerDialog(playerid, DIALOG_EMAIL, DIALOG_STYLE_INPUT, "Registration", "Please type in your e-mail in order to recover your account in the future.", "Finish", "Cancel");
if(strfind(inputtext, "@") == -1 || strfind(inputtext, ".") == -1) return ShowPlayerDialog(playerid, DIALOG_EMAIL, DIALOG_STYLE_INPUT, "Registration", "Please enter a valid email address.", "Finish", "Cancel");
new query[1028], day, month, year, date[12], string[128];
getdate(year, month, day);
format(date, sizeof(date), "%02d/%02d/%d", day, month, year);
mysql_format(mysql, query, sizeof(query), "INSERT INTO `Users` (`Username`, `IP`, `Registration`, `Password`, `EMail`) VALUES ('%e', '%e', '%e', '%e', '%e')", RPN(playerid), RPIP(playerid),
date, PlayerInfo[playerid][pPassword], inputtext);
new Cache:result = mysql_query(mysql, query);
PlayerInfo[playerid][pUserID] = cache_insert_id();
cache_delete(result);
format(string, sizeof(string), "%s has registered to [Military VS Rebels]", RPN(playerid));
SendClientMessageToAll(COLOR_GREY, string);
format(string, sizeof(string), "Welcome to [Military VS Rebels], your UserID is: %d", PlayerInfo[playerid][pUserID]);
SendClientMessage(playerid, COLOR_RED, string);
PlayerInfo[playerid][pLoggedIn] = 1;
return 1;
}