25.09.2013, 16:39
Quote:
So there comes the first problem, when player leaves the server the stored values are set to all other players in the database, so when someone logs it will set him the same stats, that the last player who left the server had. Let me just note that it doesn't change the passwords, names and ID's. |
Код:
format(query, sizeof(query), "UPDATE players SET Health = %.1f, Armor = %0.f, Interior = %d, VW = %d, Skin = %d, X = %f, Y = %f, Z = %f, A = %f WHERE Name = '%s'", HP, AP, GetPlayerInterior(playerid), GetPlayerVirtualWorld(playerid), GetPlayerSkin(playerid), X, Y, Z, A, gName);
Код:
format(query, sizeof(query), "UPDATE players SET Health = %.1f, Armor = %0.f, Interior = %d, VW = %d, Skin = %d, X = %f, Y = %f, Z = %f, A = %f WHERE Name = '%s'", HP, AP, GetPlayerInterior(playerid), GetPlayerVirtualWorld(playerid), GetPlayerSkin(playerid), X, Y, Z, A, GetPName(playerid));
![Wink](images/smilies/wink.png)
Quote:
How to load the player co-ordinates on his first spawn (maybe using my variable FirstSpawn)? |
Код:
SetPlayerHealth(playerid, PInfo[playerid][pHealth]); SetPlayerArmour(playerid, PInfo[playerid][pArmor]); SetPlayerInterior(playerid, PInfo[playerid][pInterior]); SetPlayerVirtualWorld(playerid, PInfo[playerid][pVirtualWorld]); SetPlayerSkin(playerid, PInfo[playerid][pSkin]); SetPlayerPos(playerid, PInfo[playerid][pX], PInfo[playerid][pY], PInfo[playerid][pZ]); SetPlayerFacingAngle(playerid, PInfo[playerid][pA]);