Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- forward OnPlayerRegister(playerid, password[]);
- public OnPlayerRegister(playerid)
- {
- if(IsPlayerConnected(playerid))
- {
- PlayerInfo[playerid][pCash] = GetPlayerCash(playerid);
- if ((PlayerInfo[playerid][pPos_x]==0.0 && PlayerInfo[playerid][pPos_y]==0.0 && PlayerInfo[playerid][pPos_z]==0.0))
- {
- PlayerInfo[playerid][pPos_x] = 2246.6;
- PlayerInfo[playerid][pPos_y] = -1161.9;
- PlayerInfo[playerid][pPos_z] = 1029.7;
- }
- if(Spectate[playerid] != -1)
- {
- PlayerInfo[playerid][pPos_x] = Unspec[playerid][sPx];
- PlayerInfo[playerid][pPos_y] = Unspec[playerid][sPy];
- PlayerInfo[playerid][pPos_z] = Unspec[playerid][sPz];
- PlayerInfo[playerid][pInt] = Unspec[playerid][sPint];
- PlayerInfo[playerid][pLocal] = Unspec[playerid][sLocal];
- }
- ShowPlayerDialog(playerid,DIALOG_LOGIN2,DIALOG_STYLE_PASSWORD,"SERVER: Login","Welcome to the RPG.CZM.RO Server.\n\nPlease enter your password below!","Login","Cancel");
- return 1;
- }
- return 1;
- }
- if(dialogid == DIALOG_LOGIN1)
- {
- if(response)
- {
- if(strlen(inputtext) > 3)
- {
- new Str[200], password[129];
- mysql_real_escape_string(MD5_Hash(inputtext), password);
- new password2[129];
- for(new i = 0; i < 129; i++)
- {
- password2[i] = tolower(password[i]);
- }
- new playername3[MAX_PLAYER_NAME];
- new y, m, d, h, mi, s;
- getdate(y,m,d);
- gettime(h,mi,s);
- GetPlayerName(playerid, playername3, sizeof(playername3));
- mysql_format(SQL,Str,sizeof(Str),"INSERT INTO `users` (`name`,`password`,`RegisterDate`) VALUES ('%s','%s','%d-%02d-%02d %02d:%02d:%02d')",playername3,password2, y, m, d, h, mi, s);
- mysql_tquery(SQL,Str,"","");
- OnPlayerRegister(playerid, inputtext);
- }
- else
- {
- ShowPlayerDialog(playerid,DIALOG_LOGIN1,DIALOG_STYLE_PASSWORD,"SERVER: Registration","Your password must exceed 4 characters!\n\nWelcome to the ForEver RPG Server.\n\nPlease enter your desired password below!","Register","Cancel");
- }
- }
- else return ShowPlayerDialog(playerid,DIALOG_LOGIN1,DIALOG_STYLE_PASSWORD,"SERVER: Registration","Welcome to the ForEver RPG Server.\n\nPlease enter your desired password below!","Register","Cancel");
- }
Add Comment
Please, Sign In to add comment