Request Class Bug Help Needed
#1

Hello, could someone tell me why when I die it says returning to class selection and F4 doesn't work, as in it doesn't do anything?

Here's all the code I have added in so far:
pawn Код:
public OnGameModeInit()
{
    ShowPlayerMarkers(1);

    AddPlayerClassEx(1, 270, 1568.7001, -1692.1791, 5.8906, 184.3483, 24, 1000, 25, 1000, 31, 1000);// Gangsters
    AddPlayerClassEx(2, 5, 936.0454, -1386.3639, 13.3991, 184.5401, 24, 1000, 25, 1000, 31, 1000); // Fatty's
    AddPlayerClassEx(3, 281, 1568.7001, -1692.1791, 5.8906, 184.3483, 24, 1000, 25, 1000, 31, 1000); // Police
    AddPlayerClassEx(4, 230, 1658.0037, -1836.8112, 13.5476, 79.0180, 24, 1000, 25, 1000, 31, 1000); // Homeless
    AddPlayerClassEx(5, 178, 2421.6531, -1220.6165, 25.4725, 193.4817, 24, 1000, 25, 1000, 31, 1000); // Stripper
    AddPlayerClassEx(6, 274, 2034.1166, -1414.9341, 16.9922, 133.6346, 24, 1000, 25, 1000, 31, 1000); // Medics
    AddPlayerClassEx(7, 68, 2232.1021, -1333.1947, 23.9815, 93.0692, 24, 1000, 25, 1000, 31, 1000); // Priest
    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    if(classid == 0)
    {
        SendClientMessage(playerid, Colour_White, "Gangsters");
    }
    else if(classid == 1)
    {
        SendClientMessage(playerid, Colour_White, "Fatty's");
    }
    else if(classid == 2)
    {
        SendClientMessage(playerid, Colour_White, "The Po-Po");
    }
    else if(classid == 3)
    {
        SendClientMessage(playerid, Colour_White, "Homeless");
    }
    else if(classid == 4)
    {
        SendClientMessage(playerid, Colour_White, "Strippers");
    }
    else if(classid == 5)
    {
        SendClientMessage(playerid, Colour_White, "Medics");
    }
    else if(classid == 6)
    {
        SendClientMessage(playerid, Colour_White, "Priest");
    }
    return 1;
}

public OnPlayerRequestSpawn(playerid)
{
    SpawnPlayer(playerid);
    SetPlayerInterior(playerid, 0);
    return 1;
}

public OnPlayerSpawn(playerid)
{
    switch(GetPlayerTeam(playerid))
    {
        case 1:
        {
            SetPlayerColor(playerid, 0x1B9632AA); // Gangsters
        }
        case 2:
        {
            SetPlayerColor(playerid, 0xF58916AA); // Fatty's
        }
        case 3:
        {
            SetPlayerColor(playerid, 0x0B34BAAA); // The Po-Po
        }
        case 4:
        {
            SetPlayerColor(playerid, 0xEAF516AA); // Homeless
        }
        case 5:
        {
            SetPlayerColor(playerid, 0xF516D7AA); // Strippers
        }
        case 6:
        {
            SetPlayerColor(playerid, 0xF20505AA); // Medics
        }
        case 7:
        {
            SetPlayerColor(playerid, 0x969696AA); // Priest
        }
        case 0:
        {
            SetPlayerInterior(playerid, 3);
            ForceClassSelection(playerid);
            TogglePlayerSpectating(playerid, true);
            TogglePlayerSpectating(playerid, false);
        }
    }
    return 1;
}

public OnPlayerConnect(playerid)
{
    SetSpawnInfo(playerid, 0, 0, 513.882507, -11.269994, 1001.565307, 0, 0, 0, 0, 0, 0, 0);
    SpawnPlayer(playerid);
    return 1;
}
Thank you to who ever can help me.
Reply
#2

You added this OnPlayerSpawn:
pawn Код:
ForceClassSelection(playerid);
Do you even know what this is?
By this code, when player is spawning, you're forcing him to class selection, so to remove that "Returning to class selection" message you need to remove this message.
Reply
#3

Quote:
Originally Posted by JimmyCh
Посмотреть сообщение
You added this OnPlayerSpawn:
pawn Код:
ForceClassSelection(playerid);
Do you even know what this is?
By this code, when player is spawning, you're forcing him to class selection, so to remove that "Returning to class selection" message you need to remove this message.
Yes for players who don't have a team as they spawn on connect so that they can see the skin that is with there team..
Reply
#4

In
pawn Код:
Public OnPlayerSpawn
use
pawn Код:
SetPlayerPos(playerid, float:x , float:y, float:z);
it will resolve your problem cause you have not set that where player need to be spawn
Reply
#5

Don't add that OnPlayerSpawn, you can make a command like /st to switch team(ForceClassSelection(playerid))
If you mean you want to force them when they connect, you must put this OnPlayerRequestClass..
Reply
#6

Quote:
Originally Posted by PrinceKumar
Посмотреть сообщение
In
pawn Код:
Public OnPlayerSpawn
use
pawn Код:
SetPlayerPos(playerid, float:x , float:y, float:z);
it will resolve your problem cause you have not set that where player need to be spawn
Look in the gamemode init, the classes do that.
Reply
#7

Quote:
Originally Posted by JimmyCh
Посмотреть сообщение
Don't add that OnPlayerSpawn, you can make a command like /st to switch team(ForceClassSelection(playerid))
If you mean you want to force them when they connect, you must put this OnPlayerRequestClass..
I don't think your getting what the switch is doing.
Reply
#8

Yea as you can see I'm a nab scripter that's why I got negative reputation, sorry about that.
I'm trying to help you out, but you ain't helping us out with your info.
Reply
#9

Quote:
Originally Posted by JimmyCh
Посмотреть сообщение
Yea as you can see I'm a nab scripter that's why I got negative reputation, sorry about that.
I'm trying to help you out, but you ain't helping us out with your info.
Ok there's no need to give me that attitude, and what's a nab? It's kinda childish to be saying that in a HELP section.
Anyways I've fixed it now, thanks for everyone's help.

EDIT: I got negative rep for speaking my mind, I'm an alright scripter and probably know more than you, I mean I have a better attitude to people learning to code a basic language.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)