[Help] Object script
#1

Anyone knows whats wrong with this code?

Код:
CreateObject(980, 681.42, 902.21, -41.00, 0.00, 0.00, 0.00);
CreateObject(980, 681.77, 891.29, -41.00, 0.00, 0.00, 0.00);
CreateObject(980, 676.25, 896.78, -41.00, 0.00, 0.00, 90.00);
CreateObject(980, 686.37, 896.69, -41.00, 0.00, 0.00, 90.00);
CreateObject(980, 678.09, 897.01, -38.00, 180.00, 89.97, 0.00);
CreateObject(980, 683.33, 896.88, -38.00, 180.00, 89.97, 0.00);
Reply
#2

Check the wiki next time:

Quote:

DO NOT USE!!! EVER!!!

974 - Car Door
975 - Car Bumper
976 - Car Side Panel
977 - Car Bonnet
978 - Car Boot/Trunk
979 - Car Wheel
980 - Additional Bodyparts
981 - More Additional Body Parts

Reply
#3

Okay but what do i do then when i make one and it isnt one of those you posted ..? do i just normal insert that code the map editor gives or do i have to add a code?
Reply
#4

The code you gave is fine as far as I can see, the only problem was that 980 is a bad object id.
Reply
#5

Change objectid parament to another one.
Reply
#6

I changed the object to another one and still nothing i got 13 errors

Objects:

Код:
CreateObject(971, 680.52, 890.96, -41.00, 0.00, 0.00, 0.00);
CreateObject(971, 680.34, 899.13, -40.00, 0.00, 0.00, 0.00);
CreateObject(971, 685.04, 895.13, -41.00, 0.00, 0.00, 90.00);
CreateObject(971, 676.31, 895.20, -41.00, 0.00, 0.00, 90.00);
CreateObject(971, 681.56, 893.45, -39.00, 90.00, 0.00, 0.00);
CreateObject(971, 681.40, 895.39, -39.00, 90.00, 0.00, 0.00);
Errors:
Код:
C:\Documents and Settings\Eldin_2\Desktop\SERVER SA-MP !\filterscripts\Jail2.pwn(1) : error 010: invalid function or declaration
C:\Documents and Settings\Eldin_2\Desktop\SERVER SA-MP !\filterscripts\Jail2.pwn(1) : error 010: invalid function or declaration
C:\Documents and Settings\Eldin_2\Desktop\SERVER SA-MP !\filterscripts\Jail2.pwn(2) : error 021: symbol already defined: "CreateObject"
C:\Documents and Settings\Eldin_2\Desktop\SERVER SA-MP !\filterscripts\Jail2.pwn(2) : error 010: invalid function or declaration
C:\Documents and Settings\Eldin_2\Desktop\SERVER SA-MP !\filterscripts\Jail2.pwn(3) : error 021: symbol already defined: "CreateObject"
C:\Documents and Settings\Eldin_2\Desktop\SERVER SA-MP !\filterscripts\Jail2.pwn(3) : error 010: invalid function or declaration
C:\Documents and Settings\Eldin_2\Desktop\SERVER SA-MP !\filterscripts\Jail2.pwn(4) : error 021: symbol already defined: "CreateObject"
C:\Documents and Settings\Eldin_2\Desktop\SERVER SA-MP !\filterscripts\Jail2.pwn(4) : error 010: invalid function or declaration
C:\Documents and Settings\Eldin_2\Desktop\SERVER SA-MP !\filterscripts\Jail2.pwn(5) : error 021: symbol already defined: "CreateObject"
C:\Documents and Settings\Eldin_2\Desktop\SERVER SA-MP !\filterscripts\Jail2.pwn(5) : error 010: invalid function or declaration
C:\Documents and Settings\Eldin_2\Desktop\SERVER SA-MP !\filterscripts\Jail2.pwn(6) : error 021: symbol already defined: "CreateObject"
C:\Documents and Settings\Eldin_2\Desktop\SERVER SA-MP !\filterscripts\Jail2.pwn(6) : error 010: invalid function or declaration
C:\Documents and Settings\Eldin_2\Desktop\SERVER SA-MP !\filterscripts\Jail2.pwn(7) : warning 203: symbol is never used: "CreateObject"
C:\Documents and Settings\Eldin_2\Desktop\SERVER SA-MP !\filterscripts\Jail2.pwn(7) : error 013: no entry point (no public functions)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
Reply
#7

Send Me a copy of your script. It should look like this.

pawn Код:
#include <a_samp>

// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Blank Filterscript by your name here");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

#else

main()
{
    print("\n----------------------------------");
    print(" Blank Gamemode by your name here");
    print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
    // Don't use these lines if it's a filterscript
    SetGameModeText("Blank Script");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);

     CreateObject(971, 680.52, 890.96, -41.00, 0.00, 0.00, 0.00);
     CreateObject(971, 680.34, 899.13, -40.00, 0.00, 0.00, 0.00);
     CreateObject(971, 685.04, 895.13, -41.00, 0.00, 0.00, 90.00);
     CreateObject(971, 676.31, 895.20, -41.00, 0.00, 0.00, 90.00);
     CreateObject(971, 681.56, 893.45, -39.00, 90.00, 0.00, 0.00);
     CreateObject(971, 681.40, 895.39, -39.00, 90.00, 0.00, 0.00);
    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    return 1;
}

public OnPlayerRequestSpawn(playerid)
{
    return 1;
}

public OnPlayerConnect(playerid)
{
    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 OnPlayerPrivmsg(playerid, recieverid, text[])
{
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/mycommand", cmdtext, true, 10) == 0)
    {
        // Do something here
        return 1;
    }
    return 0;
}

public OnPlayerInfoChange(playerid)
{
    return 1;
}

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 OnObjectMoved(objectid)
{
    return 1;
}

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

public OnPlayerPickUpPickup(playerid, pickupid)
{
    return 1;
}

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

public OnPlayerExitedMenu(playerid)
{
    return 1;
}
Reply
#8

*Scratches his head* Ha ? I only want those objects in no commands.
Reply
#9

Quote:
Originally Posted by xXiamCr4zyXx
I changed the object to another one and still nothing i got 13 errors

Objects:

Код:
CreateObject(971, 680.52, 890.96, -41.00, 0.00, 0.00, 0.00);
CreateObject(971, 680.34, 899.13, -40.00, 0.00, 0.00, 0.00);
CreateObject(971, 685.04, 895.13, -41.00, 0.00, 0.00, 90.00);
CreateObject(971, 676.31, 895.20, -41.00, 0.00, 0.00, 90.00);
CreateObject(971, 681.56, 893.45, -39.00, 90.00, 0.00, 0.00);
CreateObject(971, 681.40, 895.39, -39.00, 90.00, 0.00, 0.00);
Errors:
Код:
C:\Documents and Settings\Eldin_2\Desktop\SERVER SA-MP !\filterscripts\Jail2.pwn(1) : error 010: invalid function or declaration
C:\Documents and Settings\Eldin_2\Desktop\SERVER SA-MP !\filterscripts\Jail2.pwn(1) : error 010: invalid function or declaration
C:\Documents and Settings\Eldin_2\Desktop\SERVER SA-MP !\filterscripts\Jail2.pwn(2) : error 021: symbol already defined: "CreateObject"
C:\Documents and Settings\Eldin_2\Desktop\SERVER SA-MP !\filterscripts\Jail2.pwn(2) : error 010: invalid function or declaration
C:\Documents and Settings\Eldin_2\Desktop\SERVER SA-MP !\filterscripts\Jail2.pwn(3) : error 021: symbol already defined: "CreateObject"
C:\Documents and Settings\Eldin_2\Desktop\SERVER SA-MP !\filterscripts\Jail2.pwn(3) : error 010: invalid function or declaration
C:\Documents and Settings\Eldin_2\Desktop\SERVER SA-MP !\filterscripts\Jail2.pwn(4) : error 021: symbol already defined: "CreateObject"
C:\Documents and Settings\Eldin_2\Desktop\SERVER SA-MP !\filterscripts\Jail2.pwn(4) : error 010: invalid function or declaration
C:\Documents and Settings\Eldin_2\Desktop\SERVER SA-MP !\filterscripts\Jail2.pwn(5) : error 021: symbol already defined: "CreateObject"
C:\Documents and Settings\Eldin_2\Desktop\SERVER SA-MP !\filterscripts\Jail2.pwn(5) : error 010: invalid function or declaration
C:\Documents and Settings\Eldin_2\Desktop\SERVER SA-MP !\filterscripts\Jail2.pwn(6) : error 021: symbol already defined: "CreateObject"
C:\Documents and Settings\Eldin_2\Desktop\SERVER SA-MP !\filterscripts\Jail2.pwn(6) : error 010: invalid function or declaration
C:\Documents and Settings\Eldin_2\Desktop\SERVER SA-MP !\filterscripts\Jail2.pwn(7) : warning 203: symbol is never used: "CreateObject"
C:\Documents and Settings\Eldin_2\Desktop\SERVER SA-MP !\filterscripts\Jail2.pwn(7) : error 013: no entry point (no public functions)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
Ehm you can see that your errors are in the first 7 lines. One of them is always
Код:
warning 203: symbol is never used:
and
Код:
error 010: invalid function or declaration
The last is
Код:
error 013: no entry point (no public functions)
So i'm asking you regarding the last error, where did you placed the objects when you have no public function in your script. Looking at the first 6 errors i'd say you just opened a new script deleted all and copied the objects above in. Which obviously cannot work.
Like Abernethy wrote you have to place them under OnGameModeInit or OnFilterScriptInit when you want them to load when you start the script.


Код:
public OnGameModeInit()
{
	 CreateObject(971, 680.52, 890.96, -41.00, 0.00, 0.00, 0.00);
     CreateObject(971, 680.34, 899.13, -40.00, 0.00, 0.00, 0.00);
     CreateObject(971, 685.04, 895.13, -41.00, 0.00, 0.00, 90.00);
     CreateObject(971, 676.31, 895.20, -41.00, 0.00, 0.00, 90.00);
     CreateObject(971, 681.56, 893.45, -39.00, 90.00, 0.00, 0.00);
     CreateObject(971, 681.40, 895.39, -39.00, 90.00, 0.00, 0.00);
	 return 1;
}
Reply
#10

i Copied Abernethy's script or whatever and i still get 2 warnings

Код:
C:\Documents and Settings\Eldin_2\Desktop\SERVER SA-MP !\filterscripts\Jail.pwn(39) : warning 217: loose indentation
C:\Documents and Settings\Eldin_2\Desktop\SERVER SA-MP !\filterscripts\Jail.pwn(45) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Warnings.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)