Posts: 85
Threads: 16
Joined: Dec 2014
Quote:
Originally Posted by nezo2001
Add in your enum
PHP код:
PosX,
PosY,
PosZ,
Health,
Armour,
Money,
//And the other add it according to your script i can guess :P
Under aduty command
PHP код:
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
PlayerInfo[playerid][PosX] = x;
PlayerInfo[playerid][PosY] = y;
PlayerInfo[playerid][PosZ] = z;
new Float:health;
GetPlayerHealth(playerid, health);
PlayerInfo[playerid][Health] = health;
new Float:armour;
GetPlayerArmour(playerid, armour);
PlayerInfo[playerid][Armour] = armour;
PlayerInfo[playerid][Money] = GetPlayerMoney(playerid);
Under ofduty command
PHP код:
SetPlayerPos(playerid, PlayerInfo[playerid][PosX],PlayerInfo[playerid][PosY],PlayerInfo[playerid][PosZ]);
SetPlayerHealth(playerid, PlayerInfo[playerid][Health]);
SetPlayerArmour(playerid, PlayerInfo[playerid][Armour]);
GivePlayerMoney(playerid, PlayerInfo[playerid][Money]);
|
What a nice!
Now, how can i convert this mysql saving system into y_ini saving system?
pawn Код:
stock AttemptPlayerLogin(playerid, passbuffer[]) {
new
szQuery[225],
szPlayerName[MAX_PLAYER_NAME],
szPlayerName2[MAX_PLAYER_NAME];
GetPlayerName(playerid, szPlayerName, sizeof(szPlayerName));
mysql_real_escape_string(szPlayerName, szPlayerName2, g_MySQLConnections[0]);
format(szQuery, sizeof(szQuery), "SELECT * FROM players WHERE Username = '%s' AND Password = '%s'", szPlayerName2, passbuffer);
mysql_query(szQuery, THREAD_LOGIN_ATTEMPT, playerid, g_MySQLConnections[0]);
return 1;
}