:( Stay within world boundaries error....
#1

hi ,
i have been trying to make on SINGLE CHECKPOINT for the pass few hours and keep on getting errors , the latest one is "Please stay within world bourdaries" when i spawn my character.
I am using Incognito's Streamer include and CreateDynamicCP()

Here's my code untill Player spawn (below it i haven't did anything)
Код:
#include <a_samp>
#include <streamer>
#include <zcmd>
#include <sscanf2>
#include <dutils>
#include <YSI/y_ini>

new Checkpoint[2];
/*------------------------------------------------------
 Colors Define ****************************************
-------------------------------------------------------*/
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_BLUE 0x0000BBAA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_RED 0xAA3333AA
#define COLOR_LIME 0x10F441AA
#define COLOR_MAGENTA 0xFF00FFFF
#define COLOR_NAVY 0x000080AA
#define COLOR_AQUA 0xF0F8FFAA
#define COLOR_CRIMSON 0xDC143CAA
#define COLOR_FLBLUE 0x6495EDAA
#define COLOR_BISQUE 0xFFE4C4AA
#define COLOR_BLACK 0x000000AA
#define COLOR_CHARTREUSE 0x7FFF00AA
#define COLOR_BROWN 0XA52A2AAA
#define COLOR_CORAL 0xFF7F50AA
#define COLOR_GOLD 0xB8860BAA
#define COLOR_GREENYELLOW 0xADFF2FAA
#define COLOR_INDIGO 0x4B00B0AA
#define COLOR_IVORY 0xFFFF82AA
#define COLOR_LAWNGREEN 0x7CFC00AA
#define COLOR_LIMEGREEN 0x32CD32AA //<--- Dark lime
#define COLOR_MIDNIGHTBLUE 0X191970AA
#define COLOR_MAROON 0x800000AA
#define COLOR_OLIVE 0x808000AA
#define COLOR_ORANGERED 0xFF4500AA
#define COLOR_PINK 0xFFC0CBAA // - Light light pink
#define COLOR_SEAGREEN 0x2E8B57AA
#define COLOR_SPRINGGREEN 0x00FF7FAA
#define COLOR_TOMATO 0xFF6347AA // - Tomato >:/ sounds wrong lol... well... :P
#define COLOR_YELLOWGREEN 0x9ACD32AA //- like military green
#define COLOR_MEDIUMAQUA 0x83BFBFAA
#define COLOR_MEDIUMMAGENTA 0x8B008BAA // dark magenta ^^
#define COLOR_GREY        0xAFAFAFAA
#define COLOR_GREEN       0x33AA33AA
#define COLOR_BRIGHTRED   0xFF0000AA
#define COLOR_DARKRED     0xC60000FF
#define COLOR_YELLOW      0xFFFF00AA
#define COLOR_TAN         0xBDB76BAA
#define COLOR_PURPLE      0x800080AA
#define COLOR_WHITE       0xFFFFFFAA
#define COLOR_LIGHTBLUE   0x33CCFFAA
#define COLOR_ORANGE      0xFF9900AA
#define COLOR_INDIGO      0x4B00B0AA
#define COLOR_SYSTEM      0xa9c4e4
#define COLOR_SANTORANGE  0xFF6C3BAA
#define COLOR_INVIS       0xAFAFAF00
#define COLOR_CRIMBLUE    0x3A47DEFF
#define COLOR_WANTED      0xCC0066AA
#define COLOR_GROVE       0x378729FF
#define COLOR_BALLAS      0xA31D88FF
#define COLOR_DARKGREY    0x696969FF
#define COLOR_ERPSS       0x549852FF
#define COLOR_L1A         0x50A2ABFF
#define COLOR_FADE1       0xE6E6E6E6
#define COLOR_FADE2       0xC8C8C8C8
#define COLOR_FADE3       0xAAAAAAAA
#define COLOR_FADE4       0x8C8C8C8C
#define COLOR_FADE5       0x6E6E6E6E
#define BLACK             0x000000FF

/*------------------------------------------------------
 ******************************** End of Colors Define
-------------------------------------------------------*/
#define DEVELOPER "test"
#define VERSION "v.0.0.1a"
#undef MAX_PLAYERS
#define MAX_PLAYERS 50

/*------------------------------------------------------
 START OF SCRIPT
-------------------------------------------------------*/
#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print("TEST");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

#else

main()
{
    print("Tutorial Script");
    printf("Version: %s", VERSION);
    printf("Developer: %s", DEVELOPER);
}

#endif


/*------------------------------------------------------------
Game Initiate <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-------------------------------------------------------------*/
public OnGameModeInit()
{
    DisableInteriorEnterExits();
    AddPlayerClass(0,2271.2456,2405.2004,10.8203,320.2789,0,0,0,0,0,0);
    SetGameModeText("Test");
    return 1;
}

/*------------------------------------------------------------
 End of Game Initiate
-------------------------------------------------------------*/

public OnGameModeExit()
{
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 2271.2456,2405.2004,10.8203);
    SetPlayerCameraPos(playerid, 2271.2456,2405.2004,10.8203);
    SetPlayerCameraLookAt(playerid, 2271.2456,2405.2004,10.8203);
    return 1;
}

/*---------------------------------------------------------------------
On Player connect
----------------------------------------------------------------------*/
public OnPlayerConnect(playerid)
{
return 1;
}


/*---------------------------------------------------------------------
On Player dicconnect
----------------------------------------------------------------------*/


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

/*---------------------------------------------------------------------
On Player
----------------------------------------------------------------------*/

public OnPlayerSpawn(playerid)
{
    Checkpoint[0] = CreateDynamicCP(-2112.7422,-753.4459,32.1719, 4, -1, -1, -1, 100); // Creates a checkpoint at -2112.7422,-753.4459,32.1719 with a range of 4, in any virtualworld, interior and for every player
    Checkpoint[1] = CreateDynamicCP(-2112.9177,-760.9539,32.1719, 4, 5, -1, -1, 100); // Creates a checkpoint at -2112.9177,-760.9539,32.1719 with a range of 4, in virtualworld 5, any interior, and for every player
    return 1;
}
When i remove the <streamer> include , everything went back to normal and no errors (but my checkpoint will not work of course).

Please , i hope someone can help me on this.


I a newbie just started SAMP server programming

Reply
#2

You need to put the checkpoint creation code to OnGameModeInit, not OnPlayerSpawn
Reply
#3

thanks for replying..same error...i put it in OnGamemodeInt

Код:
public OnGameModeInit()
{
    DisableInteriorEnterExits();
    AddPlayerClass(0,2271.2456,2405.2004,10.8203,320.2789,0,0,0,0,0,0);
    SetGameModeText("Test");
    Checkpoint[0] = CreateDynamicCP(-2112.7422,-753.4459,32.1719, 4, -1, -1, -1, 100); // Creates a checkpoint at -2112.7422,-753.4459,32.1719 with a range of 4, in any virtualworld, interior and for every player
    Checkpoint[1] = CreateDynamicCP(-2112.9177,-760.9539,32.1719, 4, 5, -1, -1, 100); // Creates a checkpoint at -2112.9177,-760.9539,32.1719 with a range of 4, in virtualworld 5, any interior, and for every player
    return 1;
}
Reply
#4

when i dont include streamer , everything works fine...
Reply
#5

Do you have the streamer plugin aswell? Does the console say that it was loaded successfully?
Reply
#6

Yeah. i put streamer.inc in my pawno include and when i start the server everything is loaded well.
Reply
#7

or do you know any full tutorials on checkpoints using streamer? thankss.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)