Pawn compiler crashes with no error log
#5

Compare numbers is:
pawn Код:
new num1;
if(num1 == 20)
{

}
Fixed
pawn Код:
#include <a_samp>

new druggate1;
new druggate2;
forward PlayerToPoint (Float:radi, playerid, Float:x, Float:y, Float:z);
new mState1;
new mState2;
new drugsfill;
new truck1full;
new truck2full;
new truck3full;
/*new Truck1;
new Truck2;
new Truck3; */

new PickUpD;
//
new PlayerDrugs[MAX_PLAYERS];
#define FILTERSCRIPT

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Heroin Trucker Job");
    print("--------------------------------------\n");
    druggate1 = CreateObject(969,2720.201,-2409.661,12.628,0.0,0.0,90.000); // GATE1 ZU
    druggate2 = CreateObject(969,2720.123,-2508.319,12.651,0.0,0.0,90.000); // GATE2 ZU
    CreateObject(3749,2719.640,-2503.652,18.042,0.0,0.0,-90.000);
    CreateObject(3749,2720.553,-2404.958,18.544,0.0,0.0,-270.000);
    CreateObject(1523,2747.836,-2452.013,12.702,0.0,0.0,0.0);
    CreateObject(1523,2792.877,-2395.778,12.620,0.0,0.0,0.0);
    PickUpD = AddStaticPickup(1239,2,1235.779,-1459.302,13.387); // Deliver Point / Buy Point
    return 1;
}


public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
    new Float:oldposx, Float:oldposy, Float:oldposz;
    new Float:tempposx, Float:tempposy, Float:tempposz;
    GetPlayerPos(playerid, oldposx, oldposy, oldposz);
    tempposx = (oldposx -x);
    tempposy = (oldposy -y);
    tempposz = (oldposz -z);
    if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
    {
        return 1;
    }
    return 0;
}
//
public OnFilterScriptExit()
{
    return 1;
}

#else

main()
{
    print("\n----------------------------------");
    print(" Created By BlackFoX. For Bug Contact me ICQ 480 814 388");
    print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    return 1;
}

public OnPlayerRequestSpawn(playerid)
{
    return 1;
}

public OnPlayerConnect(playerid)
{
    PlayerDrugs[playerid] = 0;
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    return 1;
}

public OnPlayerSpawn(playerid)
{
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    return 1;
}

public OnVehicleSpawn(vehicleid)
{
    return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
    return 1;
}

public OnPlayerText(playerid, text[])
{
    return 1;
}


public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/openheroin", cmdtext, true, 10) == 0)
    {
        if(PlayerToPoint(8.0,playerid,2720.201,-2409.661,12.628))
        {
            if(mState1 == 0)
            {
                mState1 = 1;
                MoveObject(druggate1,2720.158,-2397.089,14.136,7);
            }
            else
            {
                mState1 = 0;
                MoveObject(druggate1,2720.201,-2409.661,12.628,7);
            }
        }
        else
        {
            ErrorMsg(playerid,"you to Far away from the Object!( Gate 1 )");
        }
        if(PlayerToPoint(8.0,playerid,2720.123,-2508.319,12.651))
        {
            if(mState2 == 0)
            {
                mState2 = 1;
                MoveObject(druggate2,2720.160,-2495.633,14.160,7);
            }
            else
            {
                mState2 = 0;
                MoveObject(druggate2,2720.123,-2508.319,12.651,7);
            }
        }
        else
        {
            ErrorMsg(playerid,"you to Far away from the Object!( Gate 2 )");
        }
        return 1;
    }
    if (strcmp("/deliverheroin", cmdtext, true, 10) == 0)
    {
        if(PlayerToPoint(8.0,playerid,1235.779,-1459.302,13.387))
        {
            if(drugsfill >= 30)
            {
                GameTextForPlayer(playerid,"~r~Crack Hole is Full",2000,1);
                return 1;
            }
            if(GetVehicleModel(GetPlayerVehicleID(playerid))==403)
            {
                if(truck1full == 1)
                {
                    truck1full = 0;
                    drugsfill +=3;
                    GivePlayerMoney(playerid,5000);
                    GameTextForPlayer(playerid,"~b~Drug ~g~Delivered",2000,1);
                }
                else
                {
                    GameTextForPlayer(playerid,"~r~Empty Truck",2000,1);
                }
            }
            if(GetVehicleModel(GetPlayerVehicleID(playerid))==514)
            {
                if(truck2full == 1)
                {
                    if(drugsfill >= 30)
                    {
                        GameTextForPlayer(playerid,"~r~Crack Hole is Full",2000,1);
                        return 1;
                    }
                    truck2full = 0;
                    drugsfill +=3;
                    GivePlayerMoney(playerid,5000);
                    GameTextForPlayer(playerid,"~b~Drug ~g~Delivered",2000,1);
                }
                else
                {
                    GameTextForPlayer(playerid,"~r~Empty Truck",2000,1);
                }
            }
            if(GetVehicleModel(GetPlayerVehicleID(playerid))==515)
            {
                if(truck3full == 1)
                {
                    if(drugsfill >= 30)
                    {
                        GameTextForPlayer(playerid,"~r~Crack Hole is Full",2000,1);
                        return 1;
                    }
                    truck3full = 0;
                    drugsfill +=3;
                    GivePlayerMoney(playerid,5000);
                    GameTextForPlayer(playerid,"~b~Drug ~g~Delivered",2000,1);
                }
                else
                {
                    GameTextForPlayer(playerid,"~r~Empty Truck",2000,1);
                }
            }
        }
        else
        {
            ErrorMsg(playerid,"you not at Deliver Point!");
        }
        return 1;
    }
   
   
    if (strcmp("/loadheroin", cmdtext, true, 10) == 0)
    {
        if(PlayerToPoint(8.0,playerid,2781.691,-2417.481,13.885) || PlayerToPoint(8.0,playerid,2783.471,-2456.323,13.885) || PlayerToPoint(8.0,playerid,2781.773,-2494.225,13.908))
        {
            if(GetVehicleModel(GetPlayerVehicleID(playerid))==403)
            {
                if(truck1full == 0)
                {
                    truck1full = 1;
                    GivePlayerMoney(playerid, -2000);
                    SendClientMessage(playerid,0x00DC00F6,"Drugs Loaded. 3/3 Slots Full");
                }
                else
                {
                    SendClientMessage(playerid,0xB30000F6,"Truck allready Loaded!");
                }
            }
            if(GetVehicleModel(GetPlayerVehicleID(playerid))==514)
            {
                if(truck2full == 0)
                {
                    truck2full = 1;
                    GivePlayerMoney(playerid, -2000);
                    SendClientMessage(playerid,0x00DC00F6,"Drugs Loaded. 3/3 Slots Full");
                }
                else
                {
                    SendClientMessage(playerid,0xB30000F6,"Truck allready Loaded!");
                }
            }
            if(GetVehicleModel(GetPlayerVehicleID(playerid))==515)
            {
                if(truck3full == 0)
                {
                    truck3full = 1;
                    GivePlayerMoney(playerid, -2000);
                    SendClientMessage(playerid,0x00DC00F6,"Drugs Loaded. 3/3 Slots Full");
                }
                else
                {
                    SendClientMessage(playerid,0xB30000F6,"Truck allready Loaded!");
                }
            }
        }
        else
        {
            ErrorMsg(playerid,"you Cant Load Drugs at this Place!");
        }
        return 1;
    }
   
    if (strcmp("/heroin", cmdtext, true, 10) == 0)
    {
        new DFormat[256];
        SendClientMessage(playerid,0xE5F600F6,"-========DRUGS=======-");
        format(DFormat,sizeof(DFormat),"-= Drug Packs %d    =-", PlayerDrugs[playerid]);
        SendClientMessage(playerid,0xE56D00F6,DFormat);
        SendClientMessage(playerid,0xE5F600F6,"-====================-");
        return 1;
    }
    if (strcmp("/buyheroin", cmdtext, true, 10) == 0)
    {
        if(PlayerToPoint(8.0,playerid,1235.779,-1459.302,13.387))
        {
            if(drugsfill <=2) { GameTextForPlayer(playerid,"~r~The Drugs Empty Please Deliver First!",2000,1); return 1; }
            if(PlayerDrugs[playerid] >=2)
            {
                ErrorMsg(playerid,"you can only buy 3 Packs!");
                return 1;
            }
            PlayerDrugs[playerid] +=3;
            GivePlayerMoney(playerid,-500);
            GameTextForPlayer(playerid,"~b~You buy 3 Drug Packs you can use /takeheroin",2000,1);
        }
        else
        {
            ErrorMsg(playerid,"you to Far away from Drugs Buy/deliver Place!");
        }
        return 1;
    }
   
    if (strcmp("/takeheroin", cmdtext, true, 10) == 0)
    {
        if(PlayerDrugs[playerid] == 0) { GameTextForPlayer(playerid,"~r~You dont have Drugs",2000,1); return 1; }
        new Float:px, Float:py, Float:pz;
        GetPlayerPos(playerid,px,py,pz);
        CreatePickup(1241,3,px,py,pz);
        GameTextForPlayer(playerid,"~r~You Take Drugs",2000,1);
        PlayerDrugs[playerid] -=1;
        return 1;
    }
    return 0;
}

stock ErrorMsg(playerid, const string[])
{
    new a[24];
    GetPlayerName(playerid,a,sizeof(a));
    new ErrorFormat[128];
    format(ErrorFormat,sizeof(ErrorFormat),"ERROR: %s %s",a,string);
    return SendClientMessage(playerid,0xF60000F6,ErrorFormat);
}


public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
    return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 403)
    {
        GameTextForPlayer(playerid,"~b~Use /loaddheroin in Truck Garage",2000,1);
    }
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 514)
    {
        GameTextForPlayer(playerid,"~b~Use /loadheroin in Truck Garage",2000,1);
    }
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 515)
    {
        GameTextForPlayer(playerid,"~b~Use /loadheroin in Truck Garage",2000,1);
    }
    return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
    return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
    return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
    return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
    return 1;
}

public OnRconCommand(cmd[])
{
    return 1;
}

public OnObjectMoved(objectid)
{
    return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == PickUpD)
    {
        GameTextForPlayer(playerid,"~b~Use /buyheroin or /deliverheroin",2000,1);
    }
    return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
    return 1;
}

public OnPlayerExitedMenu(playerid)
{
    return 1;
}
Reply


Messages In This Thread
Pawn compiler crashes with no error log - by milanosie - 04.01.2012, 17:53
Re: Pawn compiler crashes with no error log - by Outcast - 05.01.2012, 04:36
Re: Pawn compiler crashes with no error log - by James Coral - 05.01.2012, 04:46
Respuesta: Pawn compiler crashes with no error log - by Vladeksh - 05.01.2012, 04:47
Re: Pawn compiler crashes with no error log - by [O.z]Caroline - 05.01.2012, 04:52

Forum Jump:


Users browsing this thread: 1 Guest(s)