Pls Help i have problem with gate
#1

I have 1 problem when i open gate please help me i m beginner.

Images:
1. Normal gate: http://www.dodaj.rs/f/3a/pt/CRdseKj/sa-mp-019.png
2. When i open: http://www.dodaj.rs/f/8/Pa/1YaPNUUO/sa-mp-020.png
3. When gate close: http://www.dodaj.rs/f/J/10s/35rDHyxL/sa-mp-021.png
4. When i open gate again: http://www.dodaj.rs/f/1t/4w/4HBM1zC7/sa-mp-022.png

Please guys help me this problem i have 5-6 months and i cant fix that i was looking for answer but i cant find...

Sry for bad english :P


My code:

Код:
if(PlayerInfo[playerid][pPhousekey] == 666 || PlayerInfo[playerid][pAdminDuty] == 1 && PlayerInfo[playerid][pAdmin] >= 1338)
		{
			if(IsPlayerInRangeOfPoint(playerid, 50,263.6729,-1333.6975,53.2331))
			{
				MoveDynamicObject(kapijag, 260.5000000,-1335.1992200,45.1000000, 3.0); //otvorena kapija
				SetTimer("zatvorig", 7000, 0);
				GetPlayerName(playerid, sendername, sizeof(sendername));
				format(string, sizeof(string), "* %s uzima svoj daljinski i otvara kapiju.", sendername);
				ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
			}
		}
My public:

Код:
public zatvorig()
{
	MoveDynamicObject(kapijag, 260.5000000,-1335.1992200,52.1000000, 3.0); //zatvorena kapija
	return 1
}
Reply
#2

You have forget to use the rx ry and rz koords
Reply
#3

This 'bug' is quite old. Be sure to update everything to 0.3x, the streamer is the most important here. I remember when sa-mp got updated to 0.3e, if I remember right. If your server is already 0.3x, update your streamer.

EDIT: Or try what IPrototypeI said first.
Reply
#4

When i update streamer i have one error:
C:\Icons\Samp Fajlovi\UGRP V2.0\gamemodes\UGRPG.pwn(6748) : warning 209: function "Streamer_OnPlayerDisconnect" should return a value
Line 6748:
I have only }
Image: http://www.dodaj.rs/f/2C/dq/1kOV11MK/untitled.jpg
Reply
#5

Please help me I fixed gates but I have one error only thank you.
Reply
#6

This warning comes from the Hook in the streamer.inc because you don`t return a value in OnPlayerDisconnect(playerid, reason).

Post use your gate object
Reply
#7

I don't understand can you explain me here is code where to put return?

Код:
public OnPlayerDisconnect(playerid, reason)
{
	new textreason[64];
	new plname[24];
	GetPlayerName(playerid, plname, sizeof(plname));
	new playersip[24];
	GetPlayerIp(playerid, playersip, sizeof(playersip));
	new string2[128];
	SafeResetPlayerWeapons(playerid);
	if(PlayerInfo[playerid][pAdminDuty] == 1)
	{
		SafeResetPlayerWeapons(playerid);
	}
	if(Searching[playerid] == 1)
	{
		RemovePlayerMapIcon(playerid, 500 + playerid);
		Searching[playerid] = 0;
	}
	if(Ronned[playerid] >= 1)
	{
	    KillTimer(RonnTimer[playerid]);
	}
	if(PlayerCuffed[playerid])
	{
	    KillTimer(cufftimer[playerid]);
	}

	if(playerid == beingvoted && reason != 2)
	{
	    KillTimer(votetimer1);
	    KillTimer(votetimer2);
	    format(string2,sizeof(string2),"[Glasanje]: %s (%d) se izlogovao, glasanje je zavrseno!",plname,playerid);
	    SendClientMessageToAll(TEAM_GROVE_COLOR,string2);
        votetimer1 = SetTimer("ResetVotation",300000,false);
	}
	if(PlayerCuffed[playerid] > 0)
	{
	    KillTimer(cufftimer[playerid]);
	}

	if(Tazer[playerid] == 1) { SafeGivePlayerWeapon(playerid, 24, PreTazerAmmo[playerid]); }
	Delete3DTextLabel(DutyLabel[playerid]);
	Delete3DTextLabel(AfkLabel[playerid]);
	gActivePlayers[playerid]--;
	numplayers--;
	RemovePlayerMapIcon(playerid, 37 + playerid);
	TextDrawDestroy(Textdraw64[playerid]);
	TextDrawDestroy(Textdraw54[playerid]);
	TextDrawDestroy(Textdraw53[playerid]);
	TextDrawDestroy(Textdraw52[playerid]);
	TextDrawDestroy(Textdraw51[playerid]);
	TextDrawDestroy(Textdraw49[playerid]);
	TextDrawDestroy(Textdraw42[playerid]);
	TextDrawDestroy(Textdraw41[playerid]);
	TextDrawDestroy(Textdraw40[playerid]);
	TextDrawDestroy(Textdraw39[playerid]);
	TextDrawDestroy(Textdraw1[playerid]);
	KillTimer(TrainTimer[playerid]);
	KillTimer(MoneyTimer[playerid]);
	if(IsPlayerInEVehicle[playerid] != 9999)
	{
	    new i = IsPlayerInEVehicle[playerid];
		Seats[i] --;
	}
	new string[24];
	new d,m,y,h,mi,s;
	getdate(y,m,d);
	gettime(h,mi,s);
	format(string, sizeof(string), "%d/%d/%d at %d:%d:%d",d,m,y,h,mi,s);
	strmid(PlayerInfo[playerid][pLastSeen], string, 0, strlen(string), 255);
	if(reason == 0)
	{
		textreason = "Crashed";
		strmid(PlayerInfo[playerid][pWhyLeft], "Crashed", 0, strlen("Crashed"), 255);
		format(string2, sizeof(string2),"[INFO]: %s je izasao sa Servera. [%s]",plname, textreason);
   		SendAdminMessage(COLOR_GREEN, string2);
	}
	else if(reason == 1)
	{
		textreason = "Leaving";
		strmid(PlayerInfo[playerid][pWhyLeft], "Leaving", 0, strlen("Leaving"), 255);
		format(string2, sizeof(string2),"[INFO]: %s je izasao sa Servera. [%s]",plname, textreason);
   		SendAdminMessage(COLOR_GREEN, string2);
	}
	else if(reason == 2)
	{
		strmid(PlayerInfo[playerid][pWhyLeft], "Kickovan/Banovan", 0, strlen("Kickovan/Banovan"), 255);
	}
	SaveGuns(playerid);
	OnPlayerUpdateEx(playerid);
	if(OfficerCourseStep[playerid] != 255)
	{
	    SafeGivePlayerMoney(playerid, -2500);
	}
	if(OnOfficerTest[playerid] != 0)
	{
	    SafeGivePlayerMoney(playerid, -5000);
	}
	if(ServerRestarted == 0)
	{
	    UpdatePlayerPosition(playerid)
	}
	KillTimer(ChangeNameTimer);
	OnPlayerUpdateEx(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~Pozivalac Taxija~n~~r~je napustio igru", 5000, 1);
		            TaxiCallTime[i] = 0;
		            DisablePlayerCheckpoint(i);
		        }
	        }
	        else if(BusAccepted[i] < 999)
	        {
		        if(BusAccepted[i] == playerid)
		        {
		            BusAccepted[i] = 999;
		            GameTextForPlayer(i, "~w~Pozivalac Autobusa~n~~r~je napustio igru", 5000, 1);
		            BusCallTime[i] = 0;
		            DisablePlayerCheckpoint(i);
		        }
	        }
	    }
	}
	if(PlayerInfo[playerid][pAdmin] >= 1)
	{
		admins --;
		if(AFK[playerid] == 1)
		{
		    afkadmins --;
		}
	}
	KillTimer(DildoTimerReset);
	/*if(GettingCK[playerid] < 999)
	{
	    if(IsPlayerConnected(GettingCK[playerid]))
	    {
	        SendClientMessage(GettingCK[playerid], COLOR_YELLOW, "Vas Character Kill je napustio server, pokusajte ponovo kasnije.");
	        OnCK[GettingCK[playerid]] = 999;
	    }
	}*/
	if(TransportCost[playerid] > 0 && TransportDriver[playerid] < 999)
	{
	    if(IsPlayerConnected(TransportDriver[playerid]))
		{
		    new string5[64];
		    TransportMoney[TransportDriver[playerid]] += TransportCost[playerid];
		    TransportTime[TransportDriver[playerid]] = 0;
		    TransportCost[TransportDriver[playerid]] = 0;
		    format(string5, sizeof(string5), "~w~Passenger left~n~~g~Earned $%d",TransportCost[playerid]);
		    GameTextForPlayer(TransportDriver[playerid], string5, 5000, 1);
		}
	}
	if(GotHit[playerid] > 0)
	{
	    if(GetChased[playerid] < 999)
	    {
	        if(IsPlayerConnected(GetChased[playerid]))
	        {
	        	SendClientMessage(GetChased[playerid], COLOR_YELLOW, "Vasa meta je otisla sa servera.");
	            GoChase[GetChased[playerid]] = 999;
			}
	    }
	}
	if(PlayersChannel[playerid] < 999)
	{
		IRCInfo[PlayersChannel[playerid]][iPlayers] -= 1;
	}
	if(HireCar[playerid] != 299)
	{
		gLastDriver[HireCar[playerid]] = 300;
		gCarLock[HireCar[playerid]] = 0;
		UnLockCar(HireCar[playerid]);
		if(reason != 0)
		{
			SetVehicleToRespawn(HireCar[playerid]);
		}
	}
	if(GangCar[playerid] != 512)
	{
		gLastDriver[GangCar[playerid]] = 520;
		gCarLock[GangCar[playerid]] = 0;
		UnLockCar(GangCar[playerid]);
	}
	if (gLastCar[playerid] > 0)
	{
		gLastDriver[gLastCar[playerid]] = 300;
		if(PlayerInfo[playerid][pPhousekey] != gLastCar[playerid]-1)
		{
			gCarLock[gLastCar[playerid]] = 0;
			UnLockCar(gLastCar[playerid]);
		}
	}
	if(PlayerBoxing[playerid] > 0)
	{
	    if(Boxer1 == playerid)
	    {
	        if(IsPlayerConnected(Boxer2))
	        {
	        	PlayerBoxing[Boxer2] = 0;
	        	SafeSetPlayerPos(Boxer2, 765.8433,3.2924,1000.7186);
	        	SafeSetPlayerInterior(Boxer2, 5);
	        	GameTextForPlayer(Boxer2, "~r~Mec je prekinut", 5000, 1);
			}
	    }
	    else if(Boxer2 == playerid)
	    {
	        if(IsPlayerConnected(Boxer1))
	        {
	        	PlayerBoxing[Boxer1] = 0;
	        	SafeSetPlayerPos(Boxer1, 765.8433,3.2924,1000.7186);
	        	SafeSetPlayerInterior(Boxer1, 5);
	        	GameTextForPlayer(Boxer1, "~r~Mec je prekinut", 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; }
	}
	else if(PlayerInfo[playerid][pJob] == 17)
	{
		if(JobDuty[playerid] == 1) { PizzaBoys -= 1; }
	}
	if (PlayerInfo[playerid][pRoadblock] != 0)
	{
		RemoveRoadblock(playerid);
	}
	BusrouteEast[playerid][0] = 0;
	BusrouteWest[playerid][0] = 0;
	IsInBus[playerid] = 0;
}
Red is line: 6748
Reply
#8

This should fix that:

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    new textreason[64];
    new plname[24];
    GetPlayerName(playerid, plname, sizeof(plname));
    new playersip[24];
    GetPlayerIp(playerid, playersip, sizeof(playersip));
    new string2[128];
    SafeResetPlayerWeapons(playerid);
    if(PlayerInfo[playerid][pAdminDuty] == 1)
    {
        SafeResetPlayerWeapons(playerid);
    }
    if(Searching[playerid] == 1)
    {
        RemovePlayerMapIcon(playerid, 500 + playerid);
        Searching[playerid] = 0;
    }
    if(Ronned[playerid] >= 1)
    {
        KillTimer(RonnTimer[playerid]);
    }
    if(PlayerCuffed[playerid])
    {
        KillTimer(cufftimer[playerid]);
    }

    if(playerid == beingvoted && reason != 2)
    {
        KillTimer(votetimer1);
        KillTimer(votetimer2);
        format(string2,sizeof(string2),"[Glasanje]: %s (%d) se izlogovao, glasanje je zavrseno!",plname,playerid);
        SendClientMessageToAll(TEAM_GROVE_COLOR,string2);
        votetimer1 = SetTimer("ResetVotation",300000,false);
    }
    if(PlayerCuffed[playerid] > 0)
    {
        KillTimer(cufftimer[playerid]);
    }

    if(Tazer[playerid] == 1) { SafeGivePlayerWeapon(playerid, 24, PreTazerAmmo[playerid]); }
    Delete3DTextLabel(DutyLabel[playerid]);
    Delete3DTextLabel(AfkLabel[playerid]);
    gActivePlayers[playerid]--;
    numplayers--;
    RemovePlayerMapIcon(playerid, 37 + playerid);
    TextDrawDestroy(Textdraw64[playerid]);
    TextDrawDestroy(Textdraw54[playerid]);
    TextDrawDestroy(Textdraw53[playerid]);
    TextDrawDestroy(Textdraw52[playerid]);
    TextDrawDestroy(Textdraw51[playerid]);
    TextDrawDestroy(Textdraw49[playerid]);
    TextDrawDestroy(Textdraw42[playerid]);
    TextDrawDestroy(Textdraw41[playerid]);
    TextDrawDestroy(Textdraw40[playerid]);
    TextDrawDestroy(Textdraw39[playerid]);
    TextDrawDestroy(Textdraw1[playerid]);
    KillTimer(TrainTimer[playerid]);
    KillTimer(MoneyTimer[playerid]);
    if(IsPlayerInEVehicle[playerid] != 9999)
    {
        new i = IsPlayerInEVehicle[playerid];
        Seats[i] --;
    }
    new string[24];
    new d,m,y,h,mi,s;
    getdate(y,m,d);
    gettime(h,mi,s);
    format(string, sizeof(string), "%d/%d/%d at %d:%d:%d",d,m,y,h,mi,s);
    strmid(PlayerInfo[playerid][pLastSeen], string, 0, strlen(string), 255);
    if(reason == 0)
    {
        textreason = "Crashed";
        strmid(PlayerInfo[playerid][pWhyLeft], "Crashed", 0, strlen("Crashed"), 255);
        format(string2, sizeof(string2),"[INFO]: %s je izasao sa Servera. [%s]",plname, textreason);
        SendAdminMessage(COLOR_GREEN, string2);
    }
    else if(reason == 1)
    {
        textreason = "Leaving";
        strmid(PlayerInfo[playerid][pWhyLeft], "Leaving", 0, strlen("Leaving"), 255);
        format(string2, sizeof(string2),"[INFO]: %s je izasao sa Servera. [%s]",plname, textreason);
        SendAdminMessage(COLOR_GREEN, string2);
    }
    else if(reason == 2)
    {
        strmid(PlayerInfo[playerid][pWhyLeft], "Kickovan/Banovan", 0, strlen("Kickovan/Banovan"), 255);
    }
    SaveGuns(playerid);
    OnPlayerUpdateEx(playerid);
    if(OfficerCourseStep[playerid] != 255)
    {
        SafeGivePlayerMoney(playerid, -2500);
    }
    if(OnOfficerTest[playerid] != 0)
    {
        SafeGivePlayerMoney(playerid, -5000);
    }
    if(ServerRestarted == 0)
    {
        UpdatePlayerPosition(playerid)
    }
    KillTimer(ChangeNameTimer);
    OnPlayerUpdateEx(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~Pozivalac Taxija~n~~r~je napustio igru", 5000, 1);
                    TaxiCallTime[i] = 0;
                    DisablePlayerCheckpoint(i);
                }
            }
            else if(BusAccepted[i] < 999)
            {
                if(BusAccepted[i] == playerid)
                {
                    BusAccepted[i] = 999;
                    GameTextForPlayer(i, "~w~Pozivalac Autobusa~n~~r~je napustio igru", 5000, 1);
                    BusCallTime[i] = 0;
                    DisablePlayerCheckpoint(i);
                }
            }
        }
    }
    if(PlayerInfo[playerid][pAdmin] >= 1)
    {
        admins --;
        if(AFK[playerid] == 1)
        {
            afkadmins --;
        }
    }
    KillTimer(DildoTimerReset);
    /*if(GettingCK[playerid] < 999)
    {
        if(IsPlayerConnected(GettingCK[playerid]))
        {
            SendClientMessage(GettingCK[playerid], COLOR_YELLOW, "Vas Character Kill je napustio server, pokusajte ponovo kasnije.");
            OnCK[GettingCK[playerid]] = 999;
        }
    }*/

    if(TransportCost[playerid] > 0 && TransportDriver[playerid] < 999)
    {
        if(IsPlayerConnected(TransportDriver[playerid]))
        {
            new string5[64];
            TransportMoney[TransportDriver[playerid]] += TransportCost[playerid];
            TransportTime[TransportDriver[playerid]] = 0;
            TransportCost[TransportDriver[playerid]] = 0;
            format(string5, sizeof(string5), "~w~Passenger left~n~~g~Earned $%d",TransportCost[playerid]);
            GameTextForPlayer(TransportDriver[playerid], string5, 5000, 1);
        }
    }
    if(GotHit[playerid] > 0)
    {
        if(GetChased[playerid] < 999)
        {
            if(IsPlayerConnected(GetChased[playerid]))
            {
                SendClientMessage(GetChased[playerid], COLOR_YELLOW, "Vasa meta je otisla sa servera.");
                GoChase[GetChased[playerid]] = 999;
            }
        }
    }
    if(PlayersChannel[playerid] < 999)
    {
        IRCInfo[PlayersChannel[playerid]][iPlayers] -= 1;
    }
    if(HireCar[playerid] != 299)
    {
        gLastDriver[HireCar[playerid]] = 300;
        gCarLock[HireCar[playerid]] = 0;
        UnLockCar(HireCar[playerid]);
        if(reason != 0)
        {
            SetVehicleToRespawn(HireCar[playerid]);
        }
    }
    if(GangCar[playerid] != 512)
    {
        gLastDriver[GangCar[playerid]] = 520;
        gCarLock[GangCar[playerid]] = 0;
        UnLockCar(GangCar[playerid]);
    }
    if (gLastCar[playerid] > 0)
    {
        gLastDriver[gLastCar[playerid]] = 300;
        if(PlayerInfo[playerid][pPhousekey] != gLastCar[playerid]-1)
        {
            gCarLock[gLastCar[playerid]] = 0;
            UnLockCar(gLastCar[playerid]);
        }
    }
    if(PlayerBoxing[playerid] > 0)
    {
        if(Boxer1 == playerid)
        {
            if(IsPlayerConnected(Boxer2))
            {
                PlayerBoxing[Boxer2] = 0;
                SafeSetPlayerPos(Boxer2, 765.8433,3.2924,1000.7186);
                SafeSetPlayerInterior(Boxer2, 5);
                GameTextForPlayer(Boxer2, "~r~Mec je prekinut", 5000, 1);
            }
        }
        else if(Boxer2 == playerid)
        {
            if(IsPlayerConnected(Boxer1))
            {
                PlayerBoxing[Boxer1] = 0;
                SafeSetPlayerPos(Boxer1, 765.8433,3.2924,1000.7186);
                SafeSetPlayerInterior(Boxer1, 5);
                GameTextForPlayer(Boxer1, "~r~Mec je prekinut", 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; }
    }
    else if(PlayerInfo[playerid][pJob] == 17)
    {
        if(JobDuty[playerid] == 1) { PizzaBoys -= 1; }
    }
    if (PlayerInfo[playerid][pRoadblock] != 0)
    {
        RemoveRoadblock(playerid);
    }
    BusrouteEast[playerid][0] = 0;
    BusrouteWest[playerid][0] = 0;
    IsInBus[playerid] = 0;
    return 1;
}
Reply
#9

Thank you you saved me
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)