01.10.2011, 18:50
hi, I made my first enum ever...
an enum to easly make missions in my script, instead of adding 50 lines per mission, I try to do it with maybe 5 lines per mission...
anyways this is what I have:
ok, so I did not try to make extremely hard functions at the beginning, just some easy stuff to test if I fully understand the way to use this stuff...
ok so the little test code:
Ok, I compile, and get no errors, so I think that I'm on the good way
but when I go in game i get the following message when I type /mission1
C
CCC
so that means that my first string returned as C
and the second as CCC
... I have no Idea why it gets C...
and why it does not do what it should do...
Thanks in advance
an enum to easly make missions in my script, instead of adding 50 lines per mission, I try to do it with maybe 5 lines per mission...
anyways this is what I have:
pawn Code:
enum DMissions
{
mission_name[200],
person_name[200],
pick_place[50],
deliver_place[50],
mission_type,
Float:pick_x,
Float:pick_y,
Float:pick_z,
Float:deliver_x,
Float:deliver_y,
Float:deliver_z
};
new Mission[6][DMissions]=
{
//==============================================================================
//Mission TYPE 1
//==============================================================================
{"Travis Pastrana Is Going to participate the X-games", "Travis Pastrana", "The Hollywood Hotel", "The Stadium", 1, \
334.4390,-1519.8026,35.7015,
2732.6616,-1841.6346,9.9145},
{"Chris Martin is back from his smash concert in the Stadium VIVA LA VIDA man!", "Chris Martin", "The Stadium", "Chris Martin's Hotel", 1, \
2732.6616,-1841.6346,9.9145,
1737.9714,-1270.4094,13.5441},
//==============================================================================
//Mission TYPE 2
//==============================================================================
{"The Pope has a meeting with Barack Obama", "The Pope", "The Airport", "The White House", 2, \
1682.4960,-2290.7954,13.0821,
1122.9896,-2036.9480,69.8938},
{"Herman Van Rompuy, President of Europe has a meeting with Barack Obama", "Herman Van Rompuy", "The Airport", "The White House", 2, \
1682.4960,-2290.7954,13.0821,
1122.9896,-2036.9480,69.8938},
//==============================================================================
//Mission TYPE 3
//==============================================================================
{"Barack Obama has arrived from his trip to Mexico", "Barack Obama", "The Airport", "The White House", 3, \
1682.4960,-2290.7954,13.0821,
1122.9896,-2036.9480,69.8938},
{"Rob Dyredek has arrived at the airport", "Rob Dyredek", "The Airport", "Dyrdek's House", 3, \
1682.4960,-2290.7954,13.0821,
974.4201,-819.5055,96.6825}
};
ok so the little test code:
pawn Code:
if (strcmp("/mission1", cmdtext, true) == 0)
{
new
string[200],
mName = Mission[1][mission_name],
mPName = Mission[1][person_name];
format(string,sizeof(string),"%s",mName);
SendClientMessage(playerid, COLOR_YELLOW_LABEL, string);
format(string,sizeof(string),"%s",mPName);
SendClientMessage(playerid, COLOR_YELLOW_LABEL, string);
return 1;
}
but when I go in game i get the following message when I type /mission1
C
CCC
so that means that my first string returned as C
and the second as CCC
... I have no Idea why it gets C...
and why it does not do what it should do...
Thanks in advance