Making Admin Name (+REP and REWARDS WHO CAN HELP ME)
#9

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:xFloat:yFloat:z;
GetPlayerPos(playeridxyz);
PlayerInfo[playerid][PosX] = x;
PlayerInfo[playerid][PosY] = y;
PlayerInfo[playerid][PosZ] = z;
new 
Float:health;
GetPlayerHealth(playeridhealth);
PlayerInfo[playerid][Health] = health;
new 
Float:armour;
GetPlayerArmour(playeridarmour);
PlayerInfo[playerid][Armour] = armour;
PlayerInfo[playerid][Money] = GetPlayerMoney(playerid); 
Under ofduty command
PHP код:
SetPlayerPos(playeridPlayerInfo[playerid][PosX],PlayerInfo[playerid][PosY],PlayerInfo[playerid][PosZ]);
SetPlayerHealth(playeridPlayerInfo[playerid][Health]);
SetPlayerArmour(playeridPlayerInfo[playerid][Armour]);
GivePlayerMoney(playeridPlayerInfo[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;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)