Random mission error
#1

My codes:
Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 519 || 511 || 520)
	{

            MissionStatus[playerid] = 1;
            new MisRand = random(sizeof(MisLocations));
            new LoadText[128], Float:x, Float:y, Float:z;
            x = MisLocations[MisRand][LoadX];
            y = MisLocations[MisRand][LoadY];
            z = MisLocations[MisRand][LoadZ];
            unx[playerid] = MisLocations[MisRand][UnloadX];
            uny[playerid] = MisLocations[MisRand][UnloadY];
            unz[playerid] = MisLocations[MisRand][UnloadZ];
            iPay[playerid] = MisLocations[MisRand][Pay];
            SetPlayerCheckpoint(playerid, x, y, z, 7);
            format(LoadText, 128, "%s",MisLocations[MisRand][LoadName]);
            SendClientMessage(playerid, COLOR_GREEN, "Mission:");
            SendClientMessage(playerid, COLOR_GREEN, "_____________________");
            SendClientMessage(playerid, COLOR_GREEN, "");/
            SendClientMessage(playerid, 0xFFFFFFFF, LoadText);
            SendClientMessage(playerid, COLOR_GREEN, "_____________________");
			SendClientMessage(playerid,-1,"Must use /work to start the mission");
	}
	return 0;
}
Error:
Код:
D:\Trucking\filterscripts\123.pwn(61) : error 017: undefined symbol "MissionStatus"
D:\Trucking\filterscripts\123.pwn(61) : warning 215: expression has no effect
D:\Trucking\filterscripts\123.pwn(61) : error 001: expected token: ";", but found "]"
D:\Trucking\filterscripts\123.pwn(61) : error 029: invalid expression, assumed zero
D:\Trucking\filterscripts\123.pwn(61) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#2

What i have to do?
Reply
#3

Top of your script:

pawn Код:
new MissionStatus[MAX_PLAYERS];
Don't forget to set it to 0 when a player disconnects.
Reply
#4

Getting this errors:
Код:
D:\Trucking\filterscripts\123.pwn(68) : error 017: undefined symbol "unx"
D:\Trucking\filterscripts\123.pwn(68) : warning 215: expression has no effect
D:\Trucking\filterscripts\123.pwn(68) : error 001: expected token: ";", but found "]"
D:\Trucking\filterscripts\123.pwn(68) : error 029: invalid expression, assumed zero
D:\Trucking\filterscripts\123.pwn(68) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#5

Lines?
Reply
#6

well the error in the 68 no line and its:

Код:
unx[playerid] = MisLocations[MisRand][UnloadX];
and my script:
Код:
new IsPlayerInMission[MAX_PLAYERS];
new MissionStatus[MAX_PLAYERS];

enum MisLocationsEnum
{
    ID,
    LoadName[128],
    Float:LoadX,
    Float:LoadY,
    Float:LoadZ,
    Float:UnloadX,
    Float:UnloadY,
    Float:UnloadZ,
    Pay
}
new MisLocations[][MisLocationsEnum] =
{
    {0, "Lva to Lsa",1566.0441,1505.7729,10.8382,1562.4001,-2414.3513,13.5547, 5980},
    {1, "Lsa to SFA",1562.4001,-2414.3513,13.5547,1097.5164,1741.7422,10.5474, 5700},
    {2, "Sfa to Lsa",-1301.9893,-347.4291,14.1484,1097.5164,1741.7422,10.5474, 3000},
    {3, "Sfa to Lva",-1301.9893,-347.4291,14.1484,1566.0441,1505.7729,10.8382, 18770}//The last one in the array doesn't have a comma at the end.
};
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if(!strcmp("/work", cmdtext, true))
	{
		new pvehiclemodel = GetVehicleModel(GetPlayerVehicleID(playerid));
		if(IsPlayerInMission[playerid] >= 1)return SendClientMessage(playerid,-1,"You already have a mission!");
		if (pvehiclemodel == 520 || pvehiclemodel == 511 || pvehiclemodel == 519)
		{
			PilotJob[playerid] = 1;
			SetPlayerCheckpoint(playerid, -1301.9893,-347.4291,14.1484,40.0);
			SendClientMessage(playerid, -1,"~g~Info: ~w~Mission started! Please follow the check point!");
			GameTextForPlayer(playerid,"~w~Mission~g~Started!", 3000, 3);
			return 1;
		}
		SendClientMessage(playerid, -1,"{CE0000}You have to be on a plane to start the job!");
	}
	return 0;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 519 || 511 || 520)
	{

            MissionStatus[playerid] = 1;
            new MisRand = random(sizeof(MisLocations));
            new LoadText[128], Float:x, Float:y, Float:z;
            x = MisLocations[MisRand][LoadX];
            y = MisLocations[MisRand][LoadY];
            z = MisLocations[MisRand][LoadZ];
            unx[playerid] = MisLocations[MisRand][UnloadX];
            uny[playerid] = MisLocations[MisRand][UnloadY];
            unz[playerid] = MisLocations[MisRand][UnloadZ];
            iPay[playerid] = MisLocations[MisRand][Pay];
            SetPlayerCheckpoint(playerid, x, y, z, 7);
            format(LoadText, 128, "%s",MisLocations[MisRand][LoadName]);
            SendClientMessage(playerid, COLOR_GREEN, "Mission:");
            SendClientMessage(playerid, COLOR_GREEN, "_____________________");
            SendClientMessage(playerid, COLOR_GREEN, "");/
            SendClientMessage(playerid, 0xFFFFFFFF, LoadText);
            SendClientMessage(playerid, COLOR_GREEN, "_____________________");
			SendClientMessage(playerid,-1,"Must use /work to start the mission");
	}
	return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)