So what should I do?
Any help is much appreciated.
void main()
{
effect eRedLight = EffectVisualEffect(VFX_FNF_PWKILL);
effect eBluLight = EffectVisualEffect(VFX_FNF_TIME_STOP);
int iRace, iRDD, iPDK, i;
object oPC = GetLastUsedBy();
if (GetRacialType(oPC) == RACIAL_TYPE_HALFELF || RACIAL_TYPE_HALFORC)
{
SendMessageToPC(oPC, "Sorry your race is not allowed on this map. (Do not use Half-Orc or Half-Elf)");
ApplyEffectToObject(DURATION_TYPE_INSTANT, eRedLight, oPC);
iRace = 1;
}
else
{
i=0;
for (i=0; i<4; i++)
{
if(GetclassByPosition(i, oPC) == class_TYPE_DRAGON_DISCIPLE)
{
SendMessageToPC(oPC, "Sorry Red Dragon Disciples are not allowed on this map");
ApplyEffectToObject(DURATION_TYPE_INSTANT, eRedLight, oPC);
iRDD = 1;
}
else
{
if(GetclassByPosition(i, oPC) == class_TYPE_PURPLE_DRAGON_KNIGHT)
{
SendMessageToPC(oPC, "Sorry Purple Dragon Knights are not allowed on this map");
ApplyEffectToObject(DURATION_TYPE_INSTANT, eRedLight, oPC);
iPDK = 1;
}
}
}
}
if(iRace = 0)
{
if(iRDD = 0)
{
if(iPDK = 0)
{
ApplyEffectToObject(DURATION_TYPE_INSTANT, eBluLight, oPC);
object oPortal = GetWaypointByTag("portal");
location lPortal = GetLocation(oPortal);
AssignCommand(oPC, ActionJumpToLocation(lPortal));
}
}
}
}
A bit messy I know, but here's my slight dilemma: I created a human dragon disciple to test it out, and it still only displayed the incorrect race message.
Modifié par Dylmani555, 27 avril 2012 - 09:17 .
Modifié par GhostOfGod, 27 avril 2012 - 09:47 .
Dylmani555 wrote...
Well I made them completely seperate if statements.. and now, if I am not one of those 2 races or classes, nothing happens at all... Although thank you for that advice. It will help me in the future.. how many times can i do that in one if statement? could I make all 4 checks with 1 if statement by putting:
if(GetRacialType(oPC) != RACIAL_TYPE_HALFELF ||
GetRacialType(oPC) != RACIAL_TYPE_HALFORC ||
GetclassByPosition(1, oPC) != class_TYPE_DRAGONDISCIPLE ||
GetclassByPosition(2, oPC) != class_TYPE_DRAGONDISCIPLE ||
GetclassByPosition(3, oPC) != class_TYPE_DRAGONDISCIPLE ||
GetclassByPosition(1, oPC) != class_TYPE_PURPLE_DRAGON_KNIGHT ||
GetclassByPosition(2, oPC) != class_TYPE_PURPLE_DRAGON_KNIGHT ||
GetclassByPosition(3, oPC) != class_TYPE_PURPLE_DRAGON_KNIGHT)
{
//Teleport script here
}
? Or would that not work?
Dylmani555 wrote...
Yeah, it's just I'm trying to make this portal not work for Half orcs or half elves, or red dragon disciples or purple dragon knights, because they are not allowed on the map I'm making, due to the lore behind the map.
Okay thanks for the helpI think it should work now.
Modifié par Lightfoot8, 28 avril 2012 - 07:55 .
Modifié par Dylmani555, 28 avril 2012 - 07:53 .
Dylmani555 wrote...
Although I think it would be...
Modifié par Lightfoot8, 28 avril 2012 - 09:11 .