Help Please :(
#1

Guys, I need help

Reply
#2

Search onplayerconnect, ban(playerid); and remove it.
Reply
#3

If that doesn't work, give us the code and we'll search it for errors.
Reply
#4

OnPlayerConnect Code

Код:
{
DLbox1[playerid] = CreatePlayerTextDraw(playerid, 645.000000, 344.000000, "-");
PlayerTextDrawBackgroundColor(playerid, DLbox1[playerid], 255);
PlayerTextDrawFont(playerid, DLbox1[playerid], 1);
PlayerTextDrawLetterSize(playerid, DLbox1[playerid], 0.500000, 11.200002);
PlayerTextDrawColor(playerid, DLbox1[playerid], -1);
PlayerTextDrawSetOutline(playerid, DLbox1[playerid], 0);
PlayerTextDrawSetProportional(playerid, DLbox1[playerid], 1);
PlayerTextDrawSetShadow(playerid, DLbox1[playerid], 1);
PlayerTextDrawUseBox(playerid, DLbox1[playerid], 1);
PlayerTextDrawBoxColor(playerid, DLbox1[playerid], 255);
PlayerTextDrawTextSize(playerid, DLbox1[playerid], -142.000000, 3.000000);
PlayerTextDrawSetSelectable(playerid, DLbox1[playerid], 0);

DLbox2[playerid] = CreatePlayerTextDraw(playerid, 645.000000, -3.000000, "-");
PlayerTextDrawBackgroundColor(playerid, DLbox2[playerid], 255);
PlayerTextDrawFont(playerid, DLbox2[playerid], 1);
PlayerTextDrawLetterSize(playerid, DLbox2[playerid], 0.500000, 11.000001);
PlayerTextDrawColor(playerid, DLbox2[playerid], -1);
PlayerTextDrawSetOutline(playerid, DLbox2[playerid], 0);
PlayerTextDrawSetProportional(playerid, DLbox2[playerid], 1);
PlayerTextDrawSetShadow(playerid, DLbox2[playerid], 1);
PlayerTextDrawUseBox(playerid, DLbox2[playerid], 1);
PlayerTextDrawBoxColor(playerid, DLbox2[playerid], 255);
PlayerTextDrawTextSize(playerid, DLbox2[playerid], -142.000000, 3.000000);
PlayerTextDrawSetSelectable(playerid, DLbox2[playerid], 0);

DLbox3[playerid] = CreatePlayerTextDraw(playerid, 641.000000, 104.000000, "-");
PlayerTextDrawBackgroundColor(playerid, DLbox3[playerid], 255);
PlayerTextDrawFont(playerid, DLbox3[playerid], 1);
PlayerTextDrawLetterSize(playerid, DLbox3[playerid], 0.500000, 25.600002);
PlayerTextDrawColor(playerid, DLbox3[playerid], -1);
PlayerTextDrawSetOutline(playerid, DLbox3[playerid], 0);
PlayerTextDrawSetProportional(playerid, DLbox3[playerid], 1);
PlayerTextDrawSetShadow(playerid, DLbox3[playerid], 1);
PlayerTextDrawUseBox(playerid, DLbox3[playerid], 1);
PlayerTextDrawBoxColor(playerid, DLbox3[playerid], 255);
PlayerTextDrawTextSize(playerid, DLbox3[playerid], 539.000000, 3.000000);
PlayerTextDrawSetSelectable(playerid, DLbox3[playerid], 0);

DLmodify[playerid] = CreatePlayerTextDraw(playerid, 590.000000, 107.000000, "Modify");
PlayerTextDrawAlignment(playerid, DLmodify[playerid], 2);
PlayerTextDrawBackgroundColor(playerid, DLmodify[playerid], 255);
PlayerTextDrawFont(playerid, DLmodify[playerid], 1);
PlayerTextDrawLetterSize(playerid, DLmodify[playerid], 0.479999, 1.600000);
PlayerTextDrawColor(playerid, DLmodify[playerid], 255);
PlayerTextDrawSetOutline(playerid, DLmodify[playerid], 0);
PlayerTextDrawSetProportional(playerid, DLmodify[playerid], 1);
PlayerTextDrawSetShadow(playerid, DLmodify[playerid], 1);
PlayerTextDrawUseBox(playerid, DLmodify[playerid], 1);
PlayerTextDrawBoxColor(playerid, DLmodify[playerid], -1);
PlayerTextDrawTextSize(playerid, DLmodify[playerid], 548.000000, 80.000000);
PlayerTextDrawSetSelectable(playerid, DLmodify[playerid], 0);

DLspeedtest[playerid] = CreatePlayerTextDraw(playerid, 590.000000, 130.000000, "SpeedTest");
PlayerTextDrawAlignment(playerid, DLspeedtest[playerid], 2);
PlayerTextDrawBackgroundColor(playerid, DLspeedtest[playerid], 255);
PlayerTextDrawFont(playerid, DLspeedtest[playerid], 1);
PlayerTextDrawLetterSize(playerid, DLspeedtest[playerid], 0.479999, 1.600000);
PlayerTextDrawColor(playerid, DLspeedtest[playerid], 255);
PlayerTextDrawSetOutline(playerid, DLspeedtest[playerid], 0);
PlayerTextDrawSetProportional(playerid, DLspeedtest[playerid], 1);
PlayerTextDrawSetShadow(playerid, DLspeedtest[playerid], 1);
PlayerTextDrawUseBox(playerid, DLspeedtest[playerid], 1);
PlayerTextDrawBoxColor(playerid, DLspeedtest[playerid], -1);
PlayerTextDrawTextSize(playerid, DLspeedtest[playerid], 548.000000, 80.000000);
PlayerTextDrawSetSelectable(playerid, DLspeedtest[playerid], 0);

DLcitytest[playerid] = CreatePlayerTextDraw(playerid, 590.000000, 154.000000, "CityTest");
PlayerTextDrawAlignment(playerid, DLcitytest[playerid], 2);
PlayerTextDrawBackgroundColor(playerid, DLcitytest[playerid], 255);
PlayerTextDrawFont(playerid, DLcitytest[playerid], 1);
PlayerTextDrawLetterSize(playerid, DLcitytest[playerid], 0.479999, 1.600000);
PlayerTextDrawColor(playerid, DLcitytest[playerid], 255);
PlayerTextDrawSetOutline(playerid, DLcitytest[playerid], 0);
PlayerTextDrawSetProportional(playerid, DLcitytest[playerid], 1);
PlayerTextDrawSetShadow(playerid, DLcitytest[playerid], 1);
PlayerTextDrawUseBox(playerid, DLcitytest[playerid], 1);
PlayerTextDrawBoxColor(playerid, DLcitytest[playerid], -1);
PlayerTextDrawTextSize(playerid, DLcitytest[playerid], 548.000000, 80.000000);
PlayerTextDrawSetSelectable(playerid, DLcitytest[playerid], 0);

DLpaint[playerid] = CreatePlayerTextDraw(playerid, 590.000000, 178.000000, "Paint");
PlayerTextDrawAlignment(playerid, DLpaint[playerid], 2);
PlayerTextDrawBackgroundColor(playerid, DLpaint[playerid], 255);
PlayerTextDrawFont(playerid, DLpaint[playerid], 1);
PlayerTextDrawLetterSize(playerid, DLpaint[playerid], 0.479999, 1.600000);
PlayerTextDrawColor(playerid, DLpaint[playerid], 255);
PlayerTextDrawSetOutline(playerid, DLpaint[playerid], 0);
PlayerTextDrawSetProportional(playerid, DLpaint[playerid], 1);
PlayerTextDrawSetShadow(playerid, DLpaint[playerid], 1);
PlayerTextDrawUseBox(playerid, DLpaint[playerid], 1);
PlayerTextDrawBoxColor(playerid, DLpaint[playerid], -1);
PlayerTextDrawTextSize(playerid, DLpaint[playerid], 548.000000, 80.000000);
PlayerTextDrawSetSelectable(playerid, DLpaint[playerid], 0);

DLbuy[playerid] = CreatePlayerTextDraw(playerid, 576.000000, 206.000000, "hud:skipicon");
PlayerTextDrawBackgroundColor(playerid, DLbuy[playerid], 0);
PlayerTextDrawFont(playerid, DLbuy[playerid], 4);
PlayerTextDrawLetterSize(playerid, DLbuy[playerid], 0.529999, 1.500000);
PlayerTextDrawColor(playerid, DLbuy[playerid], -1);
PlayerTextDrawSetOutline(playerid, DLbuy[playerid], 0);
PlayerTextDrawSetProportional(playerid, DLbuy[playerid], 1);
PlayerTextDrawSetShadow(playerid, DLbuy[playerid], 1);
PlayerTextDrawUseBox(playerid, DLbuy[playerid], 1);
PlayerTextDrawBoxColor(playerid, DLbuy[playerid], 255);
PlayerTextDrawTextSize(playerid, DLbuy[playerid], 30.000000, 30.000000);
PlayerTextDrawSetSelectable(playerid, DLbuy[playerid], 0);

DLexit[playerid] = CreatePlayerTextDraw(playerid, 552.000000, 274.000000, "EXIT");
PlayerTextDrawBackgroundColor(playerid, DLexit[playerid], 255);
PlayerTextDrawFont(playerid, DLexit[playerid], 1);
PlayerTextDrawLetterSize(playerid, DLexit[playerid], 1.130000, 7.400000);
PlayerTextDrawColor(playerid, DLexit[playerid], -1);
PlayerTextDrawSetOutline(playerid, DLexit[playerid], 0);
PlayerTextDrawSetProportional(playerid, DLexit[playerid], 1);
PlayerTextDrawSetShadow(playerid, DLexit[playerid], 1);
PlayerTextDrawSetSelectable(playerid, DLexit[playerid], 1);
PlayerTextDrawTextSize(playerid, DLexit[playerid], 1000.0000, 160.0000000);



	DrivingTest[playerid] = 0;
	SetObjectMaterial(LSFMDOBJ[20], 0, 2433, "cj_ff","white",0xFF6B6963);
    SetObjectMaterial(LSFMDOBJ[0], 0, 2433, "cj_ff","white",0xFF6B6963);
    SetObjectMaterial(LSFMDOBJ[1], 0, 2433, "cj_ff","white",0xFF6B6963);
    SetObjectMaterial(LSFMDOBJ[2], 0, 2433, "cj_ff","white",0xFF6B6963);
    SetObjectMaterial(LSFMDOBJ[3], 0, 2433, "cj_ff","white",0xFF6B6963);
    SetObjectMaterial(LSFMDOBJ[4], 0, 2433, "cj_ff","white",0xFF6B6963);
    SetObjectMaterial(LSFMDOBJ[5], 0, 2433, "cj_ff","white",0xFF6B6963);
    SetObjectMaterial(LSFMDOBJ[6], 0, 2433, "cj_ff","white",0xFF6B6963);
    SetObjectMaterial(LSFMDOBJ[7], 0, 2433, "cj_ff","white",0xFF6B6963);
    SetObjectMaterial(LSFMDOBJ[8], 0, 2433, "cj_ff","white",0xFF6B6963);
    SetObjectMaterial(LSFMDOBJ[9], 0, 2433, "cj_ff","white",0xFF6B6963);
    SetObjectMaterial(LSFMDOBJ[10], 0, 2433, "cj_ff","white",0xFF6B6963);
    SetObjectMaterial(LSFMDOBJ[11], 0, 2433, "cj_ff","white",0xFF6B6963);
    SetObjectMaterial(LSFMDOBJ[12], 0, 2433, "cj_ff","white",0xFF6B6963);
    SetObjectMaterial(LSFMDOBJ[13], 0, 2433, "cj_ff","white",0xFF6B6963);
    SetObjectMaterial(LSFMDOBJ[14], 0, 2433, "cj_ff","white",0xFF6B6963);
    SetObjectMaterial(LSFMDOBJ[15], 0, 2433, "cj_ff","white",0xFF6B6963);
    SetObjectMaterial(LSFMDOBJ[16], 0, 2433, "cj_ff","white",0xFF6B6963);
    SetObjectMaterial(LSFMDOBJ[17], 0, 2433, "cj_ff","white",0xFF6B6963);
    SetObjectMaterial(LSFMDOBJ[18], 0, 2433, "cj_ff","white",0xFF6B6963);
    SetObjectMaterial(LSFMDOBJ[19], 0, 2433, "cj_ff","white",0xFF6B6963);
	RemoveBuildingForPlayer(playerid, 5967, 1259.4375, -1246.8125, 17.1094, 0.25);
	RemoveBuildingForPlayer(playerid, 1388, 1238.3750, -1258.2813, 57.2031, 0.25);
	RemoveBuildingForPlayer(playerid, 1391, 1238.3750, -1258.2734, 44.6641, 0.25);
	RemoveBuildingForPlayer(playerid, 5857, 1259.4375, -1246.8125, 17.1094, 0.25);
	RemoveBuildingForPlayer(playerid, 1219, 1284.1797, -1239.6406, 12.9141, 0.25);
	Quizz[playerid] = 0;
    hunger[playerid] = CreatePlayerTextDraw(playerid, 496.000000, 112.000000, "Hunger: 100 %");
    PlayerTextDrawBackgroundColor(playerid, hunger[playerid], 255);
    PlayerTextDrawFont(playerid, hunger[playerid], 1);
    PlayerTextDrawLetterSize(playerid, hunger[playerid], 0.500000, 1.000000);
    PlayerTextDrawColor(playerid, hunger[playerid], -1);
    PlayerTextDrawSetOutline(playerid, hunger[playerid], 1);
    PlayerTextDrawSetProportional(playerid, hunger[playerid], 1);
    PlayerTextDrawSetSelectable(playerid, hunger[playerid], 0);

    thirst[playerid] = CreatePlayerTextDraw(playerid, 496.000000, 99.000000, "Thirst: 100 %");
    PlayerTextDrawBackgroundColor(playerid, thirst[playerid], 255);
    PlayerTextDrawFont(playerid, thirst[playerid], 1);
    PlayerTextDrawLetterSize(playerid, thirst[playerid], 0.500000, 1.000000);
    PlayerTextDrawColor(playerid, thirst[playerid], -1);
    PlayerTextDrawSetOutline(playerid, thirst[playerid], 1);
    PlayerTextDrawSetProportional(playerid, thirst[playerid], 1);
    PlayerTextDrawSetSelectable(playerid, thirst[playerid], 0);
    SetPlayerWalkingStyle(playerid, 3);
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
            if(aDuty[i] == 1)
            {
                    ShowPlayerNameTagForPlayer(i, playerid, false);
            }
            else
            {
                    ShowPlayerNameTagForPlayer(i, playerid, true);
            }
    }

	new string[128];
    format(string,sizeof(string), "http://translate.******.com/translate_tts?q=%s has connected to the server", RPN(playerid));
    RemoveBuildingForPlayer(playerid, 4222, 1575.9375, -1516.5781, 36.6797, 0.25);
    RemoveBuildingForPlayer(playerid, 4180, 1502.6094, -1467.1250, 24.0156, 0.25);
    RemoveBuildingForPlayer(playerid, 1294, 1507.9375, -1444.8984, 17.0234, 0.25);
    RemoveBuildingForPlayer(playerid, 1265, 1539.2344, -1481.0781, 8.9141, 0.25);
    RemoveBuildingForPlayer(playerid, 1265, 1536.5078, -1481.0938, 8.9531, 0.25);
    RemoveBuildingForPlayer(playerid, 1372, 1534.9297, -1480.9922, 8.6094, 0.25);
    RemoveBuildingForPlayer(playerid, 1265, 1537.2422, -1479.7422, 8.9453, 0.25);
    RemoveBuildingForPlayer(playerid, 1372, 1537.9297, -1480.6094, 8.6094, 0.25);
    RemoveBuildingForPlayer(playerid, 1294, 1548.2578, -1436.8672, 16.9063, 0.25);
    




    



    foreach(Player, i)
    {
        if(JoinMessages[i])
        {
        	PlayAudioStreamForPlayer(i, string);
        }
    }
	ResetPlayerWeapons(playerid);
	ResetDodWeapons(playerid);
   /* RemoveBuildingForPlayer(playerid, 1302, 0.0, 0.0, 0.0, 6000.0);
    RemoveBuildingForPlayer(playerid, 1209, 0.0, 0.0, 0.0, 6000.0);
    RemoveBuildingForPlayer(playerid, 955, 0.0, 0.0, 0.0, 6000.0);
    RemoveBuildingForPlayer(playerid, 956, 0.0, 0.0, 0.0, 6000.0);
    RemoveBuildingForPlayer(playerid, 1775, 0.0, 0.0, 0.0, 6000.0);
    RemoveBuildingForPlayer(playerid, 1776, 0.0, 0.0, 0.0, 6000.0);
    RemoveBuildingForPlayer(playerid, 1977, 0.0, 0.0, 0.0, 6000.0);*/
    if(IsPlayerNPC(playerid))
	{
	
/*	    new npcname[MAX_PLAYER_NAME];*/
		SetPlayerColor(playerid, COLOR_YELLOW);
/*        if(!strcmp(npcname, "dmv1", true)) //Checking if the NPC's name is MyFirstNPC
        {
        SetPlayerPos(playerid, 2594.6912,-3637.3733,-1.2980);
        SetPlayerSkin(playerid, 255);
        BusText = CreateDynamic3DTextLabel("[NPC] Driving Instructer", COLOR_YELLOW, 0, 0, -20, 25, playerid);
        Streamer_SetFloatData(STREAMER_TYPE_3D_TEXT_LABEL, BusText , E_STREAMER_ATTACH_OFFSET_Z, 0.25);
        }
        else if(!strcmp(npcname, "dmv2", true)) //Checking if the NPC's name is MyFirstNPC
        {
        SetPlayerPos(playerid, 2590.8354,-3641.6492,-0.3035);
        SetPlayerSkin(playerid, 255);
        BusText = CreateDynamic3DTextLabel("[NPC] Driving Instructer", COLOR_YELLOW, 0, 0, -20, 25, playerid);
        Streamer_SetFloatData(STREAMER_TYPE_3D_TEXT_LABEL, BusText , E_STREAMER_ATTACH_OFFSET_Z, 0.25);
        }*/
		return 1;
	}
    gHeaderTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
    gBackgroundTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
    gCurrentPageTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
    gNextButtonTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
    gPrevButtonTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;

    for(new x=0; x < SELECTION_ITEMS; x++) {
        gSelectionItems[playerid][x] = PlayerText:INVALID_TEXT_DRAW;
	}

	gItemAt[playerid] = 0;
	aDuty[playerid] = 0;
	mDuty[playerid] = 0;
	//loginscreen
    TextDrawShowForPlayer(playerid,WebTD);
    TextDrawShowForPlayer(playerid,MainMenuTxtdraw[0]);
    TextDrawShowForPlayer(playerid,MainMenuTxtdraw[1]);
    TextDrawShowForPlayer(playerid,MainMenuTxtdraw[2]);
    TextDrawShowForPlayer(playerid,MainMenuTxtdraw[4]);
	// MAX IPS
	new connecting_ip[32+1];
	GetPlayerIp(playerid,connecting_ip,32);
	new num_players_on_ip = GetNumberOfPlayersOnThisIP(connecting_ip);

	if(num_players_on_ip > MAX_CONNECTIONS_FROM_IP) {
		printf("MAXIPs: Connecting player(%d) exceeded %d IP connections from %s.", playerid, MAX_CONNECTIONS_FROM_IP, connecting_ip);
        SendClientMessage(playerid, COLOR_LIGHTRED, "If you think its unfair ban, then appeal on forums.");
        format(string, sizeof(string), "AdmCmd: %s has been banned by MOLE, reason: Bots Attack", RPN(playerid));
	    SendClientMessageToAll(COLOR_LIGHTRED, string);
	    // Banning
    	PlayerInfo[playerid][pBanned] = 1;
    	// Banreason
     	new file[32];
    	format(file, sizeof(file), "users/%s.ini", RPNU(playerid));
     	dini_Set(file, "BanReason", "Bots Attack");
    	dini_Set(file, "BannedBy", "MOLE");
        AddBan(playerid);
        SetTimerEx("kickbugfix", 500, false, "i", playerid);
	    return 1;
	}
	// DONE
	ClearChar(playerid);
	// NAME CHECK
	new playername[32], pfile[64];
	format(pfile, sizeof(pfile), "users/%s.ini", RPNU(playerid));
	if(!dini_Exists(pfile))
	{
	    GetPlayerName(playerid, playername, sizeof(playername));
	    // Has numbers
	    if(strfind(playername, "0", true) != -1 || strfind(playername, "1", true) != -1 || strfind(playername, "2", true) != -1 || strfind(playername, "3", true) != -1 || strfind(playername, "4", true) != -1 || strfind(playername, "5", true) != -1
		|| strfind(playername, "6", true) != -1 || strfind(playername, "7", true) != -1 || strfind(playername, "8", true) != -1 || strfind(playername, "9", true) != -1 || strfind(playername, "[", true) != -1 || strfind(playername, "]", true) != -1)
		{
			SendClientMessage(playerid, COLOR_LIGHTRED, "SERVER: {FFFFFF}This is a RP Server, please reconnect using Firstname_Lastname format.");
			SendClientMessage(playerid, COLOR_LIGHTRED, "SERVER: {FFFFFF}Also, please remove the numbers and/or tags in your name.");
			SetTimerEx("kickbugfix", 500, false, "i", playerid);
		}
	    // No Underscore
		if(strfind( playername, "_", true) == -1 || strfind( playername, "_", true) == -1)
		{
			SendClientMessage(playerid, COLOR_LIGHTRED, "SERVER: {FFFFFF}This is a RP Server, please reconnect using Firstname_Lastname format.");
			SetTimerEx("kickbugfix", 500, false, "i", playerid);
		}
	}
	// Done
    PlayerInfo[playerid][pLoggedIn] = 0;
    PlayerInfo[playerid][pSpawn] = 0;
    PlayerInfo[playerid][pTutorial] = 1;
    //C4 done
    Pspawned[playerid] = 0;

    SetPlayerColor(playerid, TRANSPARENT_GREY);
    new file[64];
	format(file, sizeof(file), "users/%s.ini", RPNU(playerid));
	// Checking for rangeban
	new range[4][4];
	split(RPIP(playerid), range, '.');
	format(string, sizeof(string), "%s.%s.*.*", range[0], range[1]);
	if(CheckBan(string) == 1 && !dini_Int(file, "Whitelisted"))
	{
	    SetPlayerName(playerid, "BannedPlayer");
	    SendClientMessage(playerid, COLOR_LIGHTRED, "SERVER: {FFFFFF}Your range is banned from this server. (Request getting whitelisted at www.ES-RP.com)");
		SetTimerEx("kickbugfix", 500, false, "i", playerid);
		return 1;
	}
	// Checking for IP ban
	if(CheckBan(RPIP(playerid)) == 1)
	{
	    SetPlayerName(playerid, "BannedPlayer");
	    SendClientMessage(playerid, COLOR_LIGHTRED, "SERVER: {FFFFFF}You are banned from this server. (Make a ban appeal at www.ES-RP.com)");
		SetTimerEx("kickbugfix", 500, false, "i", playerid);
		return 1;
	}
	// Checking for character ban
	if(dini_Int(file, "pBanned") == 1)
	{
	    SetPlayerName(playerid, "BannedPlayer");
	    SendClientMessage(playerid, COLOR_LIGHTRED, "SERVER: {FFFFFF}You are banned from this server. (Make a ban appeal at www.ES-RP.com)");
        AddBan(playerid);
        SetTimerEx("kickbugfix", 500, false, "i", playerid);
	    return 1;
	}
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerVirtualWorld(playerid, 0);
    if(IsPlayerNPC(playerid)) {SetPlayerVirtualWorld(playerid, 0); SpawnPlayer(playerid); return 1;}
    if(!PlayerInfo[playerid][pLoggedIn])
	{
	    TogglePlayerSpectating(playerid, true);
        InterpolateCameraPos(playerid, 2007.9889,-1477.0032,117.9582, 500.1391,-1864.9094,73.1234, 30000, CAMERA_MOVE);
        InterpolateCameraLookAt(playerid, 1897.1287,-1419.8665,19.9680, 528.9075,-1814.1616,10.9022, 30000, CAMERA_MOVE);
	    SetSpawnInfo(playerid, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0); // Without this you'll be kicked when you spawn. Set it to wherever you want.
        SetTimerEx("login_dialog", 100, 0, "i", playerid);
	    new file[64];
		format(file, sizeof(file), "users/%s.ini", RPNU(playerid));
	    // Player isn't banned
	    if(dini_Int(file, "AdminAccount") == 1)
		{
		    format(file, sizeof(file), "users/%s.ini",RPNU(playerid));
		    SetPlayerName(playerid, dini_Get(file, "OldName"));
		    format(file, sizeof(file), "users/%s.ini", RPNU(playerid));
		    SSSShowDialog(playerid, 2);
		}
		if(!dini_Exists(file))
		{
		    SSSShowDialog(playerid, 5401);
  		    print("DIALOG TEST. DIALOG 5401 REQUEST CLASS");
		    print("DIALOG TEST.");
		    print("DIALOG TEST.");
		    return 1;
		}
		else
		{
		    SSSShowDialog(playerid, 2);
		    print("DIALOG TEST. DIALOG 2 REQUEST CLASS");
		    print("DIALOG TEST.");
		    print("DIALOG TEST.");
		}
		return 1;
	}
	else
	{
	    TogglePlayerSpectating(playerid, true);
        InterpolateCameraPos(playerid, 2007.9889,-1477.0032,117.9582, 500.1391,-1864.9094,73.1234, 30000, CAMERA_MOVE);
        InterpolateCameraLookAt(playerid, 1897.1287,-1419.8665,19.9680, 528.9075,-1814.1616,10.9022, 30000, CAMERA_MOVE);
	    SetSpawnInfo(playerid, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0); // Without this you'll be kicked when you spawn. Set it to wherever you want.
        SetTimerEx("login_dialog", 100, 0, "i", playerid);
		SpawnPlayer(playerid);
	}
	return 1;
}
/*forward login_dialog(playerid);
public login_dialog(playerid)
{
    SetPlayerCameraPos(playerid, 1975.203002, 3779.311523, 100.243506);
	SetPlayerCameraLookAt(playerid, 1975.203002, 3779.311523, -0.243506);

    // Show dialogs etc. here

    ClearChat(playerid); // Custom macro to send some empty clientmessages
    return 1;
}z*/
public OnPlayerDisconnect(playerid, reason)
{
    PlayerTextDrawDestroy(playerid, hunger[playerid]);
    PlayerTextDrawDestroy(playerid, thirst[playerid]);
	// Bank Robbery
	if(BankRobber[playerid])
    {
	    new Rob = BankRobber[playerid]-1, string[128];
	    DisablePlayerCheckpoint(playerid);
		BankRobbersCount --;
		format(BankRobbers[Rob], MAX_PLAYER_NAME, "");
		DeliverMoney[playerid] = 0;
		//
		foreach(Player, i)
		{
		    if(BankRobber[i] || PlayerInfo[i][pFac] == 1)
		    {
				if(Rob == 0) TextDrawHideForPlayer(i, Textdraw1);
				else if(Rob == 1) TextDrawHideForPlayer(i, Textdraw2);
				else if(Rob == 2) TextDrawHideForPlayer(i, Textdraw3);
				else if(Rob == 3) TextDrawHideForPlayer(i, Textdraw4);
				else if(Rob == 4) TextDrawHideForPlayer(i, Textdraw5);
			}
		}
		format(string, sizeof(string), "** %s has disconnected and has failed the robbery. **", RPN(playerid));
		SendRobberyMessage(COLOR_LIGHTRED, string);
		SendCopMessage(COLOR_LIGHTRED, string);
		BankRobber[playerid] = 0;
		if(BankRobbersCount == 0)
		{
			TextDrawHideForAll(Textdraw0);
			TextDrawHideForAll(Textdraw1);
			TextDrawHideForAll(Textdraw2);
			TextDrawHideForAll(Textdraw3);
			TextDrawHideForAll(Textdraw4);
			TextDrawHideForAll(Textdraw5);
//			BankRobbery = 0;
			RobberyStarted = 0;
			format(string, sizeof(string), "** The bank robbery has ended, $%d were stolen and $%d were saved. **", TotalStolen*10000, (TotalRobbers*10000-(TotalStolen*10000)));
			SendClientMessageToAll(COLOR_YELLOW, string);
			TotalRobbers = 0;
			new copsonline;
			foreach(Player, i)
			{
			    if(IsACop(i)) copsonline++;
			}
			foreach(Player, i)
			{
			    if(IsACop(i))
			    {
					new Saved = (TotalRobbers*10000-(TotalStolen*10000));
					GiveDodMoney(i, Saved/copsonline);
					format(string, sizeof(string), "** You have received your cut from the saved money. ($%d)", Saved/copsonline);
					SendClientMessage(i, COLOR_LIME, string);
			    }
			}
		}
    }
    RemovePlayerAttachedObject(playerid, 0);
	// Boxing
	new string[128];
	if(Boxing[playerid])
	{
        // Getting other boxer's ID
		new playerb = -1;
        foreach(Player, i)
        {
            if(Boxing[i] && i != playerid) playerb = i;
        }
        if(playerb != -1)
        {
            format(string, sizeof(string), "Boxing Ring: The boxing match has ended, %s has won the match.", RPN(playerb));
    		SendGymMessage(COLOR_WHITE, string);
            // Putting them out of the ring
            SetPlayerPos(playerb, 760.9759,4.7187,1000.7084);
            SetPlayerFacingAngle(playerb, 268.9407);
            SetPlayerPos(playerid, 760.9759,6.1794,1000.7093);
            SetPlayerFacingAngle(playerid, 268.9407);
            // Giving the winner extra skill point
            new oldj = strval(RPJL(playerb, JOB_BOXER));
            PlayerInfo[playerb][pJobSkill][JOB_BOXER] ++;
			new newj = strval(RPJL(playerb, JOB_BOXER));
		    if(oldj < newj)
			{
			    format(string, sizeof(string), "** Your Boxer level is now %d, you can now cause %d more damage. **", newj, (newj*2)-2);
				SendClientMessage(playerb, COLOR_YELLOW, string);
			}
			//
			SendClientMessage(playerb, COLOR_LIME, " You have won the boxing match.");
			SendClientMessage(playerid, COLOR_LIGHTRED, " You have lost the boxing match.");
			// Giving Bids
			new winner = pBoxer[playerb];
			foreach(Player, i)
			{
			    if(BidBoxer[i] == winner)
			    {
			        new percent, profit;
			        percent = (BidAmount[i]/BoxerBid[winner]) * 100;
			        profit = (percent * BoxerBid[pBoxer[playerid]]) / 100;
			        GiveDodMoney(i, BidAmount[i] + profit);
			        format(string, sizeof(string), " You have won $%d from bidding in the match, the money you bid has been returned as well.", profit);
			        SendClientMessage(i, COLOR_LIME, string);
			    }
				BidAmount[i] = 0;
				BidBoxer[i] = 0;
			}
			for(new w = 0; w < 13; w++)
			{
			    GiveDodWeapon(playerb, PlayerInfo[playerb][pWeapon][w], PlayerInfo[playerb][pWeaponAmmo][w]);
			}
        }
        for(new w = 0; w < 13; w++)
		{
		    GiveDodWeapon(playerid, PlayerInfo[playerid][pWeapon][w], PlayerInfo[playerid][pWeaponAmmo][w]);
		}
        // Resetting Values
		BoxingMatch = 0;
		Boxer[1] = -1;
		pBoxer[playerb] = 0;
		Boxer[2] = -1;
		pBoxer[playerid] = 0;
		Boxing[playerb] = 0;
		Boxing[playerid] = 0;
		BoxerBid[1] = 0;
		BoxerBid[2] = 0;
	    if(BoxTime)
	    {
			TogglePlayerControllable(playerb, 1);
	    	KillTimer(BoxTimer);
	    }
    }
	// The rest
	if(IsPlayerLoggedIn(playerid)) {SaveChar(playerid);}
	switch(reason)
	{
	    case 0: format(string, sizeof(string), "* %s has left the server. (Timeout)", RPN(playerid));
	    case 1: format(string, sizeof(string), "* %s has left the server. (Leaving)", RPN(playerid));
	    case 2: format(string, sizeof(string), "* %s has left the server. (Kicked/Banned)", RPN(playerid));
	}
	SendNearbyMessage(playerid, 10, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
	foreach(Player, i)
	{
	    if(Specid[i] == playerid)
	    {
	        Spec[i] = 0;
			Specid[i] = -1;
	    	TogglePlayerSpectating(i, 0);
			SetPlayerVirtualWorld(i, PlayerInfo[playerid][pVW]);
			SetPlayerInterior(i, PlayerInfo[playerid][pInt]);
			SetPlayerPos(i, PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ]);
			SendClientMessage(i, COLOR_WHITE, " You have stopped spectating players.");
	    }
	}
	// Clearing AD
	for(new i=0; i<MAX_ADS; i++)
	{
		if(strfind(AD[i], RPN(playerid)) != -1)
   		{
   		    format(AD[i], 128, "");
   		}
   	}
	// End of Clearing AD
	ClearChar(playerid);
	if(Planted[playerid] == 1)
	{
	    DestroyObject(C4[playerid]);
	    Bomb[playerid] = 0;
	    Planted[playerid] = 0;
	}
	return 1;
}


public OnPlayerSpawn(playerid)
{
    TogglePlayerSpectating(playerid, false);
	// Anti F4 Bug - Logging/Registering
	if(!PlayerInfo[playerid][pLoggedIn] && !IsPlayerNPC(playerid))
	{
		if(IsPlayerNPC(playerid)) return 1;
        InterpolateCameraPos(playerid, 2007.9889,-1477.0032,117.9582, 500.1391,-1864.9094,73.1234, 30000, CAMERA_MOVE);
        InterpolateCameraLookAt(playerid, 1897.1287,-1419.8665,19.9680, 528.9075,-1814.1616,10.9022, 30000, CAMERA_MOVE);
	    SetSpawnInfo( playerid, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
	    new file[64];
		format(file, sizeof(file), "users/%s.ini", RPNU(playerid));
	    // Player isn't banned
	    if(dini_Int(file, "AdminAccount") == 1)
		{
		    format(file, sizeof(file), "users/%s.ini",RPNU(playerid));
		    SetPlayerName(playerid, dini_Get(file, "OldName"));
		    format(file, sizeof(file), "users/%s.ini", RPNU(playerid));
		    SSSShowDialog(playerid, 2);
		}
		if(!dini_Exists(file))
		{
		    SSSShowDialog(playerid, 5401);

		    return 1;
		}
		else
		{
			SSSShowDialog(playerid, 2);
		}
		return 1;
	}
	// Actual Spawning
    ResetPlayerWeapons(playerid);
	if(IsPlayerNPC(playerid)) //Checks if the player that just spawned is an NPC.
	{
	  new npcname[MAX_PLAYER_NAME];
	  GetPlayerName(playerid, npcname, sizeof(npcname)); //Getting the NPC's name.
/*	  if(!strcmp(npcname, "dmv1", true)) //Checking if the NPC's name is GOD
	  { //Putting the NPC into the vehicle we created for it.
        SetPlayerSkin(playerid, 255);
        SetPlayerPos(playerid, 2590.8354,-3641.6492,-0.3035);
	    return 1;
	  }
	  else if(!strcmp(npcname, "dmv2", true)) //Checking if the NPC's name is GOD
	  { //Putting the NPC into the vehicle we created for it.
        SetPlayerSkin(playerid, 255);
        SetPlayerPos(playerid, 2590.8354,-3641.6492,-0.3035);
	    return 1;
	  }*/
	  return 1;
	}
    if(PlayerInfo[playerid][pLoggedIn] && PlayerInfo[playerid][pSpawn])
    {
        FalseBan[playerid] = 0;
        SetTimerEx("FalseBanFix", 6000, false, "i", playerid);
     	SpawnChar(playerid);
    }
    if (!GetPVarInt(playerid, "color")) SetPVarInt(playerid, "color", 18643);
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	if(IsPlayerLoggedIn(playerid))
	{
        PlayerTextDrawHide(playerid, hunger[playerid]);
        PlayerTextDrawHide(playerid, thirst[playerid]);
	    if(Planted[playerid] == 1)
		{
		    DestroyObject(C4[playerid]);
		    Bomb[playerid] = 0;
		    Planted[playerid] = 0;
		}
		Pspawned[playerid] = 0;
	    new string[128];
	    if(BankRobber[playerid])
	    {
    	    new Rob = BankRobber[playerid]-1;
		    DisablePlayerCheckpoint(playerid);
			BankRobbersCount --;
			format(BankRobbers[Rob], MAX_PLAYER_NAME, "");
			DeliverMoney[playerid] = 0;
			//
			foreach(Player, i)
			{
			    if(BankRobber[i] || PlayerInfo[i][pFac] == 1)
			    {
					if(Rob == 0) TextDrawHideForPlayer(i, Textdraw1);
					else if(Rob == 1) TextDrawHideForPlayer(i, Textdraw2);
					else if(Rob == 2) TextDrawHideForPlayer(i, Textdraw3);
					else if(Rob == 3) TextDrawHideForPlayer(i, Textdraw4);
					else if(Rob == 4) TextDrawHideForPlayer(i, Textdraw5);
				}
			}
			format(string, sizeof(string), "** %s has been hospitalized and has failed the robbery. **", RPN(playerid));
			SendRobberyMessage(COLOR_LIGHTRED, string);
			SendCopMessage(COLOR_LIGHTRED, string);
			BankRobber[playerid] = 0;
			if(BankRobbersCount == 0)
			{
				TextDrawHideForAll(Textdraw0);
				TextDrawHideForAll(Textdraw1);
				TextDrawHideForAll(Textdraw2);
				TextDrawHideForAll(Textdraw3);
				TextDrawHideForAll(Textdraw4);
				TextDrawHideForAll(Textdraw5);
//				BankRobbery = 0;
				RobberyStarted = 0;
				format(string, sizeof(string), "** The bank robbery has ended, $%d were stolen and $%d were saved. **", TotalStolen*10000, (TotalRobbers*10000-(TotalStolen*10000)));
				SendClientMessageToAll(COLOR_YELLOW, string);
				TotalRobbers = 0;
				new copsonline;
				foreach(Player, i)
				{
				    if(IsACop(i)) copsonline++;
				}
				foreach(Player, i)
				{
				    if(IsACop(i))
				    {
						new Saved = (TotalRobbers*10000-(TotalStolen*10000));
						GiveDodMoney(i, Saved/copsonline);
						format(string, sizeof(string), "** You have received your cut from the saved money. ($%d)", Saved/copsonline);
						SendClientMessage(i, COLOR_LIME, string);
				    }
				}
			}
	    }
	    if(!IsAFK[playerid])
	    {
	        if(Event[playerid])
	        {
	        	format(string, sizeof(string), "OnEventDeath: %s has killed %s using %s.", RPN(killerid), RPN(playerid), RWN(reason));
				foreach(Player, i)
				{
				    if(Event[i]) SendClientMessage(i, COLOR_REPORT, string);
				}
				Event[playerid] = 0;
				eventdeath[playerid] = 1;
	        }
	        if(Duel[playerid])
	        {
				Duel[playerid] = 0;
				Duel[killerid] = 0;
				DuelOn = 0;
				dueldeath[playerid] = 1;
				dueldeath[killerid] = 0;
				SetPlayerPos(killerid, eX, eY, eZ);
				SetPlayerInterior(killerid, PlayerInfo[killerid][pInt]);
				SetPlayerVirtualWorld(killerid, PlayerInfo[killerid][pVW]);
				PlayerInfo[killerid][pHospital] = 0;
				SetPlayerHealth(killerid, eHP);
				SetPlayerArmour(killerid, eARMOR);
				SendClientMessage(killerid, COLOR_LIGHTRED, "*** You won the duel, nice job. ***");
				GunsBeingRemoved[killerid] = 1;
				ResetPlayerWeapons(killerid);
				GunsBeingRemoved[killerid] = 1;
				for(new w = 0; w < 13; w++)
				{
				   GiveDodWeapon(killerid, PlayerInfo[killerid][pWeapon][w], PlayerInfo[killerid][pWeaponAmmo][w]);
				}
	        }
			else
			{
			    PlayerInfo[playerid][pHospital] = 1;
				PlayerInfo[playerid][pArmor] = 0;
			    if(IsPlayerLoggedIn(killerid))
			    {
					format(string, sizeof(string), "OnPlayerDeath: %s has killed %s using %s.", RPN(killerid), RPN(playerid), RWN(reason));
					SendAdminMessage(COLOR_DARKRED, 1, string);
					Log("logs/kill.log", string);
					PlayerInfo[playerid][pDeath] ++;
					PlayerInfo[killerid][pKill] ++;
					if(Hitman[killerid] == playerid)
					{
					    format(string, sizeof(string), " You have been critically injured by a hitman and lost $%d, the contrat on your head was cleared.", PlayerInfo[playerid][pContract]/2);
					    SendClientMessage(playerid, COLOR_YELLOW, string);
					    format(string, sizeof(string), "HitmanWarn: %s has fulfilled the contract on %s's head and collected $%d.", RPN(killerid), RPN(playerid), PlayerInfo[playerid][pContract]/2);
						SendHitmanMessage(COLOR_YELLOW, string);
						GiveDodMoney(playerid, -PlayerInfo[playerid][pContract]/2);
						GiveDodMoney(killerid, PlayerInfo[playerid][pContract]/2);
						PlayerInfo[playerid][pContract] = 0;
						format(PlayerInfo[playerid][pContract], 32, "");
						Hitman[killerid] = -1;
						PlayerInfo[killerid][pCSuccess] ++;
					}
					if(Hitman[playerid] == killerid)
					{
					    format(string, sizeof(string), " You have critically injured a hitman and collected $%d, the contrat on your head was cleared.", PlayerInfo[killerid][pContract]);
					    SendClientMessage(killerid, COLOR_YELLOW, string);
					    format(string, sizeof(string), "HitmanWarn: %s has failed the contract on %s's head and lost $%d.", RPN(playerid), RPN(killerid), PlayerInfo[killerid][pContract]);
						SendHitmanMessage(COLOR_YELLOW, string);
						GiveDodMoney(playerid, -PlayerInfo[killerid][pContract]);
						GiveDodMoney(killerid, PlayerInfo[killerid][pContract]);
						PlayerInfo[killerid][pContract] = 0;
						format(PlayerInfo[killerid][pContract], 32, "");
						Hitman[playerid] = -1;
						PlayerInfo[playerid][pCFail] ++;
					}
				}
			}
		}
		else
		{
		    GetPlayerPos(playerid, PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ]);
		   	ClearDodWantedLevels(killerid);
		    SetPlayerColor(killerid, TRANSPARENT_ORANGE);
			PlayerInfo[killerid][pPrison] = 2;
			PlayerInfo[killerid][pPrisonTime] = AFK[playerid];
			format(PlayerInfo[killerid][pPrisonReason], 64, "Killing AFK Players");
			format(PlayerInfo[killerid][pPrisonBy], 32, "AutoPrison");
			SetPlayerInterior(killerid, 2);
			SetPlayerVirtualWorld(killerid, 1);
			new RandomCell = random(sizeof(RandomPrison));
			SetPlayerFacingAngle(killerid, RandomPrison[RandomCell][3]);
			TogglePlayerControllable(killerid, 0);
			SetTimerEx("EnterExitTimer", 5000, false, "i", killerid);
			SetPlayerPos(killerid, RandomPrison[RandomCell][0], RandomPrison[RandomCell][1], RandomPrison[RandomCell][2]);
			SetCameraBehindPlayer(killerid);
			format(string, sizeof(string), "AdmCmd: %s has been auto-prisoned by MOLE, reason: Killing AFK Players [%d Minutes]", RPN(killerid), AFK[playerid]/60);
			SendClientMessageToAll(COLOR_LIGHTRED, string);
			Log("logs/prison.log", string);
			format(string, sizeof(string), " You have been auto-prisoned for %d minutes (%d seconds)", PlayerInfo[killerid][pPrisonTime]/60, PlayerInfo[killerid][pPrisonTime]);
			SendClientMessage(killerid, COLOR_LIGHTBLUE, string);
		}
	}
	return 1;
}
Reply
#5

Hmm, show the server logs
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)