[BUG?] Stay withing the world boundries
#1

Jo Guys. I found probably a bug. It's very annoying. I had it on samp 0.3b too, the only way I could fix was: Make new GM. This is what happens:
I connect. Nothing happens (new GM)
I press SPAWN...
Then I get a white screens, and the text 'Stay within the world boundries!'
Then I am just stuck....
I have SA:MP 0.3c RC6. And this is the GM:

pawn Код:
/*
    RP4L (RolePlay For Life) : PR-RP Gamemode.
    Created by Kwarde, for Ricardo187, server RealLife Roleplay (http://www.rl-rp.com)
    Credits:
        * Kwarde: The main script (NON-EDIT)
        * ******: Some tutorials, sscanf function
        * Zamaroth: Textdraw Editor
        * JaTochNietDan: SAMP Script King program
        * [RP]Brock: bCP easy color picker
        * xTreme: Xtreme vehicle plotter
        * Dracoblue: Dini, hash function
*/


#include <a_samp>
#include <dcmd>
#include <streamer>
#include <dini>

#undef MAX_PLAYERS
#define MAX_SLOTS               500

#define COLOR_WHITE             0xFFFFFFAA
#define COLOR_RED               0xFF0000AA
#define COLOR_GREEN             0x00FF00AA
#define COLOR_BLUE              0x0000FFAA
#define COLOR_GRAY              0xAFAFAFAA
#define COLOR_YELLOW            0xFFFF00AA
#define COLOR_LIGHTBLUE         0x0AFFFFAA
#define COLOR_PURPLE            0xFF00FFAA
#define COLOR_ORANGE            0xFFBB00AA

#define TEAM_PEDS               0
#define TEAM_COPS               1
#define TEAM_ARMY               2
#define TEAM_MEDIC              3
#define TEAM_FBI                4
#define TEAM_SWAT               5
#define TEAM_FIRE               6
#define TEAM_MAFIA              7
#define TEAM_DEALER             8
#define TEAM_NEWS               9
#define TEAM_UNKNOWN            10

#define TEAMCOLOR_PEDS          0xFFFFFFFF
#define TEAMCOLOR_COPS          0x005CF6FF
#define TEAMCOLOR_ARMY          0x009800FF
#define TEAMCOLOR_MEDIC         0x00FFFFFF
#define TEAMCOLOR_FBI           0x005CF6FF
#define TEAMCOLOR_SWAT          0x007EFFFF
#define TEAMCOLOR_FIRE          0xFF4100FF
#define TEAMCOLOR_MAFIA         0xAA4100FF
#define TEAMCOLOR_DEALER        0xAA4100FF
#define TEAMCOLOR_NEWS          0x00DDDDFF
#define TEAMCOLOR_UNKNOWN       0xAFAFAFFF

#define PLAYERCOLOR_AFKBRB      0x00000000
#define PLAYERCOLOR_SUSPECTLOW  0xFFFF00FF
#define PLAYERCOLOR_SUSPECTMED  0xFF9200FF
#define PLAYERCOLOR_SUSPECTHIGH 0xFF1D00FF
#define PLAYERCOLOR_ADMINDUTY   0xFF0000FF

#define HOSTNAME "[NL] RolePlay4Life [EN][24/7]"
#define OWNERNAME "Kwarde"

new PlayerName[MAX_SLOTS][MAX_PLAYER_NAME];

enum sInfo
{
    ConnectedPlayers,
    bool:ChatLocked
};
new ServerInfo[sInfo];

main()
{
    print(" ");
    print("\n------------------------------------------");
    print("     RP4L Loaded.");
    print("------------------------------------------\n");
    print(" ");
}

public OnGameModeInit()
{
    print("Gamemode loading... [0%]");

    SetGameModeText("RP4L-B1");
    print("Standard configuration loaded [%]");

    return 1;
}

public OnPlayerConnect(playerid)
{
    new string[128];
    GetPlayerName(playerid, PlayerName[playerid], MAX_PLAYER_NAME);
   
    format(string, 128, "** {FF0000}%s{00FF00} has joined the server [Players online: {FFFFFF}%d{00FF00}]", PlayerName[playerid], ServerInfo[ConnectedPlayers]+1);
    SendClientMessageToAll(COLOR_GREEN, string);
    ServerInfo[ConnectedPlayers]++;
   
    SetPlayerPos(playerid, 0, 0, 0);
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    new string[128];
   
    switch(reason)
    {
        case 0: format(string, 128, "** {FF0000}%s{AFAFAF} has left the server (Loosing Connection) [Players Online: {FFFFFF}%d{AFAFAF}]", PlayerName[playerid], ServerInfo[ConnectedPlayers]-1);
        case 1: format(string, 128, "** {FF0000}%s{AFAFAF} has left the server (Leaving) [Players Online: {FFFFFF}%d{AFAFAF}]", PlayerName[playerid], ServerInfo[ConnectedPlayers]-1);
        case 2: format(string, 128, "** {FF0000}%s{AFAFAF} has been kicked/banned from the server [Players Online: {FFFFFF}%d{AFAFAF}]", PlayerName[playerid], ServerInfo[ConnectedPlayers]-1);
    }
    SendClientMessageToAll(COLOR_GRAY, string);
    ServerInfo[ConnectedPlayers]--;
    return 1;
}

public OnPlayerSpawn(playerid)
{
    SetPlayerPos(playerid, 0, 0, 0);
    return 1;
}
Will this be fixed when I made more, or do I have to start over? (AGAIN) -.-"
Thanks in advance.

- Kevin
Reply
#2

Take the SetPlayerPos out of OnPlayerConnect first of all. In OnPlayerSpawn, try using different coords instead of 0, 0, 0.
Reply
#3

I tried them both already. But still thanks.
It won't work :S (actually, I had the bug without SetPlayerPos, so I tried that. Forgot to remove it again)

- Kevin
Reply
#4

Add a class(AddPlayerClass) to OnGameModeInit. Try that.
Reply
#5

I'll do. I'll edit the message when I'm done.

[EDIT]
heheh it worked. Thanks mate.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)