Hey can someone tell me whats wrong with this dialog or show me, the Credit dialog is not working at all when you enter the pin.
pawn Код:
if(dialogid == 47)
{
if(response) {
ShowPlayerDialog(playerid, Credit, DIALOG_STYLE_INPUT,"Pay with Credit Card", "Please enter the Pin number","Enter", "Cancel");
return 1;
}
}
if(dialogid == Credit)
{
if(response) {
new giveplayerid;
new dstring[256];
new sendernames[MAX_PLAYER_NAME];
new creditpin;
creditpin = strval(inputtext);
if(SelectedItem[playerid] == 1) {
// Phone Book
if(GetPlayerPCash(playerid)<book) {
SendClientMessage(playerid,COLOR_GRAD3,"[INFO]: You Don't have enough Cash for that item!");
return 1;
}
PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-book;
SendClientMessage(playerid,COLOR_GRAD3,"[INFO]: You have bought a Phonebook, You can now use /number.");
PlayerInfo[playerid][pPhoneBook] = 1;
return 1;
}
if(SelectedItem[playerid] == 2) {
// Dice
if(GetPlayerPCash(playerid)<dicep) {
SendClientMessage(playerid,COLOR_GRAD3,"[INFO]: You Don't have enough Cash for that item!");
return 1;
}
PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-dicep;
SendClientMessage(playerid,COLOR_GRAD3,"[INFO]: You have bought Dice, You can now use /dice.");
gDice[playerid] = 1;
return 1;
}
else if(SelectedItem[playerid] == 3) {
// Mask
if(PlayerInfo[playerid][pMember] == 1 && PlayerInfo[playerid][pLevel] < 1) {
//GivePlayerPCash(playerid, - 50);
SendClientMessage(playerid,COLOR_GRAD3,"[INFO]: You have just got a Mask for free, You can use /mask.");
PlayerInfo[playerid][pMask] = 1;
return 1;
}
else if(GetPlayerPCash(playerid) < maskp && PlayerInfo[playerid][pMember] >= 7 || GetPlayerPCash(playerid) < 50 && PlayerInfo[playerid][pMember] == 0) {
SendClientMessage(playerid,COLOR_GRAD3,"[INFO]: You Don't have enough Cash for that item!");
return 1;
}
else if(PlayerInfo[playerid][pLevel] < 2 && PlayerInfo[playerid][pMember] >= 7 || PlayerInfo[playerid][pLevel] < 2 && PlayerInfo[playerid][pMember] == 0) {
SendClientMessage(playerid,COLOR_GRAD3,"[INFO]: You are not level 2 !");
return 1;
}
PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-maskp;
SendClientMessage(playerid,COLOR_GRAD3,"[INFO]: You have bought a Mask, You can use /mask.");
PlayerInfo[playerid][pMask] = 1;
return 1;
}
else if(SelectedItem[playerid] == 4) {
// watch
if(GetPlayerPCash(playerid)<watchp) {
SendClientMessage(playerid,COLOR_GRAD3,"[INFO]: You Don't have enough Cash for that item!");
return 1;
}
PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-watchp;
SendClientMessage(playerid,COLOR_GRAD3,"[INFO]: You have bought a Watch, You can now use /time.");
PlayerInfo[playerid][pWatch] = 1;
return 1;
}
else if(SelectedItem[playerid] == 5) {
// Walkie Talkie
if(GetPlayerPCash(playerid)<radiop) {
SendClientMessage(playerid,COLOR_GRAD3,"[INFO]: You Don't have enough Cash for that item!");
return 1;
}
PlayerInfo[playerid][pWalkie] = 1;
PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-radiop;
SendClientMessage(playerid,COLOR_GRAD3,"[INFO]: You have bought a Radio, Use /setfreq and /r!");
return 1;
}
else if(SelectedItem[playerid] == 6) {
// Spray Can
if(GetPlayerPCash(playerid)<pepperp) {
SendClientMessage(playerid,COLOR_GRAD3,"[INFO]: You Don't have enough Cash for that item!");
return 1;
}
PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-pepperp;
SendClientMessage(playerid,COLOR_GRAD3,"[INFO]: You have bought a Pepper Spray.");
GivePlayerWeaponEx(playerid,41,100);
return 1;
}
else if(SelectedItem[playerid] == 7) {
// SPrunk Can
if(GetPlayerPCash(playerid)<sprunkp) {
SendClientMessage(playerid,COLOR_GRAD3,"[INFO]: You Don't have enough Cash for that item!");
return 1;
}
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DRINK_SPRUNK);
PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-sprunkp;
SendClientMessage(playerid,COLOR_GRAD3,"[INFO]: You have bought a sprunk can.");
return 1;
}
else if(SelectedItem[playerid] == 8) {
// Rope
if(GetPlayerPCash(playerid)<ropep) {
SendClientMessage(playerid,COLOR_GRAD3,"[INFO]: You Don't have enough Cash for that item!");
return 1;
}
PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-ropep;
Rope[playerid] = 1;
SendClientMessage(playerid,COLOR_GRAD3,"[INFO]: You have bought a Rope, You can use [/tie] now.");
return 1;
}
else if(SelectedItem[playerid] == 9) {
// Rag
if(GetPlayerPCash(playerid)<blindfoldp) {
SendClientMessage(playerid,COLOR_GRAD3,"[INFO]: You Don't have enough Cash for that item!");
return 1;
}
PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-blindfoldp;
BlindFold[playerid] = 1;
SendClientMessage(playerid,COLOR_GRAD3,"[INFO]: You have bought a Rag, You can use [/blindfold] now.");
return 1;
}
else if(SelectedItem[playerid] == 10) {
// Smokes
if(GetPlayerPCash(playerid)<cigp) {
SendClientMessage(playerid,COLOR_GRAD3,"[INFO]: You Don't have enough Cash for that item!");
return 1;
}
PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-cigp;
PlayerInfo[playerid][pCigs] = 10;
SendClientMessage(playerid,COLOR_GRAD3,"[INFO]: You have bought a 10 Pack of Cigarettes, You can use /smoke.");
return 1;
}
else if(SelectedItem[playerid] == 11) {
// Lighter
if(GetPlayerPCash(playerid)<lighterp) {
SendClientMessage(playerid,COLOR_GRAD3,"[INFO]: You Don't have enough Cash for that item!");
return 1;
}
PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-lighterp;
PlayerInfo[playerid][pLighter] = 20;
SendClientMessage(playerid,COLOR_GRAD3,"[INFO]: You have bought a Lighter.");
return 1;
}
else if(SelectedItem[playerid] == 12) {
// Roller Skates
if(GetPlayerPCash(playerid)<skatep) {
SendClientMessage(playerid,COLOR_GRAD3,"[INFO]: You Don't have enough Cash for that item!");
return 1;
}
PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-skatep;
PlayerInfo[playerid][pSkate] = 1;
SendClientMessage(playerid,COLOR_GRAD3,"[INFO]: You can now use /skate.");
return 1;
}
else if(SelectedItem[playerid] == 13) {
// ToolKit
if(GetPlayerPCash(playerid) < toolkitp) {
SendClientMessage(playerid,COLOR_GRAD3,"[INFO]: You Don't have enough Cash for that item!");
return 1;
}
PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-toolkitp;
PlayerInfo[playerid][pToolkit] = 1;
SendClientMessage(playerid,COLOR_GRAD3,"[INFO]: You can now use /engine to rob a vehicle.");
return 1;
}
else if(SelectedItem[playerid] == 14) {
// Cell Phone
if(GetPlayerPCash(playerid)<cellphonep) {
SendClientMessage(playerid,COLOR_GRAD3,"[INFO]: You Don't have enough Cash for that item!");
return 1;
}
else if(PlayerInfo[playerid][pCellphone] == 1) {
SendClientMessage(playerid,COLOR_GRAD3,"[INFO]: You already have a cellphone, You don't need two.");
return 1;
}
PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-cellphonep;
PlayerInfo[playerid][pCellphone] = 1;
SendClientMessage(playerid,COLOR_GRAD3,"[INFO]: You have bought a cellphone. [/help] for commands!");
return 1;
}
}
}
}