Delete accounts
#1

I just finished a scripted server and put it on a host, all well and good until someone wants to enter the server. Account makes that account after you leave no longer exists. What can I still do not delete accounts? SRRY For my bad english . Please help me
Reply
#2

You need to post your onplayerdisconnect, and your register function.

We are not magicians. Use your brain before posting next time.
Reply
#3

Код:
//------------------------------------------------------------------------------------------------------
public OnPlayerDisconnect(playerid, reason)
{
    if(gPlayerInWar[playerid] == 1)
	{
	    gPlayerInWar[playerid] = 0;
	}
    if(playerid == CashboxOwner)
	{
	    new str[128], pName[MAX_PLAYER_NAME];
	    GetPlayerPos(playerid, CashboxX, CashboxY, CashboxZ);
	    GetPlayerName(playerid, pName, sizeof(pName));
	    format(str, 128, "%s (ID: %d) a iesit de pe server si a pierdut servieta !", pName, playerid);
	    SendClientMessageToAll(0xFFD700AA, str);
		CashboxPickup = CreatePickup(1210, 3, CashboxX, CashboxY, CashboxZ);
		CashboxOwner = INVALID_PLAYER_ID;
		if(mode == 1)
		{
	        for(new i; i<MAX_PLAYERS; i++)
			{
			    if(IsPlayerConnected(i))
			    {
			    	SetPlayerCheckpoint(i, CashboxX, CashboxY, CashboxZ, 1);
				}
			}
		}
	}
	gActivePlayers[playerid]--;
	numplayers--;
	PlayerInfo[playerid][pAdjustable] = 1;
	OnPlayerUpdateEx(playerid);
	RemoveRoadblock(playerid);
	TextDrawDestroy(Textdraw1[playerid]);
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
	    if(IsPlayerConnected(i))
	    {
	        if(TaxiAccepted[i] < 999)
	        {
		        if(TaxiAccepted[i] == playerid)
		        {
		            TaxiAccepted[i] = 999;
		            GameTextForPlayer(i, "~w~Taxi Caller~n~~r~Left the game", 5000, 1);
		            TaxiCallTime[i] = 0;
		            DisablePlayerCheckpoint(i);
		        }
	        }
	        else if(BusAccepted[i] < 999)
	        {
		        if(BusAccepted[i] == playerid)
		        {
		            BusAccepted[i] = 999;
		            GameTextForPlayer(i, "~w~Bus Caller~n~~r~Left the game", 5000, 1);
		            BusCallTime[i] = 0;
		            DisablePlayerCheckpoint(i);
		        }
	        }
	    }
    }
	if(WantedLevel[playerid] >= 1)
	{
 		new string[128];
		new wanted = WantedLevel[playerid];
		new sendername[MAX_PLAYER_NAME];
		GetPlayerName(playerid, sendername, sizeof(sendername));
		if(wanted > 0)
		{
			switch(reason)
			{
				case 0:
				{
			 		format(string,128, "%s has exit the game and he had %d wanted level. ( Crash )",sendername,wanted);
				}
				case 1:
				{
					format(string,128, "%s has exit the game and he had %d wanted level. ( Quit )",sendername,wanted);
				}
			}
			SendTeamMessage(2, 0x00ACB2AA, string);
		}
	}
	/*for(new i=0; i<MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
			if(PlayerTied[i] > 0)
			{
				for(new k=0; k<MAX_PLAYERS; k++)
				{
					if(IsPlayerConnected(k))
					{
					    new string[64];
					    new name[MAX_PLAYER_NAME];
					    GetPlayerName(i,name,MAX_PLAYER_NAME);
					    switch(reason)
					    {
					       case 0: format(string,sizeof string,"Player %s who was tied, has left the server. (Crash)",name);
					       case 1: format(string,sizeof string,"Player %s who was tied, has left the server. (Quit)",name);
					       case 2: format(string,sizeof string,"Player %s who was tied, has left the server. (Kicked/Banned)",name);
					    }
					    if(PlayerWhoTied[k] == 1)
					    {
					       SendClientMessage(k,0xBF0000FF,string);
					    }
					}
				}
			}
		}
	}*/
	if(GettingCK[playerid] < 999)
	{
	    if(IsPlayerConnected(GettingCK[playerid]))
	    {
	        SendClientMessage(GettingCK[playerid], COLOR_YELLOW, "Your Character Kill has left the server, try again later.");
	        OnCK[GettingCK[playerid]] = 999;
	    }
	}
	if(TransportCost[playerid] > 0 && TransportDriver[playerid] < 999)
	{
	    if(IsPlayerConnected(TransportDriver[playerid]))
		{
		    new string[64];
		    TransportMoney[TransportDriver[playerid]] += TransportCost[playerid];
		    TransportTime[TransportDriver[playerid]] = 0;
		    TransportCost[TransportDriver[playerid]] = 0;
		    format(string, sizeof(string), "~w~Passenger left~n~~g~Earned $%d",TransportCost[playerid]);
		    GameTextForPlayer(TransportDriver[playerid], string, 5000, 1);
		}
	}
	/*if(GotHit[playerid] > 0)
	{
	    if(GetChased[playerid] < 999)
	    {
	        if(IsPlayerConnected(GetChased[playerid]))
	        {
	        	SendClientMessage(GetChased[playerid], COLOR_YELLOW, "Your Hit has left the server.");
	            GoChase[GetChased[playerid]] = 999;
			}
	    }
	}*/
	if(PlayerPaintballing[playerid] != 0)
	{
	    PaintballPlayers --;
	}
	if(PlayerKarting[playerid] > 0 && PlayerInKart[playerid] > 0)
	{
	    KartingPlayers --;
	}
	if(PlayerRacing[playerid] > 0 && PlayerInRacing[playerid] > 0)
	{
	    RacingPlayers --;
	}
	if(PlayerRacing2[playerid] > 0 && PlayerInRacing2[playerid] > 0)
	{
	    Racing2Players --;
	}
	if(PlayersChannel[playerid] < 999)
	{
		IRCInfo[PlayersChannel[playerid]][iPlayers] -= 1;
	}
	if(HireCar[playerid] != 299)
	{
		gCarLock[HireCar[playerid]] = 0;
	}
	if (gLastCar[playerid] > 0)
	{
		gLastDriver[gLastCar[playerid]] = 300;
		if(PlayerInfo[playerid][pPhousekey] != gLastCar[playerid]-1)
		{
			gCarLock[gLastCar[playerid]] = 0;
		}
	}
	if(PlayerBoxing[playerid] > 0)
	{
	    if(Boxer1 == playerid)
	    {
	        if(IsPlayerConnected(Boxer2))
	        {
	        	PlayerBoxing[Boxer2] = 0;
	        	SetPlayerPos(Boxer2, 765.8433,3.2924,1000.7186);
	        	SetPlayerInterior(Boxer2, 5);
	        	GameTextForPlayer(Boxer2, "~r~Match interupted", 5000, 1);
			}
	    }
	    else if(Boxer2 == playerid)
	    {
	        if(IsPlayerConnected(Boxer1))
	        {
	        	PlayerBoxing[Boxer1] = 0;
	        	SetPlayerPos(Boxer1, 765.8433,3.2924,1000.7186);
	        	SetPlayerInterior(Boxer1, 5);
	        	GameTextForPlayer(Boxer1, "~r~Match interupted", 5000, 1);
			}
	    }
	    InRing = 0;
     	RoundStarted = 0;
		Boxer1 = 255;
		Boxer2 = 255;
		TBoxer = 255;
	}
    if(TransportDuty[playerid] == 1)
	{
		TaxiDrivers -= 1;
	}
    else if(TransportDuty[playerid] == 2)
	{
		BusDrivers -= 1;
	}
	if(PlayerInfo[playerid][pJob] == 11)
	{
	    if(JobDuty[playerid] == 1) { Medics -= 1; }
	}
	else if(PlayerInfo[playerid][pJob] == 7)
	{
	    if(JobDuty[playerid] == 1) { Mechanics -= 1; }
	}
}
Reply
#4

Wrong
Reply
#5

When the account is registered is should be created. And shouldn't be removed, basically your script is making "Temporary" accounts when a player registers. Go look in SAMP Wiki..that's where all the resource is to satisfy your problems.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)