27.07.2012, 07:36
Hello. Well, i felt to script a bit and decided to make something rare. A poker system. Well, all is going good but i am having a little problem with the bet dialog.
I use imputtext OnDialogResponse to get the number player typed, the money he bet, but instad of that, if i bet 2, it says 1, if i bet 10, it says 2, if i bet 100, it says 3. It's saying the ammount of numbers, instead of the number i entered.
Any clue why?
Ignore the second else.. It's just returning that message temporary.
The problem is really that imput dialog telling the ammount of numbers, and not the number...
Thanks.
I use imputtext OnDialogResponse to get the number player typed, the money he bet, but instad of that, if i bet 2, it says 1, if i bet 10, it says 2, if i bet 100, it says 3. It's saying the ammount of numbers, instead of the number i entered.
Any clue why?
pawn Код:
if(dialogid == DIALOG_BET5)
{
if(strlen(inputtext) >= 1)
{
PokerCardsInfo[Pot] = PokerCardsInfo[Pot]+strlen(inputtext);
new Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, sizeof(Name));
new string[128];
format(string, sizeof(string), "%s has bet %d", Name, strlen(inputtext));
ProxDetector(10.0, playerid, string, 0xFFFFFF, 0xFFFFFF, 0xFFFFFF, 0xFFFFFF, 0xFFFFFF);
if(IsPlayerConnected(PokerCardsInfo[P6]))
{
ShowPlayerDialog(PokerCardsInfo[P6], DIALOG_POKER6, DIALOG_STYLE_LIST, "Poker", "Bet\nCheck\nFold", "Continue", "");
}
else
{
new str[128];
format(str, sizeof(str), "Everyone made their bets, the dealer should now /givecards.", Name);
ProxDetector(10.0, playerid, str, 0xFFFFFF, 0xFFFFFF, 0xFFFFFF, 0xFFFFFF, 0xFFFFFF);
}
return 1;
}
else
{
new Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, sizeof(Name));
new string[128];
format(string, sizeof(string), "%s has bet 0 and is out.", Name);
ProxDetector(10.0, playerid, string, 0xFFFFFF, 0xFFFFFF, 0xFFFFFF, 0xFFFFFF, 0xFFFFFF);
PokerCardsInfo[P5] = 500;
PokerPlayerInfo[playerid][Playing] = 0;
if(IsPlayerConnected(PokerCardsInfo[P6]))
{
ShowPlayerDialog(PokerCardsInfo[P6], DIALOG_POKER6, DIALOG_STYLE_LIST, "Poker", "Bet\nCheck\nFold", "Continue", "");
}
else
{
new str[128];
format(str, sizeof(str), "Everyone made their bets, the dealer should now /givecards.", Name);
ProxDetector(10.0, playerid, str, 0xFFFFFF, 0xFFFFFF, 0xFFFFFF, 0xFFFFFF, 0xFFFFFF);
}
return 1;
}
}
The problem is really that imput dialog telling the ammount of numbers, and not the number...
Thanks.