Problem with database
#2

Quote:

public OnPlayerRegister(playerid, password[])
{
if(IsPlayerConnected(playerid))
{
new playername3[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername3, sizeof(playername3));
new Str[200];
mysql_format(SQL,Str,sizeof(Str),"INSERT INTO `users` (`name`,`password`) VALUES ('%s','%s')",playername3,password);
mysql_tquery(SQL,Str,"","");
strmid(PlayerInfo[playerid][pKey], password, 0, strlen(password), 255);
PlayerInfo[playerid][pCash] = GetPlayerCash(playerid);
GetPlayerHealthEx(playerid,PlayerInfo[playerid][pHealth]);
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];
}
new str[128];
mysql_format(SQL,str,128,"UPDATE users SET `pHealth`='%.1f' WHERE `name`='%s'",PlayerInfo[playerid][pHealth],PlayerInfo[playerid][pNormalName]);
mysql_tquery(SQL,str,"","");
ShowPlayerDialog(playerid,DIALOG_LOGIN2,DIALOG_STY LE_PASSWORD,"SERVER: Login","Welcome to the Urban-Play RPG Server.\n\nPlease enter your password below!","Login","Cancel");
return 1;
}
return 1;
}

Srry for double post
Reply


Messages In This Thread
Problem with database - by prototype0104 - 20.02.2017, 13:50
Re: Problem with database - by prototype0104 - 20.02.2017, 13:56
Re: Problem with database - by Yousha - 20.02.2017, 15:34
Re: Problem with database - by prototype0104 - 20.02.2017, 18:21

Forum Jump:


Users browsing this thread: 1 Guest(s)