Something wrong with my mission script.
#1

Im developing a mission script for my server, and i cant even compile the darn thing because it crashes.

Heres the script (yes i stole sample mission from the truckign mission include)
pawn Код:
#include <a_samp>

enum PlayerMissionInfo
{
    Pay,
    Checkpoint,
    OnCheckpoint,
    Float:UnloadPos[3],
    TrailerVehId,
    VehicleId
}
new PlayerMissionData[MAX_PLAYERS][PlayerMissionInfo];

enum MissionInfo
{
    Info[200],
    Pay,
    Type,
    Float:LoadPos[3],
    Float:UnloadPos[3]
}
new MissionData[][MissionInfo] =
{
    {"Deliver Holy Water from LVA Freight to LVA Church", 1, 1701.9475, 940.5465, 10.8203, 1496.2524, 772.1427, 10.8203},
    {"Deliver Junk Car Parts from LVA Freight Depot to Shody Ottos", 1701.9475, 940.5465, 10.8203, 1727.6351, 1812.1750, 10.8203}
};

new Working[MAX_PLAYERS], String[500];

Stock StartWorking(playerid)
{
    if (Working[playerid] == 1) return SendClientMessage(playerid, 0xFF0000AA, "Your already on a route, so we cannot give you a new one!");
    new ID = random(sizeof(MissionData));
    new VehModel = GetVehicleModel(GetPlayerVehicleID(playerid));
    if(VehModel == 403 || VehModel == 514 || VehModel == 515)
    {
        if(MissionData[ID][Type] != 1) return StartWorking(playerid);
    }
    Working[playerid] = 1;
    PlayerMissionData[playerid][Pay] = MissionData[ID][Pay];
    return 1;
}
What about this is fucking up my pawno?

Like i said, its being developed, no where near done.
Reply
#2

Try commenting out parts of it until it's fixed. When it fixes, you know the last thing you commented out was causing the problem.
Reply
#3

well, idk, but I think that you have to use the define MAX_PLAYERS in the new MissionData[][MissionInfo]
A second thing is: how do you assign a value to the whole enum? I've never seen it before. Maybe that's your error, so try to fix it out.
Reply
#4

Edit - this was not the problem
Reply
#5

Can't you see that he didn't assign a length to the array in new MissionData[][MissionInfo] ?
Reply
#6

You've got a capital letter at the start of 'stock'

pawn Код:
Stock StartWorking(playerid) //change the uppercase S to a lowercase.
{
    if (Working[playerid] == 1) return SendClientMessage(playerid, 0xFF0000AA, "Your already on a route, so we cannot give you a new one!");
    new ID = random(sizeof(MissionData));
    new VehModel = GetVehicleModel(GetPlayerVehicleID(playerid));
    if(VehModel == 403 || VehModel == 514 || VehModel == 515)
    {
        if(MissionData[ID][Type] != 1) return StartWorking(playerid);
    }
    Working[playerid] = 1;
    PlayerMissionData[playerid][Pay] = MissionData[ID][Pay];
    return 1;
}
Yes, I tried placing an uppercase letter at the start of Stock in my script and it also crashed me. So it should solve your problem (hopefully).
Reply
#7

Quote:
Originally Posted by Haydz
Посмотреть сообщение
You've got a capital letter at the start of 'stock'

pawn Код:
Stock StartWorking(playerid) //change the uppercase S to a lowercase.
{
    if (Working[playerid] == 1) return SendClientMessage(playerid, 0xFF0000AA, "Your already on a route, so we cannot give you a new one!");
    new ID = random(sizeof(MissionData));
    new VehModel = GetVehicleModel(GetPlayerVehicleID(playerid));
    if(VehModel == 403 || VehModel == 514 || VehModel == 515)
    {
        if(MissionData[ID][Type] != 1) return StartWorking(playerid);
    }
    Working[playerid] = 1;
    PlayerMissionData[playerid][Pay] = MissionData[ID][Pay];
    return 1;
}
Yes, I tried placing an uppercase letter at the start of Stock in my script and it also crashed me. So it should solve your problem.
oh yeah I forgot.Hey man remember pawn is case sensitive.this is your problem.
Reply
#8

So what I said is wrong? I just wanna know if I was right.
Reply
#9

Quote:
Originally Posted by Haydz
Посмотреть сообщение
You've got a capital letter at the start of 'stock'

pawn Код:
Stock StartWorking(playerid) //change the uppercase S to a lowercase.
{
    if (Working[playerid] == 1) return SendClientMessage(playerid, 0xFF0000AA, "Your already on a route, so we cannot give you a new one!");
    new ID = random(sizeof(MissionData));
    new VehModel = GetVehicleModel(GetPlayerVehicleID(playerid));
    if(VehModel == 403 || VehModel == 514 || VehModel == 515)
    {
        if(MissionData[ID][Type] != 1) return StartWorking(playerid);
    }
    Working[playerid] = 1;
    PlayerMissionData[playerid][Pay] = MissionData[ID][Pay];
    return 1;
}
Yes, I tried placing an uppercase letter at the start of Stock in my script and it also crashed me. So it should solve your problem (hopefully).
/endtopic?
Reply
#10

Thanks a million haydz, +1
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)