09.04.2019, 18:34
Hello i have problem with GPCI. I added everything but now when i go in game, and after i register the spawn dialog won't appear.
PHP Code:
//Settings
native WP_Hash(buffer[], len, const str[]);
native gpci(playerid, serial[], len);
#define HOLDING(%0) ((newkeys & (%0)) == (%0))
#define RELEASED(%0) (((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0)))
PHP Code:
enum PlayerData
{
//MySQL
Logged,
Registered,
AutoLogin,
ID,
PlayerName[MAX_PLAYER_NAME],
Password[129],
IP[16],
Email[35],
Serial[64],
PHP Code:
mysql_tquery(mysql, "CREATE TABLE IF NOT EXISTS `playersdata` (\
`ID` int(11) NOT NULL AUTO_INCREMENT,\
`PlayerName` varchar(25) NOT NULL,\
`Password` varchar(129) NOT NULL,\
`IP` varchar(17) NOT NULL,\
`Email` varchar(35) NOT NULL,\
`Serial` varchar(64) NOT NULL,\
`Online` int(5) NOT NULL default 0,\
PHP Code:
stock PlayerSerial(playerid)
{
new serial[64];
gpci(playerid,serial, sizeof(serial));
return serial;
}
PHP Code:
case DIALOG_EMAIL: {
if(!response) return ShowPlayerDialog(playerid, DIALOG_EMAIL, DIALOG_STYLE_INPUT, "Email", "{FFFFFF}Please enter your email address below:", "Register", "");
else if(response) {
if(isnull(inputtext)) return ShowPlayerDialog(playerid, DIALOG_EMAIL, DIALOG_STYLE_INPUT, "Email", "{FFFFFF}Please enter your email address below:", "Register", "");
if(!IsValidEmail(inputtext)) return ShowPlayerDialog(playerid, DIALOG_EMAIL, DIALOG_STYLE_INPUT, "Email", "{FF0000}Invalid email address!\n\n{FFFFFF}Please enter your email address below:", "Register", "");
format(Info[playerid][Email], 35, inputtext);
new query[324], year, c_month, day;
getdate(year, c_month, day);
new month[15];
switch (c_month) {
case 1: month = "January";
case 2: month = "Feburary";
case 3: month = "March";
case 4: month = "April";
case 5: month = "May";
case 6: month = "June";
case 7: month = "July";
case 8: month = "August";
case 9: month = "September";
case 10: month = "October";
case 11: month = "November";
case 12: month = "December";
}
new register_on[25]; //Ex: 13 July, 2017
format(register_on, sizeof(register_on), "%02d %s, %d", day, month, year);
mysql_format(mysql, query, sizeof(query),"INSERT INTO `playersdata` (PlayerName, Password, IP, RegisteredOn, Email, Serial) VALUES ('%e', '%e', '%e', '%e', '%e','%e')", GetName(playerid), Info[playerid][Password], Info[playerid][IP], register_on, Info[playerid][Email], PlayerSerial(playerid));
mysql_tquery(mysql, query, "OnAccountRegister", "i", playerid);
}
}
PHP Code:
cache_get_value_name(0, "Serial", PlayerSerial(playerid), 64);