Pawno Errors[Interior /enter & /exit]
#1

Well, i thought i was actually making progress until I compiled my script and it gave me 26 errors. Although its a lot, I don't think its big errors. Im posting the whole script so it can be easier for a good scripted to fix this.

http://pastebin.com/EaLwu9Sj

If anyone can fix this, that would be great!

Note: I dont want to change anything, i just want this fixed.

((also if anyone knows how to make it so the code actually shows up on the forum post please explain))

Thanks again.
Reply
#2

What are the errors..?
Reply
#3

You don`t have to return 5; and stuff in OnPlayerCommandText. You can either return 1 or 0 ... 1 if the command works and 0 if the command doesn`t, so you should return 1 after each command.

If you return 0, it`ll give you the "Unknown Command" thingy

To put the code in the forum, use [ pawn ]code here [ /pawn ] tag ... without spaces after and before [ ]
Reply
#4

Errors:

(239) : warning 202: number of arguments does not match definition
(239) : warning 202: number of arguments does not match definition
(316) : error 017: undefined symbol "Playerid"
(317) : warning 217: loose indentation
(320) : warning 217: loose indentation
(320) : error 029: invalid expression, assumed zero
(320) : error 004: function "OnVehicleMod" is not implemented
(325) : warning 225: unreachable code
(325) : error 029: invalid expression, assumed zero
(325) : error 004: function "OnVehiclePaintjob" is not implemented
(330) : warning 225: unreachable code
(330) : error 029: invalid expression, assumed zero
(330) : error 004: function "OnVehicleRespray" is not implemented
(335) : warning 225: unreachable code
(335) : error 029: invalid expression, assumed zero
(335) : error 004: function "OnPlayerSelectedMenuRow" is not implemented
(340) : warning 225: unreachable code
(340) : error 029: invalid expression, assumed zero
(340) : error 004: function "OnPlayerExitedMenu" is not implemented
(345) : warning 225: unreachable code
(345) : error 029: invalid expression, assumed zero
(345) : error 004: function "OnPlayerInteriorChange" is not implemented
(350) : warning 225: unreachable code
(350) : error 029: invalid expression, assumed zero
(350) : error 004: function "OnPlayerKeyStateChange" is not implemented
(355) : warning 225: unreachable code
(355) : error 029: invalid expression, assumed zero
(355) : error 004: function "OnRconLoginAttempt" is not implemented
(360) : warning 225: unreachable code
(360) : error 029: invalid expression, assumed zero
(360) : error 004: function "OnPlayerUpdate" is not implemented
(363) : error 001: expected token: ")", but found "{"
(369) : warning 225: unreachable code
(369) : error 029: invalid expression, assumed zero
(369) : error 004: function "OnPlayerStreamIn" is not implemented
(374) : warning 225: unreachable code
(374) : error 029: invalid expression, assumed zero
(374) : error 004: function "OnPlayerStreamOut" is not implemented
(379) : warning 225: unreachable code
(379) : error 029: invalid expression, assumed zero
(379) : error 004: function "OnVehicleStreamIn" is not implemented

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


26 Errors.
Reply
#5

Quote:
Originally Posted by antonio112
Посмотреть сообщение
You don`t have to return 5; and stuff in OnPlayerCommandText. You can either return 1 or 0 ... 1 if the command works and 0 if the command doesn`t, so you should return 1 after each command.

If you return 0, it`ll give you the "Unknown Command" thingy

To put the code in the forum, use [ pawn ]code here [ /pawn ] tag ... without spaces after and before [ ]
I have a hard time with this, would you mind doing it and then I can look and try to see if I understand what you did?
Reply
#6

Well, the first error, line 239:
IsPlayerInRangeOfPoint should have 5 parameters: (playerid, DISTANCE, X, Y, Z). You added like 7 parameters?

Line 316 - 317:
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
        if(pickupid == CityHall)
        {
            GameTextForPlayer(playerid, "type /enter", 5000, 5);
            return 1;
        }
}
Lines 320 - 323 - Delete those lines for the moment.

See how many errors left?
Reply
#7

Its just a unmatched closing bracket ^^
EDIT: How I knew? It saies that some of the callbacks Are not implemented but they are. Find the missing bracket.
Reply
#8

Here you go, this complied for me.
pawn Код:
#include <a_samp>
#include <streamer>

#define COLOUR_SAMP 0xA9C4E4FF
#define COLOUR_DEBUG 0x88AA62FF
#define COLOR_GRAD1 0xB4B5B7FF
#define COLOR_GRAD2 0xBFC0C2FF
#define COLOR_GRAD3 0xCBCCCEFF
#define COLOR_GRAD4 0xD8D8D8FF
#define COLOR_GRAD5 0xE3E3E3FF
#define COLOR_GRAD6 0xF0F0F0FF
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x9EC73DAA
#define COLOR_GROVE 0x00FF00FF
#define COLOR_RED 0xAA3333AA
#define COLOR_COOLRED 0xB35959AA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_PINK 0xFF66FFAA
#define COLOR_DARKRED 0x660000AA
#define COLOR_BRIGHTRED 0xFF0000AA
#define COLOR_INDIGO 0x4B00B0AA
#define COLOR_VIOLET 0x9955DEEE
#define COLOR_GRAYWHITE 0xEEEEFFC4
#define COLOR_LIGHTNEUTRALBLUE 0xabcdef66
#define COLOR_GREENISHGOLD 0xCCFFDD56
#define COLOR_LIGHTBLUEGREEN 0x0FFDD349
#define COLOR_NEUTRALBLUE 0xABCDEF01
#define COLOR_LIGHTCYAN 0xAAFFCC33
#define COLOR_LEMON 0xDDDD2357
#define COLOR_LIGHTRED 0xFF6347AA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_LIGHTGREEN 0x9ACD32AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_YELLOW2 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_FADE1 0xE6E6E6E6
#define COLOR_FADE2 0xC8C8C8C8
#define COLOR_FADE3 0xAAAAAAAA
#define COLOR_FADE4 0x8C8C8C8C
#define COLOR_LIGHTYELLOW 0xFFFF91FF
#define COLOR_FADE5 0x6E6E6E6E
#define COLOR_PURPLE 0xC2A2DAAA
#define COLOR_CHAT1 0xF9B7FFAA
#define COLOR_CHAT2 0xE6A9ECAA
#define COLOR_CHAT3 0xC38EC7AA
#define COLOR_CHAT4 0xD2B9D3AA
#define COLOR_CHAT5 0xC6AEC7AA
#define COLOR_ALLDEPT 0xFF8282AA
#define COLOR_NEWS 0x458E1DAA
#define COLOR_OOC 0xE0FFFFAA
#define COLOR_BLUE 0x2641FEAA
#define COLOR_DBLUE 0x3333CCAA
#define COLOR_DARKNICERED 0x9D000096


#define COLOR_LIGHT_BLUE 0xa9c4e4FF
#define COLOR_SIMPSONS 0xFFD90FAA
#define COLOR_SEA 0x00808000
#define COLOR_INVIS 0xAFAFAF00
#define COLOR_SPEC 0xBFC0C200
#define COL_EASY           "{FFF1AF}"
#define COL_WHITE          "{FFFFFF}"
#define COL_BLACK          "{0E0101}"
#define COL_GREY           "{C3C3C3}"
#define COL_GREEN          "{6EF83C}"
#define COL_RED            "{F81414}"
#define COL_YELLOW         "{F3FF02}"
#define COL_ORANGE         "{FFAF00}"
#define COL_LIME           "{B7FF00}"
#define COL_CYAN           "{00FFEE}"
#define COL_LIGHTBLUE      "{00C0FF}"
#define COL_BLUE           "{0049FF}"
#define COL_MAGENTA        "{F300FF}"
#define COL_VIOLET         "{B700FF}"
#define COL_PINK           "{FF00EA}"
#define COL_MARONE         "{A90202}"
#define COL_CMD            "{B8FF02}"
#define COL_PARAM          "{3FCD02}"
#define COL_SERVER         "{AFE7FF}"
#define COL_VALUE          "{A3E4FF}"
#define COL_RULE           "{F9E8B7}"
#define COL_RULE2          "{FBDF89}"
#define COL_RWHITE         "{FFFFFF}"
#define COL_LGREEN         "{C9FFAB}"
#define COL_LRED           "{FFA1A1}"
#define COL_LRED2          "{C77D87}"

new Gate;
new Float:saveX[MAX_PLAYERS],Float:saveY[MAX_PLAYERS],Float:saveZ[MAX_PLAYERS];
new CityHall;

main()
{
    print("\n----------------------------------");
    print("gta server");
    print("----------------------------------\n");
}

public OnGameModeInit()
{
    // Player Selection Classes
    SetGameModeText("LV CARTELLS");
    AddPlayerClass(29,-3509.5193,799.9101,2.5338,41.3702,28,1000,26,200,0,0); //drug

//----------------------------------------------------------------------------


    // Gate stuff
    CreateObject(710,2090.149414,2463.698486,10.671875,0.000000,0.000000,0.000000); // entrance gates trees
    CreateObject(710,2115.380126,2463.694091,10.671875,0.000000,0.000000,0.000000); // cpy_entrance gates trees

    //gates
    Gate = CreateObject(972,2100.707519,2466.819335,9.561320,0.000000,0.000000,-90.000000); // closed gate
    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, -3515.6458,805.4797,2.5353);
    SetPlayerCameraPos(playerid, -3509.5193,799.9101,2.5338);
    SetPlayerCameraLookAt(playerid, -3515.6458,805.4797,2.5353);
    return 1;
}

public OnPlayerConnect(playerid)
{
    new pName[MAX_PLAYER_NAME], string[128];
    GetPlayerName(playerid, pName, sizeof(pName));
    format(string, sizeof(string), "%s(%d) has joined the server.", pName, playerid);
    SendClientMessageToAll(0xAFAFAFAA, string);
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    new pName[MAX_PLAYER_NAME], string[128];
    GetPlayerName(playerid, pName, sizeof(pName));
    switch(reason)
    {
        case 0: format(string, sizeof(string), "%s(%d) has left the server. (Lost Connection)", pName, playerid);
        case 1: format(string, sizeof(string), "%s(%d) has left the server. (Disconnected)", pName, playerid);
        case 2: format(string, sizeof(string), "%s(%d) has left the server. (Kicked)", pName, playerid);
    }
    SendClientMessageToAll(0xAFAFAFAA, string);
    return 1;
}

public OnPlayerSpawn(playerid)
{
    return 1;
}

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

public OnVehicleSpawn(vehicleid)
{
    return 1;
}

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

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

public OnPlayerCommandText(playerid, cmdtext[])
{
    //Teleports
    if (strcmp("/1", cmdtext, true, 10) == 0)
    {
        SetPlayerPos(playerid,-3464.0693,723.0591,2.8897);
        SetPlayerInterior(playerid,0);
        return 1;
    }
    if (strcmp("/2", cmdtext, true, 10) == 0)
    {
        SetPlayerPos(playerid,-665.3836,1975.3628,13.6719);
        SetPlayerInterior(playerid,0);
        return 2;
    }
    if (strcmp("/3", cmdtext, true, 10) == 0)
    {
        SetPlayerPos(playerid,2095.3274,2471.6055,10.8203);
        SetPlayerInterior(playerid,0);
        return 3;
    }
    if (strcmp("/4", cmdtext, true, 10) == 0)
    {
        SetPlayerPos(playerid,1699.6018,2313.6892,10.8203);
        SetPlayerInterior(playerid,0);
        return 4;
    }
    if (strcmp("/5", cmdtext, true, 10) == 0)
    {
        SetPlayerPos(playerid,-3304.7668,9.0324,2.8674);
        SetPlayerInterior(playerid,0);
        return 5;
    }
    //Gates
    if(strcmp("/opengate", cmdtext, true) == 0)
    {
             if(IsPlayerInRangeOfPoint(playerid, 10.0, 2100.707519,2466.819335,2.561320))
             {
              MoveObject(Gate,  2100.707519,2466.819335,2.561320, 1);
              SendClientMessage(playerid, COLOR_YELLOW, "Remote: Signal received: Opening Gate..");
              return 1;
             }
             else return SendClientMessage(playerid, COLOR_RED, "Remote: No signal found..");
    }

    if(strcmp("/closegate", cmdtext, true) == 0)
    {
             if(IsPlayerInRangeOfPoint(playerid, 10.0, 2100.707519,2466.819335,9.561320))
             {
              MoveObject(Gate,  2100.707519,2466.819335,9.561320, 1);
              SendClientMessage(playerid, COLOR_YELLOW, "Remote: Signal received: Closing Gate..");
              return 1;
             }
             else return SendClientMessage(playerid, COLOR_RED, "Remote: No signal found..");
    }


    //Enter cmds
    if(strcmp(cmdtext,"/enter", true)==0)
    {
        if(IsPlayerInRangeOfPoint(playerid,5.0,2067.6037597656,2484.482421875,11.078125))
        {
            GetPlayerPos(playerid,saveX[playerid],saveY[playerid],saveZ[playerid]);
            SetPlayerPos(playerid,460.49603271484,-88.599998474121,998.45471191406);
            SetPlayerInterior(playerid, 3);
        }
        return 1;
    }
    if(strcmp(cmdtext,"/exit", true)==0)
    {
        SetPlayerPos(playerid,saveX[playerid],saveY[playerid],saveZ[playerid]);
        SetPlayerInterior(playerid, 0);

        return 1;
    }
    return 0;
}

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

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

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    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 OnPlayerRequestSpawn(playerid)
{
    return 1;
}

public OnObjectMoved(objectid)
{
    return 1;
}

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

public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == CityHall)
    {
        GameTextForPlayer(playerid, "type /enter", 5000, 5);
    }
    return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
    return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
    return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
    return 1;
}

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

public OnPlayerExitedMenu(playerid)
{
    return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
    return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
    return 1;
}

public OnPlayerUpdate(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid,5.0,460.49603271484,-88.599998474121,998.45471191406))
    {
        GameTextForPlayer(playerid,"Type /exit",5000,5);
    }
    return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
    return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
    return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
    return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    return 1;
}
Reply
#9

Quote:
Originally Posted by Max_Coldheart
Посмотреть сообщение
Its just a unmatched closing bracket ^^
EDIT: How I knew? It saies that some of the callbacks Are not implemented but they are. Find the missing bracket.
Wanna bet that it`s not just a unclosed bracket?
Reply
#10

Quote:
Originally Posted by antonio112
Посмотреть сообщение
Well, the first error, line 239:
IsPlayerInRangeOfPoint should have 5 parameters: (playerid, DISTANCE, X, Y, Z). You added like 7 parameters?

Line 316 - 317:
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
        if(pickupid == CityHall)
        {
            GameTextForPlayer(playerid, "type /enter", 5000, 5);
            return 1;
        }
}
Lines 320 - 323 - Delete those lines for the moment.

See how many errors left?
There is one error after deleting that:

(239) : warning 202: number of arguments does not match definition
(239) : warning 202: number of arguments does not match definition
(360) : error 001: expected token: ")", but found "{"
(395) : warning 203: symbol is never used: "CityHall"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

I also tryed the post that hayden bruin posted and it compiles but there is no checkpoint. The cmds are not coming back with unknown error so they must be working, but i have no idea how to get this thing working.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)