warning C4700

npc->setStyle(eyes[20000]);}
if(random == 2){
npc->setStyle(eyes[20001]);}
if(random == 3){
npc->setStyle(eyes[20002]);}
if(random == 4){
npc->setStyle(eyes[20003]);}
if(random == 5){
npc->setStyle(eyes[20004]);}
if(random == 6){
npc->setStyle(eyes[20006]);}
if(random == 7){
npc->setStyle(eyes[20007]);}
if(random == 8){
npc->setStyle(eyes[20008]);}
if(random == 9){
npc->setStyle(eyes[20012]);}
if(random == 10){
npc->setStyle(eyes[20013]);}
npc->end();
}
else{
npc->addText("Hmm ... it looks like you don't have the coupon specifically for this place...sorry to say this, but without the coupon, there's no plastic surgery for you.");
npc->sendNext();
npc->end();
}
}
else{
npc->addText("I see ... take your time, see if you really want it. Let me know when you make up your mind");
npc->sendNext();
npc->end();
}
}
}

//Franz the owner
//Written by Goofy of OdinMS
//Please give me credits if you use this. Nobody likes a thief.
void NPCsScripts::npc_2010002(NPC* npc){
int eyes[] = {20000, 20001, 20002, 20004, 20005, 20006, 20007, 20008, 20009, 20010};
int state = npc->getState();
if(state == 0){
npc->addText("Well well well, welcome!! I can totally transform your face into something new.... How about giving us a try? ");
npc->addText("For the #bOrbis Face Coupon (VIP)#k, you can get the face of your liking. Take your time in choosing the face of your preference.");
npc->addText("....");
npc->sendStyle(eyes, 10);
}
if(state == 1){
if(npc->getItemNum(5152005) >= 1){
npc->giveItem(5152005, -1);
npc->setStyle(eyes[npc->getSelected()]);
npc->end();
}
else{
npc->addText("Hmm ... it looks like you don't have the coupon specifically for this place...sorry to say this, but without the coupon, there's no plastic surgery for you.");
npc->sendNext();
npc->end();
显示 使用未初始化的局部变量 eyes

这个怎么解决

第1个回答  2008-05-07
问题讲明白点,兄弟

int eyes[] = {20000, 20001, 20002, 20004, 20005, 20006, 20007, 20008, 20009, 20010};
这表示定义一个有10个数的数组,内容分别是20000,20001.......,但是你怎么引用的eyes[20000]是什么啊,eyes这个数组总共就10个数,下标是0~9,eyes[20000]表示引用第20001个数,这明显不对了啊

相关了解……

你可能感兴趣的内容

大家正在搜

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网