SA-MP Forums Archive
Return ShowPlayerDialog Problem! - 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: Return ShowPlayerDialog Problem! (/showthread.php?tid=585350)



Return ShowPlayerDialog Problem! - ExogenZC - 13.08.2015

Here my command: http://pastebin.com/4GvkPP2d

The problem ?

Console doesn't show any error or warning but when i execute "/chouse 10" or "/chouse 99999999" for example, the SHOWPLAYERDIALOG after that RETURN doens't work, and instead shows "Ok".

Help!

PS: Sorry for my english, i'm Italian.


Re: Return ShowPlayerDialog Problem! - IgorLuiz - 13.08.2015

PHP код:
CMD:chouse(playeridparams[])
{
    new 
priceinteriorFloat:pXFloat:pYFloat:pZ;
    
GetPlayerPos(playeridpXpYpZ);
    if(
sscanf(params"i"price)) return SendClientMessage(playeridCOLOR_RED"Usage: /chouse <Prezzo>");
    if(
price 20 || price 99999) { SendClientMessage(playeridCOLOR_GREEN"Price Between 20 and 999999"); return 1; }
    
SendClientMessage(playeridCOLOR_GREEN"Ok");
    return 
1;




Re: Return ShowPlayerDialog Problem! - ExogenZC - 13.08.2015

Quote:
Originally Posted by IgorLuiz
Посмотреть сообщение
PHP код:
CMD:chouse(playeridparams[])
{
    new 
priceinteriorFloat:pXFloat:pYFloat:pZ;
    
GetPlayerPos(playeridpXpYpZ);
    if(
sscanf(params"i"price)) return SendClientMessage(playeridCOLOR_RED"Usage: /chouse <Prezzo>");
    if(
price 20 || price 99999) { SendClientMessage(playeridCOLOR_GREEN"Price Between 20 and 999999"); return 1; }
    
SendClientMessage(playeridCOLOR_GREEN"Ok");
    return 
1;

Work, but I don't undestand that "return 1;" after SendClientMessage(playerid, COLOR_GREEN, "Price Between 20 and 999999");


Re: Return ShowPlayerDialog Problem! - Toxik - 13.08.2015

Quote:
Originally Posted by ExogenZC
Посмотреть сообщение
Work, but I don't undestand that "return 1;" after SendClientMessage(playerid, COLOR_GREEN, "Price Between 20 and 999999");
Return 1; = Return true; //Enabled returning
if there is
Return 0; = Return false; //Disabled returning


Re: Return ShowPlayerDialog Problem! - ExogenZC - 13.08.2015

Ok, Thanks!


Re: Return ShowPlayerDialog Problem! - LovelySoomro - 13.08.2015

try this one

CMD:chouse(playerid, params[])
{
new price;
new interior;
if(sscanf(params, "i", price)) return SendClientMessage(playerid, COLOR_RED, "Usage: /chouse <Prezzo>");
new Float: pX;
new Float: pY;
new Float: pZ;
GetPlayerPos(playerid, pX, pY, pZ);

if(price < 20 && price > 99999) return SendClientMessage(playerid, COLOR_GREEN, "Price Between 20 and 999999");
{
SendClientMessage(playerid, COLOR_GREEN, "Ok");
}
return 1;
}


Re: Return ShowPlayerDialog Problem! - MarvinPWN - 13.08.2015

The problem is your &&-operator, you need the ||-operator:
PHP код:
 if(price 20 && price 99999
to
PHP код:
 if(price 20 || price 99999