SA-MP Forums Archive
Not working - 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: Not working (/showthread.php?tid=596933)



Not working - Shazwan - 24.12.2015

Everything set and arrange look work, no error but when function in game doesnt work, please help

Код:
    
    if(dialogid == BPDRUGP)
    {
	new str[300], druggy = strval(inputtext);
	if(!response)
	{
	}
	else
	{
            switch(listitem)
            {
                case 0:
                {
                    if(!PlayerInfo[playerid][pPot]) return SendClientMessage(playerid, COLOR_GRAD2,"You don't have any pot left!");
                    if(druggy < 1 || druggy > 80)
    		    {
		    if( PlayerInfo[playerid][pBpot] == 80)
                    {
			    SendClientMessageEx(playerid, COLOR_WHITE, "Your backpack has reach the limit amount of pot!");
                            format(str, sizeof(str), "Pot {3BB9FF}(%d gram){FFFFFF}\nCrack: {3BB9FF}(%d gram){FFFFFF}", PlayerInfo[playerid][pBpot], PlayerInfo[playerid][pBcrack]);
                            ShowPlayerDialog(playerid, BPDRUG, DIALOG_STYLE_LIST, "My Narcotic", str, "Take", "Cancel");
                            return 1;
			    }
                 	    ShowPlayerDialog( playerid, BPDRUGP, DIALOG_STYLE_INPUT, "Pot Storage","Please enter amount of pot to Deposit.", "Deposit", "Cancel" );
        	    }
     		    else
        	    {
        		    SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited some pot in your Backpack.");
  	     	            format(string,sizeof(string), "* %s has deposited some pot in their Backpack.", GetPlayerNameEx(playerid));
       		            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  	     	            PlayerInfo[playerid][pBpot] += druggy;
        	            PlayerInfo[playerid][pPot] -= druggy;
                            format(str, sizeof(str), "Pot {3BB9FF}(%d gram){FFFFFF}\nCrack: {3BB9FF}(%d gram){FFFFFF}", PlayerInfo[playerid][pBpot], PlayerInfo[playerid][pBcrack]);
                            ShowPlayerDialog(playerid, BPDRUG, DIALOG_STYLE_LIST, "My Narcotic", str, "Take", "Cancel");
	            }
		}
		case 1:
                {
                        if(!PlayerInfo[playerid][pBpot]) return SendClientMessage(playerid, COLOR_GRAD2,"You don't have any pot left or choose other section to withdraw.");
			if(druggy < 1 || druggy > 80)
		    	{
                 		ShowPlayerDialog( playerid, BPDRUGP, DIALOG_STYLE_INPUT, "Pot Storage","Please enter amount of pot to Withdraw.", "Withdraw", "Cancel" );
    	    		}
    		    	else
    		    	{
		                SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have withdraw some pot from your Backpack.");
        	        	format(string,sizeof(string), "* %s has withdraw some pot from their Backpack.", GetPlayerNameEx(playerid));
        	        	ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
       		        	PlayerInfo[playerid][pPot] += druggy;
       		        	PlayerInfo[playerid][pBpot] -= druggy;
                                format(str, sizeof(str), "Pot {3BB9FF}(%d gram){FFFFFF}\nCrack: {3BB9FF}(%d gram){FFFFFF}", PlayerInfo[playerid][pBpot], PlayerInfo[playerid][pBcrack]);
                                ShowPlayerDialog(playerid, BPDRUG, DIALOG_STYLE_LIST, "My Narcotic", str, "Take", "Cancel");
	        	}
		}
            }
            return 1;
 	}
    }



Re: Not working - Ritzy2K - 24.12.2015

What's the problem? The dialog vanishes away? Tell me more bout the issue.


Re: Not working - Amunra - 24.12.2015

Reply your error


Re: Not working - Shazwan - 24.12.2015

Dialog when compile it works fine but when in game the cmd function for this dialog isnt working


Re: Not working - Amunra - 24.12.2015

What not work CMD or DialogResponse
Like this ? Ex:CMD Can be use but Dialog response not responding ?


Re: Not working - Shazwan - 24.12.2015

its dialog response i think ye


Re: Not working - Amunra - 24.12.2015

Check for more wiki samp Dialog response
and Wiki samp show playerdialog

I never experienced anything like it ! But i confused to fix this problem


Re: Not working - TwinkiDaBoss - 24.12.2015

Quote:
Originally Posted by Amunra
Посмотреть сообщение
Check for more wiki samp Dialog response
and Wiki samp show playerdialog

I never experienced anything like it ! But i confused to fix this problem
Stop spamming the forums with stupid stuff. If you cannot help them dont give them link to Wiki pages.

First of all
PHP код:
if(!response) return true
Whats this supposted to represent?
PHP код:
if(druggy || druggy 80
What is druggy supposted to be?

Also show us the command that you execute to show the dialog to the player


Re: Not working - Shazwan - 24.12.2015

druggy is represent the input text amount in the dialog

this

Код:
druggy = strval(inputtext);
and this is the main for it to response

Код:
	
if(dialogid == BPDRUG)
{
    if(response)
    {
        switch(listitem)
        {
            case 0:
            {
                ShowPlayerDialog(playerid, BPDRUGP, DIALOG_STYLE_LIST, "Pot", "Deposit\nWithdraw", "Choose", "Cancel");
	    }
            case 1:
            {
                ShowPlayerDialog(playerid, BPDRUGC, DIALOG_STYLE_LIST, "Crack", "Deposit\nWithdraw", "Choose", "Cancel");

            }
        }
        return 1;
    }
}