SA-MP Forums Archive
Dialog displays to wrong player. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Dialog displays to wrong player. (/showthread.php?tid=330210)



Dialog displays to wrong player. - DJGama101 - 31.03.2012

Hello. I edited some fuel system, and i have problem. The message box (gui) displays always to player with id 0. For example, you have id 2 and the dialog doesn't show to you buy to id 0.

Code

Код:
public Tankowanie(playerid)
{
   	new x, y, string[256];
    x = 150 - VehicleFuel[playerid];
	y = x*3;
    GivePlayerMoney(playerid, -y);
    format(string,sizeof string,"{A8C3E3}Zatankowałeś {FFFFFF}%d {A8C3E3}litrуw paliwa za {FFFFFF}$%d",x,y);
    SendClientMessage(playerid,JasnyNiebieski, string);
    ShowPlayerDialog(playerid, D_CPN_Bankomat, DIALOG_STYLE_MSGBOX, "{FFFFFF}Stacja Paliw - Dziękujemy!", string, "OK", "");
    VehicleFuel[playerid] = 150;
    TogglePlayerControllable(playerid,1);
    return 1;
}
Код:
if (strcmp("/stacja", cmdtext, true, 10) == 0)
	{
	    if((IsPlayerInAnyVehicle(playerid)) && (IsPlayerInRangeOfPoint(playerid, 7.0, -2026.7162,157.0780,29.0391)))
		{
		ShowPlayerDialog(playerid, D_CPN, DIALOG_STYLE_LIST,""WHITE"Stacja Paliwowa","{00FF22}> {FFFFFF}Tankowanie\n{00FF22}> {FFFFFF}Bankomat\n{00FF22}> {FFFFFF}Sklep","Wybierz","Anuluj");
		}
	return 1;

	}



Re: Dialog displays to wrong player. - OxyG3N - 31.03.2012

I think you need to show us script where you using
pawn Код:
Tankowanie(playerid)



Re: Dialog displays to wrong player. - DJGama101 - 31.03.2012

Код:
case 0:
		{
		new string[256], x;
		x = 150 - VehicleFuel[GetPlayerVehicleID(playerid)];
    	format(string, sizeof(string), "Tankowanie %d litrow", x);
    	GameTextForPlayer(playerid, string, 10000, 4);
		TogglePlayerControllable(playerid,0);
		SetTimer("Tankowanie",10000,0);
		}



Re: Dialog displays to wrong player. - OxyG3N - 31.03.2012

pawn Код:
case 0:
        {
        new string[256], x;
        x = 150 - VehicleFuel[GetPlayerVehicleID(playerid)];
        format(string, sizeof(string), "Tankowanie %d litrow", x);
        GameTextForPlayer(playerid, string, 10000, 4);
        TogglePlayerControllable(playerid,0);
        SetTimerEx("Tankowanie",10000,0, "i", playerid);
        }



Re: Dialog displays to wrong player. - DJGama101 - 31.03.2012

It works great, thanks +rep ofc.