Command dont work..
#1

Why this command dont work, i try to refuel my vehicle, gives me that i dont have enough money. When i have the money it's show me the dialog i write in it liters and nothing happed. Please help.

Код:
if (!strcmp("/refuel",cmdtext,true,10)) {
 	    if(IsPlayerInRangeOfPoint(playerid, 10, 2149.8328,2748.2905,10.5474) && F1 >= 5 || IsPlayerInRangeOfPoint(playerid, 10, 1944.1652,-1769.8917,13.1157) && F2 >= 5  || IsPlayerInRangeOfPoint(playerid, 10, 2116.6611,922.4604,10.5474) && F3 >= 5  || IsPlayerInRangeOfPoint(playerid, 10, 2204.3835,2473.3994,10.5474) && F4 >= 5)
	    {
        if (!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0xFFC800FF,"Ти не си в превозно средство!");
        ShowPlayerDialog(playerid,67,DIALOG_STYLE_INPUT,"Refuel","{FFFFFF}Трябва да натиснеш копчето 1{FF0000}\nза да добавиш 10л и така до 9","Презареди","Затвори");
		}
		else
		{
		    SendClientMessage(playerid, COLOR_GRAD1, "Вие не сте до бензиностанция или няма бензин!");
		    return 1;
		}
		return 1;
	}
Reply
#2

The problem it's from range of point. How to fix it?
Reply
#3

You use all the AND and OR at the same statement - that's what parentheses are for!

pawn Код:
if ((IsPlayerInRangeOfPoint(playerid, 10, 2149.8328,2748.2905,10.5474) && F1 >= 5)
|| (IsPlayerInRangeOfPoint(playerid, 10, 1944.1652,-1769.8917,13.1157) && F2 >= 5)
|| (IsPlayerInRangeOfPoint(playerid, 10, 2116.6611,922.4604,10.5474) && F3 >= 5)
|| (IsPlayerInRangeOfPoint(playerid, 10, 2204.3835,2473.3994,10.5474) && F4 >= 5))
Reply
#4

Dont fix again command dont work..
Reply
#5

OnDialogResponse for ID 67 please
Reply
#6

I try with other command and everything works but i dont have rangeofpoint. So i think the problem it's not in the dialogresponse but.. Here is ondialogreponse for ID 67.

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new vid = GetPlayerVehicleID(playerid);
if(dialogid == 67 && response == 1)
{
    if(inputtext[0] == '1') {
        			if(PlayerInfo[playerid][pCash] >= 10000)
			{
				    		if(IsPlayerInRangeOfPoint(playerid, 10.0, 2149.8328,2748.2905,10.5474)) //
		{
		F1 -= 10;
				return 1;
		}
							    		if(IsPlayerInRangeOfPoint(playerid, 10.0, 1944.1652,-1769.8917,13.1157)) //
		{
		F2 -= 10;
				return 1;
		}
			    		if(IsPlayerInRangeOfPoint(playerid, 10.0, 2116.6611,922.4604,10.5474)) //
		{
		F3 -= 10;
				return 1;
		}
			    		if(IsPlayerInRangeOfPoint(playerid, 10.0, 2204.3835,2473.3994,10.5474)) //
		{
		F4 -= 10;
				return 1;
		}
        fuel[vid] = fuel[vid] +10;
        GivePlayerMoney(playerid, -10000);
        SendClientMessage(playerid,COLOR_YELLOW,"Ти добави 10 литра бензин на твоето превозно средство!");
        }
        else
		{
		SendClientMessage(playerid, COLOR_GRAD1,"Нямаш достатъчно пари!");
		}

    }
    
    else if(inputtext[0] == '2') {
    			if(PlayerInfo[playerid][pCash] >= 20000)
			{
			
				    		if(IsPlayerInRangeOfPoint(playerid, 10.0, 2149.8328,2748.2905,10.5474)) //
		{
		F1 -= 20;
				return 1;
		}
							    		if(IsPlayerInRangeOfPoint(playerid, 10.0, 1944.1652,-1769.8917,13.1157)) //
		{
		F2 -= 20;
				return 1;
		}
			    		if(IsPlayerInRangeOfPoint(playerid, 10.0, 2116.6611,922.4604,10.5474)) //
		{
		F3 -= 20;
				return 1;
		}
			    		if(IsPlayerInRangeOfPoint(playerid, 10.0, 2204.3835,2473.3994,10.5474)) //
		{
		F4 -= 20;
				return 1;
		}
		
		
        fuel[vid] = fuel[vid] +20;
        GivePlayerMoney(playerid, -20000);
        SendClientMessage(playerid,COLOR_YELLOW,"Ти добави 20 литра бензин на твоето превозно средство!");
                }
        else
		{
		SendClientMessage(playerid, COLOR_GRAD1,"Нямаш достатъчно пари!");
		}
        }
            else if(inputtext[0] == '3') {
    			if(PlayerInfo[playerid][pCash] >= 30000)
			{


				    		if(IsPlayerInRangeOfPoint(playerid, 10.0, 2149.8328,2748.2905,10.5474)) //
		{
		F1 -= 30;
				return 1;
		}
							    		if(IsPlayerInRangeOfPoint(playerid, 10.0, 1944.1652,-1769.8917,13.1157)) //
		{
		F2 -= 30;
				return 1;
		}
			    		if(IsPlayerInRangeOfPoint(playerid, 10.0, 2116.6611,922.4604,10.5474)) //
		{
		F3 -= 30;
				return 1;
		}
			    		if(IsPlayerInRangeOfPoint(playerid, 10.0, 2204.3835,2473.3994,10.5474)) //
		{
		F4 -= 30;
				return 1;
		}


        fuel[vid] = fuel[vid] +30;
        GivePlayerMoney(playerid, -30000);
        SendClientMessage(playerid,COLOR_YELLOW,"Ти добави 30 литра бензин на твоето превозно средство!");
                }
        else
		{
		SendClientMessage(playerid, COLOR_GRAD1,"Нямаш достатъчно пари!");
		}
        }
            else if(inputtext[0] == '4') {
    			if(PlayerInfo[playerid][pCash] >= 40000)
			{


				    		if(IsPlayerInRangeOfPoint(playerid, 10.0, 2149.8328,2748.2905,10.5474)) //
		{
		F1 -= 40;
				return 1;
		}
							    		if(IsPlayerInRangeOfPoint(playerid, 10.0, 1944.1652,-1769.8917,13.1157)) //
		{
		F2 -= 40;
				return 1;
		}
			    		if(IsPlayerInRangeOfPoint(playerid, 10.0, 2116.6611,922.4604,10.5474)) //
		{
		F3 -= 40;
				return 1;
		}
			    		if(IsPlayerInRangeOfPoint(playerid, 10.0, 2204.3835,2473.3994,10.5474)) //
		{
		F4 -= 40;
				return 1;
		}


        fuel[vid] = fuel[vid] +40;
        GivePlayerMoney(playerid, -40000);
        SendClientMessage(playerid,COLOR_YELLOW,"Ти добави 40 литра бензин на твоето превозно средство!");
                }
        else
		{
		SendClientMessage(playerid, COLOR_GRAD1,"Нямаш достатъчно пари!");
		}
        }
            else if(inputtext[0] == '5') {
    			if(PlayerInfo[playerid][pCash] >= 50000)
			{


				    		if(IsPlayerInRangeOfPoint(playerid, 10.0, 2149.8328,2748.2905,10.5474)) //
		{
		F1 -= 50;
				return 1;
		}
							    		if(IsPlayerInRangeOfPoint(playerid, 10.0, 1944.1652,-1769.8917,13.1157)) //
		{
		F2 -= 50;
				return 1;
		}
			    		if(IsPlayerInRangeOfPoint(playerid, 10.0, 2116.6611,922.4604,10.5474)) //
		{
		F3 -= 50;
				return 1;
		}
			    		if(IsPlayerInRangeOfPoint(playerid, 10.0, 2204.3835,2473.3994,10.5474)) //
		{
		F4 -= 50;
				return 1;
		}


        fuel[vid] = fuel[vid] +50;
        GivePlayerMoney(playerid, -50000);
        SendClientMessage(playerid,COLOR_YELLOW,"Ти добави 50 литра бензин на твоето превозно средство!");
                }
        else
		{
		SendClientMessage(playerid, COLOR_GRAD1,"Нямаш достатъчно пари!");
		}
        }
            else if(inputtext[0] == '6') {
    			if(PlayerInfo[playerid][pCash] >= 60000)
			{


				    		if(IsPlayerInRangeOfPoint(playerid, 10.0, 2149.8328,2748.2905,10.5474)) //
		{
		F1 -= 60;
				return 1;
		}
							    		if(IsPlayerInRangeOfPoint(playerid, 10.0, 1944.1652,-1769.8917,13.1157)) //
		{
		F2 -= 60;
				return 1;
		}
			    		if(IsPlayerInRangeOfPoint(playerid, 10.0, 2116.6611,922.4604,10.5474)) //
		{
		F3 -= 60;
				return 1;
		}
			    		if(IsPlayerInRangeOfPoint(playerid, 10.0, 2204.3835,2473.3994,10.5474)) //
		{
		F4 -= 60;
				return 1;
		}


        fuel[vid] = fuel[vid] +60;
        GivePlayerMoney(playerid, -60000);
        SendClientMessage(playerid,COLOR_YELLOW,"Ти добави 60 литра бензин на твоето превозно средство!");
                }
        else
		{
		SendClientMessage(playerid, COLOR_GRAD1,"Нямаш достатъчно пари!");
		}
        }
            else if(inputtext[0] == '7') {
    			if(PlayerInfo[playerid][pCash] >= 70000)
			{


				    		if(IsPlayerInRangeOfPoint(playerid, 10.0, 2149.8328,2748.2905,10.5474)) //
		{
		F1 -= 70;
				return 1;
		}
							    		if(IsPlayerInRangeOfPoint(playerid, 10.0, 1944.1652,-1769.8917,13.1157)) //
		{
		F2 -= 70;
				return 1;
		}
			    		if(IsPlayerInRangeOfPoint(playerid, 10.0, 2116.6611,922.4604,10.5474)) //
		{
		F3 -= 70;
				return 1;
		}
			    		if(IsPlayerInRangeOfPoint(playerid, 10.0, 2204.3835,2473.3994,10.5474)) //
		{
		F4 -= 70;
				return 1;
		}


        fuel[vid] = fuel[vid] +70;
        GivePlayerMoney(playerid, -70000);
        SendClientMessage(playerid,COLOR_YELLOW,"Ти добави 70 литра бензин на твоето превозно средство!");
                }
        else
		{
		SendClientMessage(playerid, COLOR_GRAD1,"Нямаш достатъчно пари!");
		}
        }
        
        
            else if(inputtext[0] == '8') {
    			if(PlayerInfo[playerid][pCash] >= 80000)
			{


				    		if(IsPlayerInRangeOfPoint(playerid, 10.0, 2149.8328,2748.2905,10.5474)) //
		{
		F1 -= 80;
				return 1;
		}
							    		if(IsPlayerInRangeOfPoint(playerid, 10.0, 1944.1652,-1769.8917,13.1157)) //
		{
		F2 -= 80;
				return 1;
		}
			    		if(IsPlayerInRangeOfPoint(playerid, 10.0, 2116.6611,922.4604,10.5474)) //
		{
		F3 -= 80;
				return 1;
		}
			    		if(IsPlayerInRangeOfPoint(playerid, 10.0, 2204.3835,2473.3994,10.5474)) //
		{
		F4 -= 80;
				return 1;
		}


        fuel[vid] = fuel[vid] +80;
        GivePlayerMoney(playerid, -80000);
        SendClientMessage(playerid,COLOR_YELLOW,"Ти добави 80 литра бензин на твоето превозно средство!");
                }
        else
		{
		SendClientMessage(playerid, COLOR_GRAD1,"Нямаш достатъчно пари!");
		}
        }
            else if(inputtext[0] == '9') {
    			if(PlayerInfo[playerid][pCash] >= 90000)
			{


				    		if(IsPlayerInRangeOfPoint(playerid, 10.0, 2149.8328,2748.2905,10.5474)) //
		{
		F1 -= 90;
				return 1;
		}
							    		if(IsPlayerInRangeOfPoint(playerid, 10.0, 1944.1652,-1769.8917,13.1157)) //
		{
		F2 -= 90;
				return 1;
		}
			    		if(IsPlayerInRangeOfPoint(playerid, 10.0, 2116.6611,922.4604,10.5474)) //
		{
		F3 -= 90;
				return 1;
		}
			    		if(IsPlayerInRangeOfPoint(playerid, 10.0, 2204.3835,2473.3994,10.5474)) //
		{
		F4 -= 90;
				return 1;
		}


        fuel[vid] = fuel[vid] +90;
        GivePlayerMoney(playerid, -90000);
        SendClientMessage(playerid,COLOR_YELLOW,"Ти добави 90 литра бензин на твоето превозно средство!");
                }
        else
		{
		SendClientMessage(playerid, COLOR_GRAD1,"Нямаш достатъчно пари!");
		}
        }
Reply
#7

Help please?
Reply
#8

Help please..
Reply
#9

Please help me..
Reply
#10

Help with this command, please!
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)