Command to save accounts
#3

So, this is my OnPlayerDisconnect.

PHP Code:
public OnPlayerDisconnect(playeridreason) {
    if(
usingcarwash == playerid)
    {
        
SetVehicleToRespawn(GetPlayerVehicleID(playerid));
        
usingcarwash = -1;
        
Update3DTextLabelText(entrancetext0x008B00FF"Autolavaggio libero, suona il clacson per lavare\nla tua auto, ($5)");
    }
    
Delete3DTextLabel(playerID[playerid]);
    
#if defined FOR_EACH
    
Itter_Remove(HSVictimplayerid);
    
#endif
    
for(new i=0;i<4;i++)
    {
    
RemovePlayerAttachedObject(playerid,i);
    }
    if(
RentedVehicle[playerid]!=0)
    {
    
vehicleVariables[RentedVehicle[playerid]][Rented]=0;
    
SetVehicleToRespawn(RentedVehicle[playerid]);
    
RentedVehicle[playerid]=0;
    }
    
DrugOnPlayerDisconnect(playeridreason);
    
KillTimer(timer[playerid]);
    
KillTimer(timer2[playerid]);
    
TextDrawDestroy(Fuel0[playerid]);
    
TextDrawDestroy(Speedom[playerid]);
    if(
PlayerAccount[playerid][Logged]) SavePlayerAccount(playerid);
    
FadePlayerDisconnect(playerid);
    
TextDrawDestroy(Speedo[playerid]);
    if (
BizRobPlayer==playerid)
    {
        
BizRobPlayer 255;
        
CanRob 0;
        
BizRobTime = -1;
        
SendClientMessageToAll(COLOR_LIGHTBLUE"Il rapinatore si и disconnesso, rapina fallita.");
    }
    for(new 
vehid=0;vehid<MAX_VEHICLES;vehid++)
        {
            
GetPlayerName(playeridpnamesizeof (pname));
            if(
strlen(pname)==strlen(vehicleVariables[vehid][vOwner]) && !strcmp(pname,vehicleVariables[vehid][vOwner],false,MAX_PLAYER_NAME) && vehicleVariables[vehid][vOwned])
            {
            
SavePlayerVehicle(vehid);
            
DestroyVehicle(vehicleVariables[vehid][vVehicleScriptID]);
            }
            }
     
SavePlayerAccount(playerid);
    return 
1;

Here my DB name:
PHP Code:
#define SQL_DB "fenice17_project" 
Here an image of my DB:


I need to save:
- Moneys
- Houses
- Levels & Experience
- Vehicles
- Businesses
- Objects like cigarettes, bandages, glasses exc...
Reply


Messages In This Thread
Command to save accounts - by fabriziobondi - 19.11.2011, 00:26
Re: Command to save accounts - by Cody_Maverak - 19.11.2011, 00:35
Re: Command to save accounts - by fabriziobondi - 19.11.2011, 01:48
Re: Command to save accounts - by MP2 - 19.11.2011, 01:56
Re: Command to save accounts - by fabriziobondi - 19.11.2011, 02:06
Re: Command to save accounts - by MP2 - 19.11.2011, 02:15
Re: Command to save accounts - by fabriziobondi - 19.11.2011, 02:26
Re: Command to save accounts - by dr.pepper - 19.11.2011, 02:27
Re: Command to save accounts - by fabriziobondi - 19.11.2011, 02:32
Re: Command to save accounts - by dr.pepper - 19.11.2011, 02:38

Forum Jump:


Users browsing this thread: 2 Guest(s)