if(dialogid == DIALOG_REGISTER) //REGISTRACIJA { if(!response) Kick(playerid); if(strlen(inputtext)>=5) { new query[300]; //WP_Hash(PlayerInfo[playerid][Password], 129, inputtext); //hashing inputtext mysql_format(sqlconnect, query, sizeof(query), "INSERT INTO `accounts` (`Name`, `Password`, `IP`, `Admin`, `VIP`, `Money`, `posX` ,`posY`, `posZ`) VALUES ('%e', '%s', '%s', 0, 0, 0, 1788.6445,-1601.3077,13.5469)", Name[playerid], inputtext, IP[playerid]); mysql_tquery(sqlconnect, query, "OnAccountRegister", "i", playerid); } else { //Slaptazodis per trumpas SendClientMessage(playerid,COLOR_RED,"Jusu Slaptazodis per trumpas "); ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Registracija","Iveskite slaptazodi:","Registruotis","Iseiti"); }
public OnPlayerSpawn(playerid) { SetPlayerFacingAngle(playerid, 169.2070 ); SetPlayerPos(playerid, PlayerInfo[playerid][posX], PlayerInfo[playerid][posZ], PlayerInfo[playerid][posZ]);
public OnPlayerDisconnect(playerid, reason) { new query[128], Float:pos[3]; GetPlayerPos(playerid, pos[0], pos[1], pos[2]); mysql_format(sqlconnect, query, sizeof(query), "UPDATE `accounts` SET `Admin`=%d, `Vip`=%d, `Money`=%d, `posX`=%f, `posY`=%f, `posZ`=%f WHERE `ID`=%d",\ PlayerInfo[playerid][Admin], PlayerInfo[playerid][Vip], PlayerInfo[playerid][Money], pos[0], pos[1], pos[2], PlayerInfo[playerid][ID]); mysql_tquery(sqlconnect, query, "", ""); return 1; }
So where do you actually assign a value to PlayerInfo[playerid][posX/Y/Z] after the registration is complete? Nowhere, it seems.
|
public OnAccountLoad(playerid) { PlayerInfo[playerid][Admin] = cache_get_field_content_int(0, "Admin"); PlayerInfo[playerid][Vip] = cache_get_field_content_int(0, "Vip"); PlayerInfo[playerid][Money] = cache_get_field_content_int(0, "Money"); PlayerInfo[playerid][posX] = cache_get_field_content_float(0, "posX"); PlayerInfo[playerid][posY] = cache_get_field_content_float(0, "posY"); PlayerInfo[playerid][posZ] = cache_get_field_content_float(0, "posZ"); GivePlayerMoney(playerid, PlayerInfo[playerid][Money]); SendClientMessage(playerid, -1, "Sekmingai prisijungete"); return 1; }
I see no reference to that function in any of the code you posted above. I only see "OnAccountRegister".
|
public OnAccountRegister(playerid) { SendClientMessage(playerid, -1, "Sekmingai uzsiregistravote"); PlayerInfo[playerid][ID] = cache_insert_id(); //loads the ID of the player in the variable once they registered. printf("Sekmingai uzsiregistravote. ID: %d", PlayerInfo[playerid][ID]); //just for debugging. return 1; }