10.11.2009, 20:08
Ok when i compile my dialog 24-7 thing its doesnt respond heres ma code
Код:
//---------------------------<[ OnDialogResponse ]>-------------------------------------------------------- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid==1337) //This is our Dialog ID as shown in the command { switch(pPurchasingItem[playerid]) { case ITEM_NONE: //This is the Dialog with the purchasing list, remember we set pPurchasingItem[playerid] to ITEM_NONE? this is why { if(!strcmp(inputtext,"Cell Phone",true)) //It's like commands, if the player chose the line with 'Cell Phone', then this is ran { pPurchasingItem[playerid]=ITEM_CELL_PHONE; //Now we're setting pPurchasingItem[playerid] to ITEM_CELL_PHONE for obvious reasons! ShowPlayerDialog(playerid,1337,DIALOG_STYLE_MSGBOX,"Purchase?","Purchase the Cell Phone for $150?","Yes","Nevermind"); return 1; } if(!strcmp(inputtext,"Scratch Card",true)) //Scratch Card { //ShowPlayerDialog(playerid,1337,DIALOG_STYLE_MSGBOX,"Purchase?","","Yes","Nevermind"); //Finish the rest yourself pPurchasingItem[playerid]=ITEM_SCRATCH_CARD; return 1; } } case ITEM_CELL_PHONE: //The player is on the ITEM_CELL_PHONE Dialog now. { if(response) //if(Player Hits "Yes" Button) { //Check to see if player has enough money ($150) if(GetPlayerMoney(playerid)<150)return SendClientMessage(playerid,COLOR_GRAD2,"You do not have enough money!"); //THIS CODE IS TAKEN DIRECTLY FROM THE ORIGINAL COMMAND, IT SHOULD BE EASY ENOUGH FOR YOU TO CREATE THE REST!! if(PlayerInfo[playerid][pTraderPerk] > 0) { new skill = 150 / 100; new price = (skill)*(PlayerInfo[playerid][pTraderPerk]); new payout = 150 - price; format(string, sizeof(string), "~r~-$%d", payout); GameTextForPlayer(playerid, string, 5000, 1); SafeGivePlayerMoney(playerid,- payout); SBizzInfo[9][sbTill] += payout; ExtortionSBiz(9, payout); } else { format(string, sizeof(string), "~r~-$%d", 150); GameTextForPlayer(playerid, string, 5000, 1); SafeGivePlayerMoney(playerid,-150); SBizzInfo[9][sbTill] += 150; ExtortionSBiz(9, 150); } PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); new randphone = 100000 + random(899999);//minimum 1000 max 9999 PlayerInfo[playerid][pPnumber] = randphone; format(string, sizeof(string), " Mobile Phone Purchased your new Number is %d", randphone); SendClientMessage(playerid, COLOR_GRAD4, string); SendClientMessage(playerid, COLOR_GRAD5, "You can check this anytime by Typing /stats"); SendClientMessage(playerid, COLOR_WHITE, "HINT: You can now type /help to see your cell phone commands."); }else{ //Else Player Hits "NeverMind" Button return SendClientMessage(playerid,COLOR_GRAD2,"Purchase canceled."); } } case ITEM_SCRATCH_CARD: { if(response) { }else{ } } } return 1; } return 0; } new sendername[MAX_PLAYER_NAME]; new string[128]; if(response) { if(dialogid == 12346 || dialogid == 12347) { if(strlen(inputtext)) { new tmppass[64]; strmid(tmppass, inputtext, 0, strlen(inputtext), 255); Encrypt(tmppass); OnPlayerLogin(playerid,tmppass); } else { new loginstring[128]; new loginname[64]; GetPlayerName(playerid,loginname,sizeof(loginname)); format(loginstring,sizeof(loginstring),"WRONG PASSWORD\nPlease enter the correct password:",loginname); ShowPlayerDialog(playerid,12347,DIALOG_STYLE_INPUT,"Login",loginstring,"Login","Exit"); gPlayerLogTries[playerid] += 1; if(gPlayerLogTries[playerid] == 4) { Ban(playerid); } } } if(dialogid == 12345) { if(strlen(inputtext)) { GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "users/%s.ini", sendername); new File: hFile = fopen(string, io_read); if (hFile) { SendClientMessage(playerid, COLOR_YELLOW, "That Username is already taken, please choose a different one."); fclose(hFile); return 1; } new tmppass[64]; strmid(tmppass, inputtext, 0, strlen(inputtext), 255); Encrypt(tmppass); OnPlayerRegister(playerid,tmppass); } else { new regstring[128]; new regname[64]; GetPlayerName(playerid,regname,sizeof(regname)); format(regstring,sizeof(regstring),"Welcome, %s\nYou dont have an account.\nPlease register:",regname); ShowPlayerDialog(playerid,12345,DIALOG_STYLE_INPUT,"Register",regstring,"Register","Exit"); } } } else { Kick(playerid); } return 1; }