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(playerid, params[])
{
new price, interior, Float:pX, Float:pY, Float:pZ;
GetPlayerPos(playerid, pX, pY, pZ);
if(sscanf(params, "i", price)) return SendClientMessage(playerid, COLOR_RED, "Usage: /chouse <Prezzo>");
if(price < 20 || price > 99999) { SendClientMessage(playerid, COLOR_GREEN, "Price Between 20 and 999999"); return 1; }
SendClientMessage(playerid, COLOR_GREEN, "Ok");
return 1;
}
Re: Return ShowPlayerDialog Problem! -
ExogenZC - 13.08.2015
Quote:
Originally Posted by IgorLuiz
PHP код:
CMD:chouse(playerid, params[])
{
new price, interior, Float:pX, Float:pY, Float:pZ;
GetPlayerPos(playerid, pX, pY, pZ);
if(sscanf(params, "i", price)) return SendClientMessage(playerid, COLOR_RED, "Usage: /chouse <Prezzo>");
if(price < 20 || price > 99999) { SendClientMessage(playerid, COLOR_GREEN, "Price Between 20 and 999999"); return 1; }
SendClientMessage(playerid, COLOR_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)