Can't fix tag missmatch
#1

I got an include for missions in my own script. I use it to create ambulance missions. Here are the things I defined:
Код:
enum AmbulanceMissionInfo
{
	MissionName[200],
	bool:UseTrailerCheck,
	MissionPay,
	Float:loadx,
	Float:loady,
	Float:loadz,
	Float:unloadx,
	Float:unloady,
	Float:unloadz
}

new AmbulanceMissionRandom[][AmbulanceMissionInfo] =
{
	{"-location name-", false, 1500, 383.7271,-2032.1228,7.8359, 2034.2332,-1412.2445,16.9922}
};

enum AmbulanceMissionNames
{
	MissionNameStart[200]
}

new AmbulanceMissionBegin[][AmbulanceMissionInfo] =
{
	{"disease name here-"}
};
Here is my /work command:

Код:
if (pvehiclemodel == 416) //if vehicle = ambulance
{
     new string[200];
     new rand = random(sizeof(AmbulanceMissionRandom));
     new NameRand = random(sizeof(AmbulanceMissionBegin));
     CreatePlayerMission(playerid, AmbulanceMissionRandom[rand][UseTrailerCheck], AmbulanceMissionRandom[rand][MissionPay], AmbulanceMissionRandom[rand][loadx],AmbulanceMissionRandom[rand][loady], AmbulanceMissionRandom[rand][loadz], AmbulanceMissionRandom[rand][unloadx],AmbulanceMissionRandom[rand][unloady], AmbulanceMissionRandom[rand][unloadz]);
     format(string, sizeof(string),"{FF3F3F}Reporting {FFFFFF}%s{FF3F3F} at {FFFFFF}%s{FF3F3F} ! Go and help him, then bring him to the hospital", AmbulanceMissionBegin[NameRand][MissionNameStart], AmbulanceMissionRandom[rand][MissionName]);
     SendClientMessage(playerid, 0x00FF00FF, string);
     return 1;
}
So when I type /work the script takes a random load and unload location and a random disease and prints "Reporting -disease- at -location-. Go and help [...]
But the compiler says there is a tag missmatch in this line:
Код:
format(string, sizeof(string),"{FF3F3F}Reporting {FFFFFF}%s{FF3F3F} at {FFFFFF}%s{FF3F3F} ! Go and help him, then bring him to the hospital", AmbulanceMissionBegin[NameRand][MissionNameStart], AmbulanceMissionRandom[rand][MissionName]);
wich leads to a wrong execution of the command.
Maybe I'm too dumb or just blind, but I am a beginner
Would be nice if someone could give me a solution/hint

MissionNameStart = disease (eg. "man with broken leg")
MissionName = name of location (eg. "Dillimore")
Reply
#2

This won't stay, this is only one string so make it smaller and clearer for the forums (posting all 78 lines of mission names is useless)

Thanks anyways
Reply
#3

Ok I found the mistake:

Код:
enum AmbulanceMissionNames
{
	MissionNameStartAmbulance[200]
}

new AmbulanceMissionBegin[][AmbulanceMissionInfo] =
{
	{"an old man with a heart attack"},
	{"a woman with a food poisoning"},
    {"a little boy with a sprained arm"},
    {"an old woman with a stroke"},
    {"a man with a broken arm"},
    {"a pregnant woman with birth pangs"},
    {"a man with nosebleeds"},
    {"a little girl with a broken finger"},
    {"a teenager with an alcohol poisoning"},
    {"a hobo with ear bleedings"}
};
AmbulanceMissionInfo is for the location names, not for disease names.
I changed
Код:
new AmbulanceMissionBegin[][AmbulanceMissionInfo] =
into
Код:
new AmbulanceMissionBegin[][AmbulanceMissionNames] =
and now it works

Thank you for your help ******
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)